diff --git a/.babelignore b/.babelignore deleted file mode 100644 index ec46d9b5e8..0000000000 --- a/.babelignore +++ /dev/null @@ -1,2 +0,0 @@ -test/fixtures -lib diff --git a/.babelrc b/.babelrc index 545548e0d7..7717ac3939 100644 --- a/.babelrc +++ b/.babelrc @@ -7,8 +7,7 @@ "stage-0" ], "plugins": [ - "transform-flow-strip-types", - "external-helpers" + "transform-flow-strip-types" ], "env": { "watch": { diff --git a/.flowconfig b/.flowconfig index 3dccffe4e4..ec70beff84 100644 --- a/.flowconfig +++ b/.flowconfig @@ -11,4 +11,3 @@ strip_root=true suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe suppress_comment= \\(.\\|\n\\)*\\$FlowIssue -suppress_comment= \\(.\\|\n\\)*\\$FlowIgnore diff --git a/.travis.yml b/.travis.yml index eb22eaf9c0..e1d38de890 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,43 +1,48 @@ sudo: false language: node_js node_js: + - "0.10" + - "0.12" - "4" + - "5" - "6" - "7" -env: - - JOB=test +before_install: + # Rollup doesn't support node < 4.x. Switch to latest for build + - . $HOME/.nvm/nvm.sh + - nvm install stable && nvm use stable before_script: - - 'if [ "$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' + - 'if [ -n "${BABEL-}" ]; then make bootstrap-babel ; fi' + - 'if [ -n "${FLOWTESTS-}" ]; then make bootstrap-flow ; fi' + - 'BABEL_ENV=test npm run build' + # Switch back to node version currently being tested prior to test run + - 'nvm use $TRAVIS_NODE_VERSION;' script: - - 'if [ "$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' + - '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' matrix: fast_finish: true include: - - 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 + - node_js: "node" + env: LINT=true + - node_js: "node" + env: FLOW=true + - node_js: "node" + env: BABEL=true + - node_js: "node" + env: FLOWTESTS=true allow_failures: - - node_js: "lts/*" - env: JOB=flow-test + - node_js: "node" + env: FLOWTESTS=true -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' +after_success: 'if [ -z "${LINT-}" ] && [ -z "${FLOW-}" ] && [ -z "${FLOWTESTS-}" ]; then npm run coverage ; fi' notifications: slack: babeljs:5Wy4QX13KVkGy9CnU0rmvgeK diff --git a/CHANGELOG.md b/CHANGELOG.md index b7a486500a..bb482fc5c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,125 +15,6 @@ _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 eefd2e2706..5130b2c078 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,14 +6,10 @@ 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 -git clone https://github.com/babel/babylon -cd babylon -yarn +npm install ``` ## Tests @@ -23,45 +19,25 @@ yarn To run a build, tests and perform lint/flow checks: ```bash -yarn test +npm test ``` If you only want to run the tests: ```bash -yarn run test-only +npm run test-only ``` -Note, this does not actually run a build, so you may have to call `yarn run build` after +Note, this does not actually run a build, so you may have to call `npm run build` after performing any changes. -### Running one test - -To run only a single test, add `"only": true` to the `options.json` inside any test fixture folder (you may have to create the file if it doesn't exist). -For example, let's say we want to only run the test for the [`test/fixtures/comments/basic/shebang-import`](https://github.com/babel/babylon/tree/7.0/test/fixtures/comments/basic/shebang-import) fixture. - -Add `"only": true` to its `options.json`: - -```json -{ - "sourceType": "module", - "only": true -} -``` - -Then, run the tests using the same command as before: - -```bash -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 yarn run build && yarn run test-coverage +BABEL_ENV=test npm run build && npm run test-ci ``` ### Writing tests @@ -85,21 +61,19 @@ you will want to link both repositories together. This can be done by doing the ```bash cd babylon/ -yarn link -yarn run build +npm link +npm run build cd ../babel/ make bootstrap -yarn link babylon +npm link babylon cd packages/babel-core/ -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 +npm link babylon +cd ../../packages/babel-template/ +npm link babylon +cd ../../packages/babel-traverse/ +npm link babylon +cd ../../packages/babel-generator/ +npm link babylon cd ../.. make build make test diff --git a/Makefile b/Makefile index 351fc07848..22e088f90a 100644 --- a/Makefile +++ b/Makefile @@ -8,18 +8,19 @@ clean: ; rm -rf ./build bootstrap-babel: clean mkdir ./build - git clone --depth=1 --branch=7.0 https://github.com/babel/babel.git ./build/babel + git clone --depth=1 --branch=master 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 yarn run build + BABEL_ENV=test npm 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 --reporter=json --report-dir ../../coverage node_modules/mocha/bin/_mocha `scripts/_get-test-directories.sh` --opts test/mocha.opts --compilers js:babel-register; \ + ../../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 bootstrap-flow: clean mkdir ./build diff --git a/README.md b/README.md index 3aaf8acf43..65ee78a8f6 100644 --- a/README.md +++ b/README.md @@ -1,137 +1,20 @@ -

- babylon -

+# babylon-lightscript -

- Babylon is a JavaScript parser used in Babel. -

+The parser for [LightScript](http://lightscript.org), a concise syntax for JavaScript. -

- NPM Version - Travis Status - Codecov Status -

+To be used through [babel-plugin-lightscript](https://github.com/lightscript/babel-plugin-lightscript). - - The latest ECMAScript version enabled by default (ES2017). - - Comment attachment. - - Support for JSX and Flow. - - Support for experimental language proposals (accepting PRs for anything at least [stage-0](https://github.com/tc39/proposals/blob/master/stage-0-proposals.md)). +A minimally-invasive fork of [Babylon](https://github.com/babel/babylon). +With the exception of a few reserved keywords, +it parses JS as JS unless the `"lightscript"` plugin is passed. -## Credits -Heavily based on [acorn](https://github.com/marijnh/acorn) and [acorn-jsx](https://github.com/RReverser/acorn-jsx), -thanks to the awesome work of [@RReverser](https://github.com/RReverser) and [@marijnh](https://github.com/marijnh). +### Contributing -Significant diversions are expected to occur in the future such as streaming, EBNF definitions, sweet.js integration, interspatial parsing and more. - -## API - -### `babylon.parse(code, [options])` - -### `babylon.parseExpression(code, [options])` - -`parse()` parses the provided `code` as an entire ECMAScript program, while -`parseExpression()` tries to parse a single Expression with performance in -mind. When in doubt, use `.parse()`. - -### Options - -- **allowImportExportEverywhere**: By default, `import` and `export` - declarations can only appear at a program's top level. Setting this - option to `true` allows them anywhere where a statement is allowed. - -- **allowReturnOutsideFunction**: By default, a return statement at - the top level raises an error. Set this to `true` to accept such - code. - -- **allowSuperOutsideMethod**: TODO - -- **sourceType**: Indicate the mode the code should be parsed in. Can be - either `"script"` or `"module"`. - -- **sourceFilename**: Correlate output AST nodes with their source filename. Useful when generating code and source maps from the ASTs of multiple input files. - -- **startLine**: By default, the first line of code parsed is treated as line 1. You can provide a line number to alternatively start with. Useful for integration with other source tools. - -- **plugins**: Array containing the plugins that you want to enable. - -- **strictMode**: TODO - -- **ranges**: Adds a `ranges` property to each node: `[node.start, node.end]` - -### Output - -Babylon generates AST according to [Babel AST format][]. -It is based on [ESTree spec][] with the following deviations: - -> There is now an `estree` plugin which reverts these deviations - -- [Literal][] token is replaced with [StringLiteral][], [NumericLiteral][], [BooleanLiteral][], [NullLiteral][], [RegExpLiteral][] -- [Property][] token is replaced with [ObjectProperty][] and [ObjectMethod][] -- [MethodDefinition][] is replaced with [ClassMethod][] -- [Program][] and [BlockStatement][] contain additional `directives` field with [Directive][] and [DirectiveLiteral][] -- [ClassMethod][], [ObjectProperty][], and [ObjectMethod][] value property's properties in [FunctionExpression][] is coerced/brought into the main method node. - -AST for JSX code is based on [Facebook JSX AST][] with the addition of one node type: - -- `JSXText` - -[Babel AST format]: https://github.com/babel/babylon/blob/master/ast/spec.md -[ESTree spec]: https://github.com/estree/estree - -[Literal]: https://github.com/estree/estree/blob/master/es5.md#literal -[Property]: https://github.com/estree/estree/blob/master/es5.md#property -[MethodDefinition]: https://github.com/estree/estree/blob/master/es2015.md#methoddefinition - -[StringLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#stringliteral -[NumericLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#numericliteral -[BooleanLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#booleanliteral -[NullLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#nullliteral -[RegExpLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#regexpliteral -[ObjectProperty]: https://github.com/babel/babylon/blob/master/ast/spec.md#objectproperty -[ObjectMethod]: https://github.com/babel/babylon/blob/master/ast/spec.md#objectmethod -[ClassMethod]: https://github.com/babel/babylon/blob/master/ast/spec.md#classmethod -[Program]: https://github.com/babel/babylon/blob/master/ast/spec.md#programs -[BlockStatement]: https://github.com/babel/babylon/blob/master/ast/spec.md#blockstatement -[Directive]: https://github.com/babel/babylon/blob/master/ast/spec.md#directive -[DirectiveLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#directiveliteral -[FunctionExpression]: https://github.com/babel/babylon/blob/master/ast/spec.md#functionexpression - -[Facebook JSX AST]: https://github.com/facebook/jsx/blob/master/AST.md - -### Semver - -Babylon follows semver in most situations. The only thing to note is that some spec-compliancy bug fixes may be released under patch versions. - -For example: We push a fix to early error on something like [#107](https://github.com/babel/babylon/pull/107) - multiple default exports per file. That would be considered a bug fix even though it would cause a build to fail. - -### Example - -```javascript -require("babylon").parse("code", { - // parse in strict mode and allow module declarations - sourceType: "module", - - plugins: [ - // enable jsx and flow syntax - "jsx", - "flow" - ] -}); -``` - -### Plugins - - - `estree` - - `jsx` - - `flow` - - `doExpressions` - - `objectRestSpread` - - `decorators` (Based on an outdated version of the Decorators proposal. Will be removed in a future version of `Babylon`) - - `classProperties` - - `exportExtensions` - - `asyncGenerators` - - `functionBind` - - `functionSent` - - `dynamicImport` + yarn + yarn build + yarn test +New tests should go in the +[lightscript](https://github.com/lightscript/babylon-lightscript/tree/lightscript/test/fixtures/lightscript) +directory. diff --git a/ast/spec.md b/ast/spec.md index 0ff1c87c51..9e2e094b9f 100644 --- a/ast/spec.md +++ b/ast/spec.md @@ -1,7 +1,6 @@ These are the core Babylon AST node types. - [Node objects](#node-objects) -- [Changes](#changes) - [Identifier](#identifier) - [Literals](#literals) - [RegExpLiteral](#regexpliteral) @@ -36,6 +35,7 @@ These are the core Babylon AST node types. - [ForStatement](#forstatement) - [ForInStatement](#forinstatement) - [ForOfStatement](#forofstatement) + - [ForAwaitStatement](#forawaitstatement) - [Declarations](#declarations) - [FunctionDeclaration](#functiondeclaration) - [VariableDeclaration](#variabledeclaration) @@ -56,6 +56,8 @@ 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) @@ -76,7 +78,6 @@ These are the core Babylon AST node types. - [CallExpression](#callexpression) - [NewExpression](#newexpression) - [SequenceExpression](#sequenceexpression) - - [DoExpression](#doexpression) - [Template Literals](#template-literals) - [TemplateLiteral](#templateliteral) - [TaggedTemplateExpression](#taggedtemplateexpression) @@ -139,22 +140,6 @@ 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 @@ -493,7 +478,16 @@ A `for`/`in` statement. ```js interface ForOfStatement <: ForInStatement { type: "ForOfStatement"; - await: boolean; +} +``` + +A `for`/`await` statement. + +## ForAwaitStatement + +```js +interface ForAwaitStatement <: ForInStatement { + type: "ForAwaitStatement"; } ``` @@ -657,7 +651,7 @@ An array expression. ```js interface ObjectExpression <: Expression { type: "ObjectExpression"; - properties: [ ObjectProperty | ObjectMethod | SpreadElement ]; + properties: [ ObjectProperty | ObjectMethod | SpreadProperty ]; } ``` @@ -669,6 +663,7 @@ An object expression. interface ObjectMember <: Node { key: Expression; computed: boolean; + value: Expression; decorators: [ Decorator ]; } ``` @@ -679,7 +674,6 @@ interface ObjectMember <: Node { interface ObjectProperty <: ObjectMember { type: "ObjectProperty"; shorthand: boolean; - value: Expression; } ``` @@ -692,6 +686,24 @@ interface ObjectMethod <: ObjectMember, Function { } ``` +## RestProperty + +```js +interface RestProperty <: Node { + type: "RestProperty"; + argument: Expression; +} +``` + +## SpreadProperty + +```js +interface SpreadProperty <: Node { + type: "SpreadProperty"; + argument: Expression; +} +``` + ## FunctionExpression ```js @@ -908,15 +920,6 @@ 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 @@ -946,7 +949,7 @@ interface TemplateElement <: Node { type: "TemplateElement"; tail: boolean; value: { - cooked: string | null; + cooked: string; raw: string; }; } @@ -967,7 +970,7 @@ interface AssignmentProperty <: ObjectProperty { interface ObjectPattern <: Pattern { type: "ObjectPattern"; - properties: [ AssignmentProperty | RestElement ]; + properties: [ AssignmentProperty | RestProperty ]; } ``` @@ -1022,9 +1025,10 @@ interface ClassBody <: Node { ## ClassMethod ```js -interface ClassMethod <: Function { +interface ClassMethod <: Node { type: "ClassMethod"; key: Expression; + value: FunctionExpression; kind: "constructor" | "method" | "get" | "set"; computed: boolean; static: boolean; diff --git a/bin/babylon-lightscript.js b/bin/babylon-lightscript.js new file mode 100755 index 0000000000..b74fdc7e0d --- /dev/null +++ b/bin/babylon-lightscript.js @@ -0,0 +1,16 @@ +#!/usr/bin/env node +/* eslint no-var: 0 */ + +var babylon = require(".."); +var fs = require("fs"); + +var filename = process.argv[2]; +if (!filename) { + console.error("no filename specified"); + process.exit(0); +} + +var file = fs.readFileSync(filename, "utf8"); +var ast = babylon.parse(file, { plugins: ["lightscript"] }); + +console.log(JSON.stringify(ast, null, " ")); diff --git a/package.json b/package.json index 3280a72a9a..7534fceb0f 100644 --- a/package.json +++ b/package.json @@ -1,64 +1,64 @@ { - "name": "babylon", - "version": "7.0.0-beta.8", - "description": "A JavaScript parser", - "author": "Sebastian McKenzie ", - "homepage": "https://babeljs.io/", + "name": "babylon-lightscript", + "version": "0.5.9", + "description": "A LightScript parser, based on babylon (a JavaScript parser)", + "author": "Alex Rattray ", + "homepage": "http://lightscript.org/", "license": "MIT", "keywords": [ "babel", "javascript", "parser", - "babylon" + "babylon", + "lightscript" ], - "repository": "https://github.com/babel/babylon", + "repository": "https://github.com/lightscript/babylon-lightscript", "main": "lib/index.js", "files": [ "bin", "lib" ], - "engines": { - "node": ">=4.2.0" - }, "devDependencies": { - "ava": "^0.19.0", - "babel-cli": "^7.0.0-alpha.6", + "ava": "^0.17.0", + "babel-cli": "^6.14.0", "babel-eslint": "^7.0.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", + "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", "chalk": "^1.1.3", - "cross-env": "^4.0.0", + "codecov": "^1.0.1", + "cross-env": "^2.0.0", "eslint": "^3.7.1", "eslint-config-babel": "^6.0.0", "eslint-plugin-flowtype": "^2.20.0", - "flow-bin": "^0.44.0", + "flow-bin": "^0.40.0", "nyc": "^10.0.0", "rimraf": "^2.5.4", "rollup": "^0.41.0", "rollup-plugin-babel": "^2.6.1", - "rollup-plugin-node-resolve": "^3.0.0", - "rollup-watch": "^3.2.2", + "rollup-plugin-node-resolve": "^2.0.0", + "try-resolve": "^1.0.1", "unicode-9.0.0": "~0.7.0" }, "bin": { - "babylon": "./bin/babylon.js" + "babylon": "./bin/babylon.js", + "babylon-lightscript": "./bin/babylon-lightscript.js" }, "scripts": { - "build": "yarn run clean && rollup -c", - "changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:' * %s (%an)' | grep -v 'Merge pull request'", + "build": "npm run clean && rollup -c", + "coverage": "nyc report --reporter=json && codecov -f coverage/coverage-final.json", + "lint": "eslint src bin", "clean": "rimraf lib", "flow": "flow", - "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", + "prepublish": "cross-env BABEL_ENV=production npm run build", + "preversion": "npm run test", + "test": "npm run lint && npm run flow && npm run build -- -m && npm run test-only", "test-only": "ava", - "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" + "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" }, "nyc": { "include": [ @@ -76,5 +76,10 @@ "src/**/*.js", "bin/**/*.js" ] + }, + "greenkeeper": { + "ignore": [ + "cross-env" + ] } } diff --git a/scripts/rmExpected.js b/scripts/rmExpected.js deleted file mode 100644 index 613071b02f..0000000000 --- a/scripts/rmExpected.js +++ /dev/null @@ -1,24 +0,0 @@ -// 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 09a5c40cbe..7e4285c809 100755 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,3 @@ -// @flow - -import type { Options } from "./options"; import Parser, { plugins } from "./parser"; import "./parser/util"; import "./parser/statement"; @@ -14,21 +11,21 @@ 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"; import jsxPlugin from "./plugins/jsx"; +plugins.lightscript = lightscriptPlugin; plugins.estree = estreePlugin; plugins.flow = flowPlugin; plugins.jsx = jsxPlugin; -export function parse(input: string, options?: Options): File { - return getParser(options, input).parse(); +export function parse(input, options) { + return new Parser(options, input).parse(); } -export function parseExpression(input: string, options?: Options): Expression { - const parser = getParser(options, input); +export function parseExpression(input, options) { + const parser = new Parser(options, input); if (parser.options.strictMode) { parser.state.strict = true; } @@ -37,39 +34,3 @@ export function parseExpression(input: string, options?: Options): Expression { 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"); - - 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 72d65ed0df..72c65f34a6 100755 --- a/src/options.js +++ b/src/options.js @@ -1,21 +1,16 @@ -// @flow - // A second optional argument can be given to further configure // the parser process. These options are recognized: -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 = { +export const defaultOptions: { + sourceType: string, + sourceFilename: any, + startLine: number, + allowReturnOutsideFunction: boolean, + allowImportExportEverywhere: boolean, + allowSuperOutsideMethod: boolean, + plugins: Array, + strictMode: any +} = { // Source type ("script" or "module") for different semantics sourceType: "script", // Source filename. @@ -35,21 +30,12 @@ export const defaultOptions: Options = { 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: ?Options): Options { - const options: any = {}; +export function getOptions(opts?: Object): Object { + const options = {}; 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 deleted file mode 100644 index 3795b71668..0000000000 --- a/src/parser/base.js +++ /dev/null @@ -1,31 +0,0 @@ -// @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 c39f91e44a..c032e85e07 100644 --- a/src/parser/comments.js +++ b/src/parser/comments.js @@ -1,7 +1,5 @@ /* eslint max-len: 0 */ -// @flow - /** * Based on the comment attachment algorithm used in espree and estraverse. * @@ -26,132 +24,133 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import BaseParser from "./base"; -import type { Comment, Node } from "../types"; +import Parser from "./index"; function last(stack) { return stack[stack.length - 1]; } -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); - } +const pp = Parser.prototype; - processComment(node: Node): void { - if (node.type === "Program" && node.body.length > 0) return; +pp.addComment = function (comment) { + if (this.filename) comment.loc.filename = this.filename; + this.state.trailingComments.push(comment); + this.state.leadingComments.push(comment); +}; - const stack = this.state.commentStack; +pp.processComment = function (node) { + if (node.type === "Program" && node.body.length > 0) return; - let lastChild, trailingComments, i, j; + const stack = this.state.commentStack; - 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; - } + 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 = []; } else { - const lastInStack = last(stack); - if (stack.length > 0 && lastInStack.trailingComments && lastInStack.trailingComments[0].start >= node.end) { - trailingComments = lastInStack.trailingComments; - lastInStack.trailingComments = null; - } + // 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; } - - // Eating the stack. - while (stack.length > 0 && last(stack).start >= node.start) { - lastChild = stack.pop(); + } else { + const lastInStack = last(stack); + if (stack.length > 0 && lastInStack.trailingComments && lastInStack.trailingComments[0].start >= node.end) { + trailingComments = lastInStack.trailingComments; + lastInStack.trailingComments = null; } + } - 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; - } + // 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; } } } - } 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; + } + } 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--; } } - - // 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; + } + 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; } } - } - this.state.commentPreviousNode = node; + // 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; + } - if (trailingComments) { - if (trailingComments.length && trailingComments[0].start >= node.start && last(trailingComments).end <= node.end) { - node.innerComments = trailingComments; - } else { - node.trailingComments = trailingComments; + // 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; } } + } - stack.push(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; + } } -} + + stack.push(node); +}; diff --git a/src/parser/expression.js b/src/parser/expression.js index 168e595415..1c075315f2 100644 --- a/src/parser/expression.js +++ b/src/parser/expression.js @@ -19,1104 +19,1368 @@ // [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser import { types as tt } from "../tokenizer/types"; -import LValParser from "./lval"; +import Parser from "./index"; import { reservedWords } from "../util/identifier"; -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. +const pp = Parser.prototype; - checkPropClash(prop, propHash) { - if (prop.computed || prop.kind) return; +// 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. - const key = prop.key; - // It is either an Identifier or a String/NumericLiteral - const name = key.type === "Identifier" ? key.name : String(key.value); +pp.checkPropClash = function (prop, propHash) { + if (prop.computed || prop.kind) return; - if (name === "__proto__") { - if (propHash.proto) this.raise(key.start, "Redefinition of __proto__ property"); - propHash.proto = true; + 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)); } + this.toReferencedList(node.expressions); + return this.finishNode(node, "SequenceExpression"); } + return expr; +}; - // Convenience method to parse an Expression only - getExpression() { - this.nextToken(); - const expr = this.parseExpression(); - if (!this.match(tt.eof)) { - this.unexpected(); - } - 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; } - // ### 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; + let failOnShorthandAssign; + if (refShorthandDefaultPos) { + failOnShorthandAssign = false; + } else { + refShorthandDefaultPos = { start: 0 }; + failOnShorthandAssign = true; } - // Parse an assignment expression. This includes applications of - // operators like `+=`. + if (this.match(tt.parenL) || this.match(tt.name)) { + this.state.potentialArrowAt = this.state.start; + } - parseMaybeAssign(noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; + let leftStartsLine, isNowAssign; + if (this.hasPlugin("lightscript")) { + leftStartsLine = this.seemsLikeStatementStart(); + isNowAssign = this.eat(tt._now); + } - if (this.match(tt._yield) && this.state.inGenerator) { - let left = this.parseYield(); - if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc); - return left; + 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; } - let failOnShorthandAssign; - if (refShorthandDefaultPos) { - failOnShorthandAssign = false; - } else { - refShorthandDefaultPos = { start: 0 }; - failOnShorthandAssign = true; + // if it's not followed by `=` after all, unwind + if (!(this.match(tt.eq) || this.match(tt.awaitArrow))) { + this.state = state; } + } - if (this.match(tt.parenL) || this.match(tt.name)) { - this.state.potentialArrowAt = this.state.start; - } + if (this.state.type.isAssign) { + const node = this.startNodeAt(startPos, startLoc); + node.operator = this.state.value; - let left = this.parseMaybeConditional(noIn, refShorthandDefaultPos, refNeedsArrowPos); - if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc); - if (this.state.type.isAssign) { - const node = this.startNodeAt(startPos, startLoc); - node.operator = this.state.value; - node.left = this.match(tt.eq) ? this.toAssignable(left, undefined, "assignment expression") : left; - refShorthandDefaultPos.start = 0; // reset because shorthand default was used correctly + // `or` -> `||` etc. + if (this.hasPlugin("lightscript")) this.rewriteOperator(node); - this.checkLVal(left, undefined, undefined, "assignment expression"); + const isAwaitArrow = this.hasPlugin("lightscript") && this.match(tt.awaitArrow); + if (isAwaitArrow && this.isLineBreak()) 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}`); - } + node.left = this.match(tt.eq) || isAwaitArrow ? this.toAssignable(left, undefined, "assignment expression") : left; + refShorthandDefaultPos.start = 0; // reset because shorthand default was used correctly + + this.checkLVal(left, undefined, undefined, "assignment expression"); + + if (left.extra && left.extra.parenthesized) { + let errorMsg; + if (left.type === "ObjectPattern") { + errorMsg = "`({a}) = 0` use `({a} = 0)`"; + } else if (left.type === "ArrayPattern") { + errorMsg = "`([a]) = 0` use `([a] = 0)`"; } + if (errorMsg) { + this.raise(left.start, `You're trying to assign to a parenthesized expression, eg. instead of ${errorMsg}`); + } + } + if (typeAnnotation) { + node.left.typeAnnotation = typeAnnotation; + node.left.end = typeAnnotation.end; + node.left.loc.end = typeAnnotation.loc.end; + } + + if (isAwaitArrow) { + node.right = this.parseAwaitArrow(node.left); + } else { this.next(); node.right = this.parseMaybeAssign(noIn); - return this.finishNode(node, "AssignmentExpression"); - } else if (failOnShorthandAssign && refShorthandDefaultPos.start) { - this.unexpected(refShorthandDefaultPos.start); } - return left; + if (this.hasPlugin("lightscript")) { + node.isNowAssign = isNowAssign; + } + + return this.finishNode(node, "AssignmentExpression"); + } else if (failOnShorthandAssign && refShorthandDefaultPos.start) { + this.unexpected(refShorthandDefaultPos.start); } - // Parse a ternary conditional (`?:`) operator. + 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."); + } + } + + return left; +}; + +// Parse a ternary conditional (`?:`) operator. - parseMaybeConditional(noIn, refShorthandDefaultPos, refNeedsArrowPos) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const expr = this.parseExprOps(noIn, refShorthandDefaultPos); - if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr; +pp.parseMaybeConditional = function (noIn, refShorthandDefaultPos, refNeedsArrowPos) { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + const expr = this.parseExprOps(noIn, refShorthandDefaultPos); + if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr; - return this.parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos); + return this.parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos); +}; + +pp.parseConditional = function (expr, noIn, startPos, startLoc) { + if (this.eat(tt.question)) { + const node = this.startNodeAt(startPos, startLoc); + node.test = expr; + node.consequent = this.parseMaybeAssign(); + this.expect(tt.colon); + node.alternate = this.parseMaybeAssign(noIn); + return this.finishNode(node, "ConditionalExpression"); } + return expr; +}; - 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"); - } +// Start the precedence parser. + +pp.parseExprOps = function (noIn, refShorthandDefaultPos) { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + const expr = this.parseMaybeUnary(refShorthandDefaultPos); + if (refShorthandDefaultPos && refShorthandDefaultPos.start) { return expr; + } else { + return this.parseExprOp(expr, startPos, startLoc, -1, noIn); } +}; - // Start the precedence parser. +// 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. - 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); +pp.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) { + // correct ASI failures. + if (this.hasPlugin("lightscript") && this.isLineBreak()) { + + // 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; } } - // Parse binary operators with the operator precedence parsing - // algorithm. `left` is the left-hand side of the operator. - // `minPrec` provides context that allows the function to stop and - // defer further parser to one of its callers when it encounters an - // operator that has a lower precedence than the set it is parsing. - - parseExprOp(left, leftStartPos, leftStartLoc, minPrec, noIn) { - const prec = this.state.type.binop; - if (prec != null && (!noIn || !this.match(tt._in))) { - if (prec > minPrec) { - const node = this.startNodeAt(leftStartPos, leftStartLoc); - node.left = left; - node.operator = this.state.value; - - if ( - node.operator === "**" && - left.type === "UnaryExpression" && - left.extra && - !left.extra.parenthesizedArgument && - !left.extra.parenthesized - ) { - this.raise(left.argument.start, "Illegal expression. Wrap left hand side or entire exponentiation in parentheses."); - } - - const op = this.state.type; - this.next(); + 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; - this.finishNode(node, (op === tt.logicalOR || op === tt.logicalAND) ? "LogicalExpression" : "BinaryExpression"); - return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn); + // `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); } - return left; } + return left; +}; - // Parse unary operators, both prefix and postfix. +// Parse unary operators, both prefix and postfix. - parseMaybeUnary(refShorthandDefaultPos) { - if (this.state.type.prefix) { - const node = this.startNode(); - const update = this.match(tt.incDec); - node.operator = this.state.value; - node.prefix = true; - this.next(); +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."); + } - const argType = this.state.type; - node.argument = this.parseMaybeUnary(); + const node = this.startNode(); + const update = this.match(tt.incDec); + node.operator = this.state.value; - this.addExtra(node, "parenthesizedArgument", argType === tt.parenL && (!node.argument.extra || !node.argument.extra.parenthesized)); + // `not` -> `!` etc. + if (this.hasPlugin("lightscript")) this.rewriteOperator(node); - if (refShorthandDefaultPos && refShorthandDefaultPos.start) { - this.unexpected(refShorthandDefaultPos.start); - } + node.prefix = true; + this.next(); - 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"); - } + const argType = this.state.type; + node.argument = this.parseMaybeUnary(); + + this.addExtra(node, "parenthesizedArgument", argType === tt.parenL && (!node.argument.extra || !node.argument.extra.parenthesized)); - return this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + if (refShorthandDefaultPos && refShorthandDefaultPos.start) { + this.unexpected(refShorthandDefaultPos.start); } - 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"); + 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 expr; + + return this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); } - // Parse call, dot, and `[]`-subscript expressions. + 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; +}; - parseExprSubscripts(refShorthandDefaultPos) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const potentialArrowAt = this.state.potentialArrowAt; - const expr = this.parseExprAtom(refShorthandDefaultPos); +// Parse call, dot, and `[]`-subscript expressions. - if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) { - return expr; - } +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 (refShorthandDefaultPos && refShorthandDefaultPos.start) { - return expr; - } + if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) { + return expr; + } - return this.parseSubscripts(expr, startPos, startLoc); + if (refShorthandDefaultPos && refShorthandDefaultPos.start) { + return expr; } - parseSubscripts(base, startPos, startLoc, noCalls) { - for (;;) { - if (!noCalls && this.eat(tt.doubleColon)) { - const node = this.startNodeAt(startPos, startLoc); - node.object = base; - node.callee = this.parseNoCallExpr(); - return this.parseSubscripts(this.finishNode(node, "BindExpression"), startPos, startLoc, noCalls); - } else if (this.eat(tt.dot)) { - const node = this.startNodeAt(startPos, startLoc); - node.object = base; + 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."); + } + 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."); + } + } + + 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.eat(tt.bracketL)) { - const node = this.startNodeAt(startPos, startLoc); - node.object = base; + } + 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); - base = this.finishNode(node, "MemberExpression"); - } else if (!noCalls && this.match(tt.parenL)) { - const possibleAsync = this.state.potentialArrowAt === base.start && base.type === "Identifier" && base.name === "async" && !this.canInsertSemicolon(); - this.next(); - - const node = this.startNodeAt(startPos, startLoc); - node.callee = base; - node.arguments = this.parseCallExpressionArguments(tt.parenR, possibleAsync); - if (node.callee.type === "Import" && node.arguments.length !== 1) { - this.raise(node.start, "import() requires exactly one argument"); - } - base = this.finishNode(node, "CallExpression"); + } 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(); - if (possibleAsync && this.shouldParseAsyncArrow()) { - return this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node); + 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 { - this.toReferencedList(node.arguments); + return this.parseNamedArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node); } - } else if (this.match(tt.backQuote)) { - const node = this.startNodeAt(startPos, startLoc); - node.tag = base; - node.quasi = this.parseTemplate(true); - base = this.finishNode(node, "TaggedTemplateExpression"); - } else { + } + 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(); + base = this.finishNode(node, "TaggedTemplateExpression"); + } else { + return base; } } - - parseCallExpressionArguments(close, possibleAsyncArrow) { - const elts = []; - let innerParenStart; - let first = true; - - while (!this.eat(close)) { - if (first) { - first = false; +}; + +// 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(); } else { this.expect(tt.comma); - if (this.eat(close)) break; - } - - // we need to make sure that if this is an async arrow functions, that we don't allow inner parens inside the params - if (this.match(tt.parenL) && !innerParenStart) { - innerParenStart = this.state.start; } - - elts.push(this.parseExprListItem(false, possibleAsyncArrow ? { start: 0 } : undefined, possibleAsyncArrow ? { start: 0 } : undefined)); + if (this.eat(close)) break; } - // we found an async arrow function so let's not allow any inner parens - if (possibleAsyncArrow && innerParenStart && this.shouldParseAsyncArrow()) { - this.unexpected(); + // 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; } - return elts; + elts.push(this.parseExprListItem(false, refShorthandDefaultPos, refShorthandDefaultPos)); } - shouldParseAsyncArrow() { - return this.match(tt.arrow); + // we found an async arrow function so let's not allow any inner parens + if (possibleAsyncArrow && innerParenStart && this.shouldParseAsyncArrow()) { + this.unexpected(); } - parseAsyncArrowFromCallExpression(node, call) { - this.expect(tt.arrow); - return this.parseArrowExpression(node, call.arguments, true); + return elts; +}; + +pp.shouldParseAsyncArrow = function () { + if (this.hasPlugin("lightscript") && this.isLineBreak()) { + return false; } + 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"); - // Parse a no-call expression (like argument of `new` or `::` operators). + case tt._import: + if (!this.hasPlugin("dynamicImport")) this.unexpected(); - parseNoCallExpr() { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); - } + node = this.startNode(); + this.next(); + if (!this.match(tt.parenL)) { + this.unexpected(null, tt.parenL); + } + return this.finishNode(node, "Import"); - // 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._this: + node = this.startNode(); + this.next(); + return this.finishNode(node, "ThisExpression"); - parseExprAtom(refShorthandDefaultPos) { - const canBeArrow = this.state.potentialArrowAt === this.state.start; - let node; + case tt._yield: + if (this.state.inGenerator) this.unexpected(); - switch (this.state.type) { - case tt._super: - if (!this.state.inMethod && !this.options.allowSuperOutsideMethod) { - this.raise(this.state.start, "'super' outside of function or class"); - } + case tt.name: + node = this.startNode(); + const allowAwait = this.state.value === "await" && this.state.inAsync; + const allowYield = this.shouldAllowYieldIdentifier(); + const id = this.parseIdentifier(allowAwait || allowYield); - node = this.startNode(); - this.next(); - if (!this.match(tt.parenL) && !this.match(tt.bracketL) && !this.match(tt.dot)) { - this.unexpected(); - } - if (this.match(tt.parenL) && this.state.inMethod !== "constructor" && !this.options.allowSuperOutsideMethod) { - this.raise(node.start, "super() is only valid inside a class constructor. Make sure the method name is spelled exactly as 'constructor'."); + if (id.name === "await") { + if (this.state.inAsync || this.inModule) { + return this.parseAwait(node); } - return this.finishNode(node, "Super"); + } 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._import: - if (!this.hasPlugin("dynamicImport")) this.unexpected(); + if (canBeArrow && !this.canInsertSemicolon() && this.match(tt.arrow)) { + return this.parseArrowExpression(node, [id]); + } - node = this.startNode(); - this.next(); - if (!this.match(tt.parenL)) { - this.unexpected(null, tt.parenL); - } - return this.finishNode(node, "Import"); + return id; - case tt._this: - node = this.startNode(); + case tt._do: + if (this.hasPlugin("doExpressions")) { + const node = this.startNode(); this.next(); - return this.finishNode(node, "ThisExpression"); + const oldInFunction = this.state.inFunction; + const oldLabels = this.state.labels; + this.state.labels = []; + this.state.inFunction = false; + node.body = this.parseBlock(false, true); + this.state.inFunction = oldInFunction; + this.state.labels = oldLabels; + return this.finishNode(node, "DoExpression"); + } - case tt._yield: - if (this.state.inGenerator) this.unexpected(); + case tt.regexp: + const value = this.state.value; + node = this.parseLiteral(value.value, "RegExpLiteral"); + node.pattern = value.pattern; + node.flags = value.flags; + return node; - case tt.name: - node = this.startNode(); - const allowAwait = this.state.value === "await" && this.state.inAsync; - const allowYield = this.shouldAllowYieldIdentifier(); - const id = this.parseIdentifier(allowAwait || allowYield); + case tt.num: + return this.parseLiteral(this.state.value, "NumericLiteral"); - if (id.name === "await") { - if (this.state.inAsync || this.inModule) { - return this.parseAwait(node); - } - } else if (id.name === "async" && this.match(tt._function) && !this.canInsertSemicolon()) { - this.next(); - return this.parseFunction(node, false, false, true); - } else if (canBeArrow && id.name === "async" && this.match(tt.name)) { - const params = [this.parseIdentifier()]; - this.expect(tt.arrow); - // let foo = bar => {}; - return this.parseArrowExpression(node, params, true); - } + case tt.string: + return this.parseLiteral(this.state.value, "StringLiteral"); - if (canBeArrow && !this.canInsertSemicolon() && this.eat(tt.arrow)) { - return this.parseArrowExpression(node, [id]); - } + case tt._null: + node = this.startNode(); + this.next(); + return this.finishNode(node, "NullLiteral"); - 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._true: case tt._false: + node = this.startNode(); + node.value = this.match(tt._true); + this.next(); + return this.finishNode(node, "BooleanLiteral"); - 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.parenL: + return this.parseParenAndDistinguishExpression(null, null, canBeArrow); - case tt.num: - return this.parseLiteral(this.state.value, "NumericLiteral"); + 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.string: - return this.parseLiteral(this.state.value, "StringLiteral"); + case tt.braceL: + return this.parseObj(false, refShorthandDefaultPos); - case tt._null: - node = this.startNode(); - this.next(); - return this.finishNode(node, "NullLiteral"); + case tt._function: + return this.parseFunctionExpression(); - case tt._true: case tt._false: - node = this.startNode(); - node.value = this.match(tt._true); - this.next(); - return this.finishNode(node, "BooleanLiteral"); + case tt.at: + this.parseDecorators(); - case tt.parenL: - return this.parseParenAndDistinguishExpression(null, null, canBeArrow); + case tt._class: + node = this.startNode(); + this.takeDecorators(node); + return this.parseClass(node, false); - case tt.bracketL: - node = this.startNode(); - this.next(); - node.elements = this.parseExprList(tt.bracketR, true, refShorthandDefaultPos); - this.toReferencedList(node.elements); - return this.finishNode(node, "ArrayExpression"); - - case tt.braceL: - return this.parseObj(false, refShorthandDefaultPos); + case tt._new: + return this.parseNew(); - case tt._function: - return this.parseFunctionExpression(); + case tt.backQuote: + return this.parseTemplate(); - case tt.at: - this.parseDecorators(); + 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._class: + case tt._if: + if (this.hasPlugin("lightscript")) { node = this.startNode(); - this.takeDecorators(node); - return this.parseClass(node, false); - - case tt._new: - return this.parseNew(); + return this.parseIfExpression(node); + } - case tt.backQuote: - return this.parseTemplate(false); + case tt.arrow: + if (this.hasPlugin("lightscript")) { + node = this.startNode(); + return this.parseArrowExpression(node, []); + } - case tt.doubleColon: + case tt.awaitArrow: + if (this.hasPlugin("lightscript")) { 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); + 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 { - val = exprList[0]; + exprList.push(this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem, refNeedsArrowPos)); } + } + const innerEndPos = this.state.start; + const innerEndLoc = this.state.startLoc; + this.expect(tt.parenR); - this.addExtra(val, "parenthesized", true); - this.addExtra(val, "parenStart", startPos); + let arrowNode = this.startNodeAt(startPos, startLoc); + if (canBeArrow && this.shouldParseArrow() && (arrowNode = this.parseArrow(arrowNode))) { + for (const param of exprList) { + if (param.extra && param.extra.parenthesized) this.unexpected(param.extra.parenStart); + } - return val; + return this.parseArrowExpression(arrowNode, exprList); } - shouldParseArrow() { - return !this.canInsertSemicolon(); + if (!exprList.length) { + this.unexpected(this.state.lastTokStart); } - - parseArrow(node) { - if (this.eat(tt.arrow)) { - return node; - } + 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]; } - parseParenItem(node) { - return node; - } - // New's precedence is slightly tricky. It must allow its argument - // to be a `[]` or dot subscript expression, but not a call — at - // least, not without wrapping it in parentheses. Thus, it uses the + this.addExtra(val, "parenthesized", true); + this.addExtra(val, "parenStart", startPos); - parseNew() { - const node = this.startNode(); - const meta = this.parseIdentifier(true); + return val; +}; - if (this.eat(tt.dot)) { - const metaProp = this.parseMetaProperty(node, meta, "target"); +pp.shouldParseArrow = function () { + return !this.canInsertSemicolon(); +}; - if (!this.state.inFunction) { - this.raise(metaProp.property.start, "new.target can only be used in functions"); - } +pp.parseArrow = function (node) { + if (this.match(tt.arrow)) { + return node; + } +}; - return metaProp; - } +pp.parseParenItem = function (node) { + return node; +}; - node.callee = this.parseNoCallExpr(); +// 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 - if (this.eat(tt.parenL)) { - node.arguments = this.parseExprList(tt.parenR); - this.toReferencedList(node.arguments); - } else { - node.arguments = []; - } +pp.parseNew = function () { + const node = this.startNode(); + const meta = this.parseIdentifier(true); - return this.finishNode(node, "NewExpression"); + if (this.eat(tt.dot)) { + return this.parseMetaProperty(node, meta, "target"); } - // Parse template expression. + node.callee = this.parseNoCallExpr(); - parseTemplateElement(isTagged) { - const elem = this.startNode(); - if (this.state.value === null) { - if (!isTagged) { - this.raise(this.state.invalidTemplateEscapePosition, "Invalid escape sequence in template"); - } else { - this.state.invalidTemplateEscapePosition = null; - } - } - elem.value = { - raw: this.input.slice(this.state.start, this.state.end).replace(/\r\n?/g, "\n"), - cooked: this.state.value - }; - this.next(); - elem.tail = this.match(tt.backQuote); - return this.finishNode(elem, "TemplateElement"); + // 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 = []; } - 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)); + 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()); + } + 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); } - this.next(); - return this.finishNode(node, "TemplateLiteral"); } - // 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(); + let firstRestLocation = null; - let firstRestLocation = null; - - while (!this.eat(tt.braceR)) { - if (first) { - first = false; + 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; } + if (this.eat(tt.braceR)) break; + } - while (this.match(tt.at)) { - decorators.push(this.parseDecorator()); - } + while (this.match(tt.at)) { + decorators.push(this.parseDecorator()); + } - let prop = this.startNode(), isGenerator = false, isAsync = false, startPos, startLoc; - if (decorators.length) { - prop.decorators = decorators; - decorators = []; - } + let prop = this.startNode(), isGenerator = false, isAsync = false, startPos, startLoc; + if (decorators.length) { + prop.decorators = decorators; + decorators = []; + } - if (this.hasPlugin("objectRestSpread") && this.match(tt.ellipsis)) { - prop = this.parseSpread(isPattern ? { start: 0 } : undefined); - prop.type = isPattern ? "RestElement" : "SpreadElement"; - if (isPattern) this.toAssignable(prop.argument, true, "object pattern"); - node.properties.push(prop); - if (isPattern) { - const position = this.state.start; - if (firstRestLocation !== null) { - this.unexpected(firstRestLocation, "Cannot have multiple rest elements when destructuring"); - } else if (this.eat(tt.braceR)) { - break; - } else if (this.match(tt.comma) && this.lookahead().type === tt.braceR) { - this.unexpected(position, "A trailing comma is not permitted after the rest element"); - } else { - firstRestLocation = position; - continue; - } + 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; } else { + firstRestLocation = position; continue; } + } else { + continue; } + } - prop.method = false; - prop.shorthand = false; + prop.method = false; + prop.shorthand = false; - if (isPattern || refShorthandDefaultPos) { - startPos = this.state.start; - startLoc = this.state.startLoc; - } + if (isPattern || refShorthandDefaultPos) { + startPos = this.state.start; + startLoc = this.state.startLoc; + } - if (!isPattern) { - isGenerator = this.eat(tt.star); - } + if (!isPattern) { + isGenerator = this.eat(tt.star); + } - if (!isPattern && this.isContextual("async")) { - if (isGenerator) this.unexpected(); + if (!isPattern && this.isContextual("async")) { + if (isGenerator) this.unexpected(); - const asyncId = this.parseIdentifier(); - if (this.match(tt.colon) || this.match(tt.parenL) || this.match(tt.braceR) || this.match(tt.eq) || this.match(tt.comma)) { - prop.key = asyncId; - prop.computed = false; - } else { - isAsync = true; - if (this.hasPlugin("asyncGenerators")) isGenerator = this.eat(tt.star); - this.parsePropertyName(prop); - } + 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); } - - this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos); - this.checkPropClash(prop, propHash); - - if (prop.shorthand) { - this.addExtra(prop, "shorthand", true); - } - - node.properties.push(prop); + } else { + this.parsePropertyName(prop); } - if (firstRestLocation !== null) { - this.unexpected(firstRestLocation, "The rest element has to be the last element when destructuring"); - } + this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos); + this.checkPropClash(prop, propHash); - if (decorators.length) { - this.raise(this.state.start, "You have trailing decorators with no property"); + if (prop.shorthand) { + this.addExtra(prop, "shorthand", true); } - return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); + node.properties.push(prop); } - isGetterOrSetterMethod(prop, isPattern) { - return !isPattern && - !prop.computed && - prop.key.type === "Identifier" && - (prop.key.name === "get" || prop.key.name === "set") && - ( - this.match(tt.string) || // get "string"() {} - this.match(tt.num) || // get 1() {} - this.match(tt.bracketL) || // get ["string"]() {} - this.match(tt.name) || // get foo() {} - this.state.type.keyword // get debugger() {} - ); + if (firstRestLocation !== null) { + this.unexpected(firstRestLocation, "The rest element has to be the last element when destructuring"); } - // 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"); - } - } + if (decorators.length) { + this.raise(this.state.start, "You have trailing decorators with no property"); } - 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"); - } - - 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(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"); } } +}; - 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"); - } +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); - if (!prop.computed && prop.key.type === "Identifier") { - this.checkReservedWord(prop.key.name, prop.key.start, true, true); + return this.finishNode(prop, "ObjectMethod"); + } - 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.shorthand = true; + 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, "ObjectProperty"); - } + return this.finishNode(prop, "ObjectMethod"); } +}; - 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(); +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); - return node; + return this.finishNode(prop, "ObjectProperty"); } - parsePropertyName(prop) { - if (this.eat(tt.bracketL)) { - prop.computed = true; - prop.key = this.parseMaybeAssign(); - this.expect(tt.bracketR); + if (!prop.computed && prop.key.type === "Identifier") { + if (isPattern) { + this.checkReservedWord(prop.key.name, prop.key.start, true, true); + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone()); + } else if (this.match(tt.eq) && refShorthandDefaultPos) { + if (!refShorthandDefaultPos.start) { + refShorthandDefaultPos.start = this.state.start; + } + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone()); } 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; + prop.value = prop.key.__clone(); } - return prop.key; - } - - // Initialize empty function node. + prop.shorthand = true; - initFunction(node, isAsync) { - node.id = null; - node.generator = false; - node.expression = false; - node.async = !!isAsync; + return this.finishNode(prop, "ObjectProperty"); + } +}; + +pp.parseObjPropValue = function (prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos) { + const node = + this.parseObjectMethod(prop, isGenerator, isAsync, isPattern) || + this.parseObjectProperty(prop, startPos, startLoc, isPattern, refShorthandDefaultPos); + + if (!node) this.unexpected(); + + return node; +}; + +pp.parsePropertyName = function (prop) { + if (this.eat(tt.bracketL)) { + prop.computed = true; + prop.key = this.parseMaybeAssign(); + this.expect(tt.bracketR); + } else { + prop.computed = false; + const oldInPropertyName = this.state.inPropertyName; + this.state.inPropertyName = true; + prop.key = (this.match(tt.num) || this.match(tt.string)) ? this.parseExprAtom() : this.parseIdentifier(true); + this.state.inPropertyName = oldInPropertyName; + } + 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; } - // Parse object or class method. + if (this.hasPlugin("lightscript") && this.match(tt.arrow)) { + this.parseArrowType(node); - 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 (node.kind === "get" || node.kind === "set") { + this.checkGetterSetterParamCount(node); + } + + this.parseArrowFunctionBody(node); + } else { this.parseFunctionBody(node); - this.state.inMethod = oldInMethod; - return node; } - // Parse arrow function expression with given parameters. + this.state.inMethod = oldInMethod; + return node; +}; + +// Parse arrow function expression with given parameters. + +pp.parseArrowExpression = function (node, params, isAsync) { + this.initFunction(node, isAsync); + node.params = this.toAssignableList(params, true, "arrow function parameters"); - 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"); } - - 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 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; } } + } - return false; + 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; } + this.state.inAsync = oldInAsync; - // Parse function body and check parameters. - parseFunctionBody(node, allowExpression) { - const isExpression = allowExpression && !this.match(tt.braceL); + this.validateFunctionBody(node, allowExpression); +}; - 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; +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; + // 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"); - } + if (isStrict && node.id && node.id.type === "Identifier" && node.id.name === "yield") { + this.raise(node.id.start, "Binding yield 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"); - } - 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"); + if (checkLVal) { + const nameHash = Object.create(null); + const oldStrict = this.state.strict; + if (isStrict) this.state.strict = true; + if (node.id) { + this.checkLVal(node.id, true, undefined, "function name"); + } + for (const param of (node.params: Array)) { + if (isStrict && param.type !== "Identifier") { + this.raise(param.start, "Non-simple parameter in strict mode"); } - this.state.strict = oldStrict; + this.checkLVal(param, true, nameHash, "function parameter list"); } + this.state.strict = oldStrict; } +}; - // Parses a comma-separated list of expressions, and returns them as - // an array. `close` is the token type that ends the list, and - // `allowEmpty` can be turned on to allow subsequent commas with - // nothing in between them to be parsed as `null` (which is needed - // for array literals). +// Parses a comma-separated list of expressions, and returns them as +// an array. `close` is the token type that ends the list, and +// `allowEmpty` can be turned on to allow subsequent commas with +// nothing in between them to be parsed as `null` (which is needed +// for array literals). - parseExprList(close, allowEmpty, refShorthandDefaultPos) { - const elts = []; - let first = true; +pp.parseExprList = function (close, allowEmpty, refShorthandDefaultPos) { + const elts = []; + let first = true; - while (!this.eat(close)) { - if (first) { - first = false; + while (!this.eat(close)) { + if (first) { + first = false; + } else { + if (this.hasPlugin("lightscript")) { + this.expectCommaOrLineBreak(); } else { this.expect(tt.comma); - if (this.eat(close)) break; } - - elts.push(this.parseExprListItem(allowEmpty, refShorthandDefaultPos)); + if (this.eat(close)) break; } - return elts; - } - 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; + elts.push(this.parseExprListItem(allowEmpty, refShorthandDefaultPos)); } + return elts; +}; + +pp.parseExprListItem = function (allowEmpty, refShorthandDefaultPos, refNeedsArrowPos) { + let elt; + if (allowEmpty && this.match(tt.comma)) { + elt = null; + } else if (this.match(tt.ellipsis)) { + elt = this.parseSpread(refShorthandDefaultPos); + } else { + elt = this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem, refNeedsArrowPos); + } + return elt; +}; - // Parse the next token as an identifier. If `liberal` is true (used - // when parsing properties), it will also convert keywords into - // identifiers. - - parseIdentifier(liberal) { - const node = this.startNode(); - if (!liberal) { - this.checkReservedWord(this.state.value, this.state.start, !!this.state.type.keyword, false); - } - - 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"); - } +pp.parseIdentifier = function (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"); } - checkReservedWord(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. +pp.checkReservedWord = function (word, startLoc, checkKeywords, isBinding) { + if (this.isReservedWord(word) || (checkKeywords && this.isKeyword(word))) { + this.raise(startLoc, word + " is a reserved word"); + } - 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"); + if (this.state.strict && (reservedWords.strict(word) || (isBinding && reservedWords.strictBind(word)))) { + this.raise(startLoc, word + " is a reserved word in strict mode"); } +}; - // Parses yield expression inside generator. +// Parses await expression inside async function. - 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"); +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.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"); +}; + +// 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(); } -} + return this.finishNode(node, "YieldExpression"); +}; diff --git a/src/parser/index.js b/src/parser/index.js index 7a66b89a54..c3b6c742ac 100644 --- a/src/parser/index.js +++ b/src/parser/index.js @@ -1,21 +1,31 @@ -// @flow - -import type { Options } from "../options"; -import type { File } from "../types"; +import { reservedWords } from "../util/identifier"; import { getOptions } from "../options"; -import StatementParser from "./statement"; +import Tokenizer from "../tokenizer"; -export const plugins: { [name: string]: (superClass: Class) => Class } = {}; +export const plugins = {}; +const frozenDeprecatedWildcardPluginList = [ + "jsx", + "doExpressions", + "objectRestSpread", + "decorators", + "classProperties", + "exportExtensions", + "asyncGenerators", + "functionBind", + "functionSent", + "dynamicImport", + "flow" +]; -export default class Parser extends StatementParser { - constructor(options: ?Options, input: string) { +export default class Parser extends Tokenizer { + constructor(options: Object, input: string) { options = getOptions(options); super(options, input); this.options = options; this.inModule = this.options.sourceType === "module"; this.input = input; - this.plugins = pluginsMap(this.options.plugins); + this.plugins = this.loadPlugins(this.options.plugins); this.filename = options.sourceFilename; // If enabled, skip leading hashbang line. @@ -24,18 +34,81 @@ export default class Parser extends StatementParser { } } - parse(): File { + 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 + } + } { 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 aed2760d62..2a408a5100 100644 --- a/src/parser/location.js +++ b/src/parser/location.js @@ -1,7 +1,7 @@ -// @flow - import { getLineInfo } from "../util/location"; -import CommentsParser from "./comments"; +import Parser from "./index"; + +const pp = Parser.prototype; // This function is used to raise exceptions on parse errors. It // takes an offset integer (into the current `input`) to indicate @@ -9,14 +9,11 @@ import CommentsParser from "./comments"; // of the error message, and then raises a `SyntaxError` with that // message. -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; - } -} +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; +}; diff --git a/src/parser/lval.js b/src/parser/lval.js index 811c37038a..ba753c9524 100644 --- a/src/parser/lval.js +++ b/src/parser/lval.js @@ -1,283 +1,268 @@ -// @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.toAssignable(prop, isBinding, "object destructuring pattern"); - } - } - break; +import { types as tt } from "../tokenizer/types"; +import Parser from "./index"; - case "ObjectProperty": - this.toAssignable(node.value, isBinding, contextDescription); - break; +const pp = Parser.prototype; - case "SpreadElement": - node.type = "RestElement"; - break; +// Convert existing expression atom to assignable pattern +// if possible. - case "ArrayExpression": - node.type = "ArrayPattern"; - this.toAssignableList(node.elements, isBinding, contextDescription); - break; +pp.toAssignable = function (node, isBinding, contextDescription) { + if (node) { + switch (node.type) { + case "Identifier": + case "ObjectPattern": + case "ArrayPattern": + case "AssignmentPattern": + break; - case "AssignmentExpression": - if (node.operator === "=") { - node.type = "AssignmentPattern"; - delete node.operator; + case "ObjectExpression": + node.type = "ObjectPattern"; + for (const prop of (node.properties: Array)) { + if (prop.type === "ObjectMethod") { + if (prop.kind === "get" || prop.kind === "set") { + this.raise(prop.key.start, "Object pattern can't contain getter or setter"); + } else { + this.raise(prop.key.start, "Object pattern can't contain methods"); + } } else { - this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); + this.toAssignable(prop, isBinding, "object destructuring pattern"); } - 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); } - } - } - return node; - } + break; - // 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; - } - } - 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; - } + case "ObjectProperty": + this.toAssignable(node.value, isBinding, contextDescription); + break; - // Convert list of expression atoms to a list of + case "SpreadProperty": + node.type = "RestProperty"; + break; - toReferencedList(exprList: $ReadOnlyArray): $ReadOnlyArray { - return exprList; - } + case "ArrayExpression": + node.type = "ArrayPattern"; + this.toAssignableList(node.elements, isBinding, contextDescription); + break; - // Parses spread element. + 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; - parseSpread(refShorthandDefaultPos: ?Pos): T { - const node = this.startNode(); - this.next(); - node.argument = this.parseMaybeAssign(false, refShorthandDefaultPos); - return this.finishNode(node, "SpreadElement"); - } + case "MemberExpression": + if (!isBinding) break; - parseRest(): RestElement { - const node = this.startNode(); - this.next(); - node.argument = this.parseBindingAtom(); - return this.finishNode(node, "RestElement"); + default: { + const message = "Invalid left-hand side" + + (contextDescription ? " in " + contextDescription : /* istanbul ignore next */ "expression"); + this.raise(node.start, message); + } + } } - - shouldAllowYieldIdentifier(): boolean { - return this.match(tt._yield) && !this.state.strict && !this.state.inGenerator; + 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); + } + --end; + } } - - parseBindingIdentifier(): Identifier { - return this.parseIdentifier(this.shouldAllowYieldIdentifier()); + for (let i = 0; i < end; i++) { + const elt = exprList[i]; + if (elt) this.toAssignable(elt, isBinding, contextDescription); } - - // 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(); - } + 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(); } - - parseBindingList(close: TokenType, allowEmpty?: boolean): $ReadOnlyArray { - const elts = []; - let first = true; - while (!this.eat(close)) { - if (first) { - first = false; +}; + +pp.parseBindingList = function (close, allowEmpty) { + const elts = []; + let first = true; + while (!this.eat(close)) { + if (first) { + first = false; + } else { + if (this.hasPlugin("lightscript")) { + this.expectCommaOrLineBreak(); } else { this.expect(tt.comma); } - if (allowEmpty && this.match(tt.comma)) { - // $FlowFixMe This method returns `$ReadOnlyArray` if `allowEmpty` is set. - elts.push(null); - } else if (this.eat(close)) { - break; - } 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)); + } + if (allowEmpty && this.match(tt.comma)) { + elts.push(null); + } else if (this.eat(close)) { + break; + } else if (this.match(tt.ellipsis)) { + elts.push(this.parseAssignableListItemTypes(this.parseRest())); + this.expect(close); + break; + } else { + const decorators = []; + while (this.match(tt.at)) { + decorators.push(this.parseDecorator()); + } + const left = this.parseMaybeDefault(); + if (decorators.length) { + left.decorators = decorators; } + this.parseAssignableListItemTypes(left); + elts.push(this.parseMaybeDefault(left.start, left.loc.start, left)); } - return elts; } - - parseAssignableListItemTypes(param: Pattern): Pattern { - return param; - } - - // Parses assignment pattern around given atom if possible. - - 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; - } + 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; + } + break; - case "MemberExpression": - if (isBinding) - this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression"); - break; + case "MemberExpression": + if (isBinding) this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression"); + break; - case "ObjectPattern": - for (let prop of expr.properties) { - if (prop.type === "ObjectProperty") prop = prop.value; - this.checkLVal(prop, isBinding, checkClashes, "object destructuring pattern"); - } - break; + case "ObjectPattern": + for (let prop of (expr.properties: Array)) { + if (prop.type === "ObjectProperty") prop = prop.value; + this.checkLVal(prop, isBinding, checkClashes, "object destructuring pattern"); + } + break; - case "ArrayPattern": - for (const elem of expr.elements) { - if (elem) this.checkLVal(elem, isBinding, checkClashes, "array destructuring pattern"); - } - break; + case "ArrayPattern": + for (const elem of (expr.elements: Array)) { + if (elem) this.checkLVal(elem, isBinding, checkClashes, "array destructuring pattern"); + } + break; - case "AssignmentPattern": - this.checkLVal(expr.left, isBinding, checkClashes, "assignment pattern"); - break; + case "AssignmentPattern": + this.checkLVal(expr.left, isBinding, checkClashes, "assignment pattern"); + break; - case "RestElement": - this.checkLVal(expr.argument, isBinding, checkClashes, "rest element"); - break; + case "RestProperty": + this.checkLVal(expr.argument, isBinding, checkClashes, "rest property"); + 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 "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 cc8f514366..86f697c130 100644 --- a/src/parser/node.js +++ b/src/parser/node.js @@ -1,41 +1,30 @@ -// @flow - import Parser from "./index"; -import UtilParser from "./util"; -import { SourceLocation, type Position } from "../util/location"; -import type { Comment, Node as NodeType, NodeBase } from "../types"; +import { SourceLocation } from "../util/location"; // Start an AST node, attaching a start offset. +const pp = Parser.prototype; const commentKeys = ["leadingComments", "trailingComments", "innerComments"]; -class Node implements NodeBase { - constructor(parser: Parser, pos: number, loc: Position) { +class Node { + constructor(pos?: number, loc?: number, filename?: string) { this.type = ""; this.start = pos; this.end = 0; this.loc = new SourceLocation(loc); - if (parser && parser.options.ranges) this.range = [pos, 0]; - if (parser && parser.filename) this.loc.filename = parser.filename; + if (filename) this.loc.filename = 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(): this { - // $FlowIgnore - const node2: any = new Node; + __clone(): Node { + const node2 = 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]; } } @@ -44,40 +33,30 @@ class Node implements NodeBase { } } -export class NodeUtils extends UtilParser { - startNode(): T { - // $FlowIgnore - return new Node(this, this.state.start, this.state.startLoc); - } +pp.startNode = function () { + return new Node(this.state.start, this.state.startLoc, this.filename); +}; - startNodeAt(pos: number, loc: Position): T { - // $FlowIgnore - return new Node(this, pos, loc); - } +pp.startNodeAt = function (pos, loc) { + return new Node(pos, loc, this.filename); +}; - // Finish an AST node, adding `type` and `end` properties. +function finishNodeAt(node, type, pos, loc) { + node.type = type; + node.end = pos; + node.loc.end = loc; + this.processComment(node); + return node; +} - finishNode(node: T, type: string): T { - return this.finishNodeAt(node, type, this.state.lastTokEnd, this.state.lastTokEndLoc); - } +// Finish an AST node, adding `type` and `end` properties. - // Finish node at given position +pp.finishNode = function (node, type) { + return finishNodeAt.call(this, node, type, this.state.lastTokEnd, this.state.lastTokEndLoc); +}; - 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; - } +// Finish node at given position - /** - * 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]; - } -} +pp.finishNodeAt = function (node, type, pos, loc) { + return finishNodeAt.call(this, node, type, pos, loc); +}; diff --git a/src/parser/statement.js b/src/parser/statement.js index 376c685147..bd795c95a8 100644 --- a/src/parser/statement.js +++ b/src/parser/statement.js @@ -1,277 +1,309 @@ /* eslint max-len: 0 */ import { types as tt } from "../tokenizer/types"; -import ExpressionParser from "./expression"; +import Parser from "./index"; import { lineBreak } from "../util/whitespace"; -// Reused empty array added for node fields that are always empty. +const pp = Parser.prototype; -const empty = []; +// ### Statement parsing -const loopLabel = { kind: "loop" }, switchLabel = { kind: "switch" }; +// 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. -export default class StatementParser extends ExpressionParser { +pp.parseTopLevel = function (file, program) { + program.sourceType = this.options.sourceType; - // ### Statement parsing + this.parseBlockBody(program, true, true, tt.eof); - // 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. + file.program = this.finishNode(program, "Program"); + file.comments = this.state.comments; + file.tokens = this.state.tokens; - parseTopLevel(file, program) { - program.sourceType = this.options.sourceType; + return this.finishNode(file, "File"); +}; - this.parseBlockBody(program, true, true, tt.eof); +const loopLabel = { kind: "loop" }, switchLabel = { kind: "switch" }; - file.program = this.finishNode(program, "Program"); - file.comments = this.state.comments; - file.tokens = this.state.tokens; +// TODO - return this.finishNode(file, "File"); - } +pp.stmtToDirective = function (stmt) { + const expr = stmt.expression; - // TODO + const directiveLiteral = this.startNodeAt(expr.start, expr.loc.start); + const directive = this.startNodeAt(stmt.start, stmt.loc.start); - stmtToDirective(stmt) { - const expr = stmt.expression; + const raw = this.input.slice(expr.start, expr.end); + const val = directiveLiteral.value = raw.slice(1, -1); // remove quotes - const directiveLiteral = this.startNodeAt(expr.start, expr.loc.start); - const directive = this.startNodeAt(stmt.start, stmt.loc.start); + this.addExtra(directiveLiteral, "raw", raw); + this.addExtra(directiveLiteral, "rawValue", val); - const raw = this.input.slice(expr.start, expr.end); - const val = directiveLiteral.value = raw.slice(1, -1); // remove quotes + directive.value = this.finishNodeAt(directiveLiteral, "DirectiveLiteral", expr.end, expr.loc.end); - this.addExtra(directiveLiteral, "raw", raw); - this.addExtra(directiveLiteral, "rawValue", val); + return this.finishNodeAt(directive, "Directive", stmt.end, stmt.loc.end); +}; - directive.value = this.finishNodeAt(directiveLiteral, "DirectiveLiteral", expr.end, expr.loc.end); +// 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. - return this.finishNodeAt(directive, "Directive", stmt.end, stmt.loc.end); +pp.parseStatement = function (declaration, topLevel) { + if (this.match(tt.at)) { + this.parseDecorators(true); } - // 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. - - parseStatement(declaration, topLevel) { - if (this.match(tt.at)) { - this.parseDecorators(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: 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; - } + 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"); } - } - // If the statement does not start with a statement keyword or a - // brace, it's an ExpressionStatement or LabeledStatement. We - // simply start parsing an expression, and afterwards, if the - // next token is a colon and the expression was a simple - // Identifier node, we switch to interpreting it as a label. - const maybeName = this.state.value; - const expr = this.parseExpression(); + if (!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); - if (starttype === tt.name && expr.type === "Identifier" && this.eat(tt.colon)) { - return this.parseLabeledStatement(node, maybeName, expr); - } else { - return this.parseExpressionStatement(node, expr); - } + 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; + } + } } - takeDecorators(node) { - if (this.state.decorators.length) { - node.decorators = this.state.decorators; - this.state.decorators = []; - } + // 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"); } - parseDecorators(allowExport) { - while (this.match(tt.at)) { - const decorator = this.parseDecorator(); - this.state.decorators.push(decorator); - } - - if (allowExport && this.match(tt._export)) { - return; - } + // rewrite standalone NamedArrowExpression as NamedArrowDeclaration + if (this.hasPlugin("lightscript") && expr.type === "NamedArrowExpression") { + return this.finishNode(expr, "NamedArrowDeclaration"); + } - if (!this.match(tt._class)) { - this.raise(this.state.start, "Leading decorators must be attached to a class declaration"); - } + if (starttype === tt.name && expr.type === "Identifier" && this.eat(tt.colon)) { + return this.parseLabeledStatement(node, maybeName, expr); + } else { + return this.parseExpressionStatement(node, expr); } +}; - parseDecorator() { - if (!this.hasPlugin("decorators")) { - this.unexpected(); - } - const node = this.startNode(); - this.next(); - node.expression = this.parseMaybeAssign(); - return this.finishNode(node, "Decorator"); +pp.takeDecorators = function (node) { + if (this.state.decorators.length) { + node.decorators = this.state.decorators; + this.state.decorators = []; } +}; - parseBreakContinueStatement(node, keyword) { - const isBreak = keyword === "break"; - this.next(); +pp.parseDecorators = function (allowExport) { + while (this.match(tt.at)) { + const decorator = this.parseDecorator(); + this.state.decorators.push(decorator); + } - if (this.isLineTerminator()) { - node.label = null; - } else if (!this.match(tt.name)) { - this.unexpected(); - } else { - node.label = this.parseIdentifier(); - this.semicolon(); - } + if (allowExport && this.match(tt._export)) { + return; + } - // 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"); + if (!this.match(tt._class)) { + this.raise(this.state.start, "Leading decorators must be attached to a class declaration"); } +}; - parseDebuggerStatement(node) { - this.next(); +pp.parseDecorator = function () { + if (!this.hasPlugin("decorators")) { + this.unexpected(); + } + const node = this.startNode(); + this.next(); + node.expression = this.parseMaybeAssign(); + return this.finishNode(node, "Decorator"); +}; + +pp.parseBreakContinueStatement = function (node, keyword) { + const isBreak = keyword === "break"; + this.next(); + + if (this.isLineTerminator()) { + node.label = null; + } else if (!this.match(tt.name)) { + this.unexpected(); + } else { + node.label = this.parseIdentifier(); this.semicolon(); - return this.finishNode(node, "DebuggerStatement"); } - parseDoStatement(node) { - this.next(); - this.state.labels.push(loopLabel); - node.body = this.parseStatement(false); - this.state.labels.pop(); - this.expect(tt._while); + // 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"); +}; + +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); + } + this.semicolon(); + } else { node.test = this.parseParenExpression(); this.eat(tt.semi); - return this.finishNode(node, "DoWhileStatement"); } - // Disambiguating between a `for` and a `for`/`in` or `for`/`of` - // loop is non-trivial. Basically, we have to parse the init `var` - // statement or expression, disallowing the `in` operator (see - // the second parameter to `parseExpression`), and then check - // whether the next token is `in` or `of`. When there is no init - // part (semicolon immediately after the opening parenthesis), it - // is a regular `for` loop. + return this.finishNode(node, "DoWhileStatement"); +}; + +// Disambiguating between a `for` and a `for`/`in` or `for`/`of` +// loop is non-trivial. Basically, we have to parse the init `var` +// statement or expression, disallowing the `in` operator (see +// the second parameter to `parseExpression`), and then check +// whether the next token is `in` or `of`. When there is no init +// part (semicolon immediately after the opening parenthesis), it +// is a regular `for` loop. + +pp.parseForStatement = function (node) { + this.next(); + this.state.labels.push(loopLabel); - parseForStatement(node) { + let forAwait = false; + if (this.hasPlugin("asyncGenerators") && this.state.inAsync && this.isContextual("await")) { + forAwait = true; this.next(); - this.state.labels.push(loopLabel); + } - let forAwait = false; - if (this.hasPlugin("asyncGenerators") && this.state.inAsync && this.isContextual("await")) { - forAwait = true; - this.next(); + if (this.hasPlugin("lightscript")) { + if (this.eat(tt.parenL)) { + this.addExtra(node, "hasParens", true); } + } else { this.expect(tt.parenL); + } - if (this.match(tt.semi)) { - if (forAwait) { - this.unexpected(); - } - return this.parseFor(node, null); + 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.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"); - const refShorthandDefaultPos = { start: 0 }; - const init = this.parseExpression(true, refShorthandDefaultPos); if (this.match(tt._in) || this.isContextual("of")) { - const description = this.isContextual("of") ? "for-of statement" : "for-in statement"; - this.toAssignable(init, undefined, description); - this.checkLVal(init, undefined, undefined, description); - return this.parseForIn(node, init, forAwait); - } else if (refShorthandDefaultPos.start) { - this.unexpected(refShorthandDefaultPos.start); + if (init.declarations.length === 1 && !init.declarations[0].init) { + return this.parseForIn(node, init, forAwait); + } } if (forAwait) { this.unexpected(); @@ -279,828 +311,935 @@ export default class StatementParser extends ExpressionParser { return this.parseFor(node, init); } - parseFunctionStatement(node) { - this.next(); - return this.parseFunction(node, true); + 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); + } } - 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"); + 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); } - parseReturnStatement(node) { - if (!this.state.inFunction && !this.options.allowReturnOutsideFunction) { - this.raise(this.state.start, "'return' outside of function"); - } + if (forAwait) { + this.unexpected(); + } - this.next(); + return this.parseFor(node, init); +}; - // In `return` (and `break`/`continue`), the keywords with - // optional arguments, we eagerly look for a semicolon or the - // possibility to insert one. +pp.parseFunctionStatement = function (node) { + this.next(); + return this.parseFunction(node, true); +}; - if (this.isLineTerminator()) { - node.argument = null; - } else { - node.argument = this.parseExpression(); - this.semicolon(); - } +// overridden in LightScript - return this.finishNode(node, "ReturnStatement"); - } +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"); +}; - 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"); +pp.parseReturnStatement = function (node) { + if (!this.state.inFunction && !this.options.allowReturnOutsideFunction) { + this.raise(this.state.start, "'return' outside of function"); } - 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"); + this.next(); + + // In `return` (and `break`/`continue`), the keywords with + // optional arguments, we eagerly look for a semicolon or the + // possibility to insert one. + + if (this.isLineTerminator()) { + node.argument = null; + } else { node.argument = this.parseExpression(); this.semicolon(); - return this.finishNode(node, "ThrowStatement"); } - parseTryStatement(node) { - this.next(); - - node.block = this.parseBlock(); - node.handler = null; - - if (this.match(tt._catch)) { - const clause = this.startNode(); + return this.finishNode(node, "ReturnStatement"); +}; + +pp.parseSwitchStatement = function (node) { + this.next(); + node.discriminant = this.parseParenExpression(); + node.cases = []; + this.expect(tt.braceL); + this.state.labels.push(switchLabel); + + // Statements under must be grouped (by label) in SwitchCase + // nodes. `cur` is used to keep the node that we are currently + // adding statements to. + + let cur; + for (let sawDefault; !this.match(tt.braceR); ) { + if (this.match(tt._case) || this.match(tt._default)) { + const isCase = this.match(tt._case); + if (cur) this.finishNode(cur, "SwitchCase"); + node.cases.push(cur = this.startNode()); + cur.consequent = []; this.next(); - - this.expect(tt.parenL); - clause.param = this.parseBindingAtom(); - this.checkLVal(clause.param, true, Object.create(null), "catch clause"); - this.expect(tt.parenR); - - clause.body = this.parseBlock(); - node.handler = this.finishNode(clause, "CatchClause"); + 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"); +}; + +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"); +}; - node.guardedHandlers = empty; - node.finalizer = this.eat(tt._finally) ? this.parseBlock() : null; +// Reused empty array added for node fields that are always empty. - if (!node.handler && !node.finalizer) { - this.raise(node.start, "Missing catch or finally clause"); - } +const empty = []; - return this.finishNode(node, "TryStatement"); - } +pp.parseTryStatement = function (node) { + this.next(); - parseVarStatement(node, kind) { - this.next(); - this.parseVar(node, false, kind); - this.semicolon(); - return this.finishNode(node, "VariableDeclaration"); + let indentLevel, isColon; + if (this.hasPlugin("lightscript")) { + indentLevel = this.state.indentLevel; + isColon = this.match(tt.colon); + if (isColon) this.pushBlockState("try", indentLevel); } - 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.block = this.parseBlock(); + node.handler = 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"); - } + const shouldParseCatch = this.match(tt._catch) && ( + !this.hasPlugin("lightscript") || + indentLevel === this.state.indentLevel || + (!isColon && !this.matchBlockState("try", this.state.indentLevel)) + ); - parseEmptyStatement(node) { + if (shouldParseCatch) { + const clause = this.startNode(); this.next(); - return this.finishNode(node, "EmptyStatement"); - } - 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`); + if (this.hasPlugin("lightscript")) { + if (this.eat(tt.parenL)) { + this.addExtra(clause, "hasParens", true); } + } else { + this.expect(tt.parenL); } - - 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; + clause.param = this.parseBindingAtom(); + this.checkLVal(clause.param, true, Object.create(null), "catch clause"); + if (this.hasPlugin("lightscript")) { + this.expectParenFreeBlockStart(clause); + if (isColon) { + this.check(tt.colon); } else { - break; + this.check(tt.braceL); } + } else { + this.expect(tt.parenR); } - - 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"); + clause.body = this.parseBlock(); + node.handler = this.finishNode(clause, "CatchClause"); } - parseExpressionStatement(node, expr) { - node.expression = expr; - this.semicolon(); - return this.finishNode(node, "ExpressionStatement"); - } + node.guardedHandlers = empty; - // 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"); + if (this.hasPlugin("lightscript")) { + const shouldParseFinally = this.match(tt._finally) && ( + indentLevel === this.state.indentLevel || + (!isColon && !this.matchBlockState("try", this.state.indentLevel)) + ); + if (shouldParseFinally) { + this.next(); + if (isColon) { + this.check(tt.colon); + } else { + this.check(tt.braceL); + } + node.finalizer = this.parseBlock(); + } else { + node.finalizer = null; + } + } else { + node.finalizer = this.eat(tt._finally) ? this.parseBlock() : null; } - isValidDirective(stmt) { - return stmt.type === "ExpressionStatement" && - stmt.expression.type === "StringLiteral" && - !stmt.expression.extra.parenthesized; + if (!node.handler && !node.finalizer) { + this.raise(node.start, "Missing catch or finally clause"); } - parseBlockBody(node, allowDirectives, topLevel, end) { - node.body = []; - node.directives = []; + if (this.hasPlugin("lightscript") && isColon) this.popBlockState(); + + 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`); + } + } - let parsedNonDirective = false; - let oldStrict; - let octalPosition; + 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; + } + } - while (!this.eat(end)) { - if (!parsedNonDirective && this.state.containsOctal && !octalPosition) { - octalPosition = this.state.octalPosition; - } + 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(); + } + 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); + } - const stmt = this.parseStatement(true, topLevel); + while (!isEnd()) { + if (!parsedNonDirective && this.state.containsOctal && !octalPosition) { + octalPosition = this.state.octalPosition; + } - if (allowDirectives && !parsedNonDirective && this.isValidDirective(stmt)) { - const directive = this.stmtToDirective(stmt); - node.directives.push(directive); + const stmt = this.parseStatement(true, topLevel); - if (oldStrict === undefined && directive.value.value === "use strict") { - oldStrict = this.state.strict; - this.setStrict(true); + if (allowDirectives && !parsedNonDirective && this.isValidDirective(stmt)) { + const directive = this.stmtToDirective(stmt); + node.directives.push(directive); - if (octalPosition) { - this.raise(octalPosition, "Octal literal in strict mode"); - } - } + if (oldStrict === undefined && directive.value.value === "use strict") { + oldStrict = this.state.strict; + this.setStrict(true); - continue; + if (octalPosition) { + this.raise(octalPosition, "Octal literal in strict mode"); + } } - parsedNonDirective = true; - node.body.push(stmt); + continue; } - if (oldStrict === false) { - this.setStrict(false); - } + parsedNonDirective = true; + node.body.push(stmt); + } + + if (oldStrict === false) { + this.setStrict(false); + } +}; + +// Parse a regular `for` loop. The disambiguation code in +// `parseStatement` will already have parsed the init statement or +// expression. + +pp.parseFor = function (node, init) { + node.init = init; + this.expect(tt.semi); + node.test = this.match(tt.semi) ? null : this.parseExpression(); + this.expect(tt.semi); + node.update = this.match(tt.parenR) ? null : this.parseExpression(); + + 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, "ForStatement"); } - // Parse a `for`/`in` and `for`/`of` loop, which are almost - // same from parser's perspective. + 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"); + } else { + decl.init = null; + } + 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"); +}; - parseForIn(node, init, forAwait) { - const type = this.match(tt._in) ? "ForInStatement" : "ForOfStatement"; - if (forAwait) { - this.eatContextual("of"); +// 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; + + this.initFunction(node, isAsync); + + if (this.match(tt.star)) { + if (node.async && !this.hasPlugin("asyncGenerators")) { + this.unexpected(); } else { + node.generator = true; this.next(); } - node.await = !!forAwait; - node.left = init; - node.right = this.parseExpression(); - this.expect(tt.parenR); - node.body = this.parseStatement(false); - this.state.labels.pop(); - return this.finishNode(node, type); } - // Parse a list of variable declarations. - - parseVar(node, isFor, kind) { - node.declarations = []; - node.kind = kind.keyword; - for (;;) { - const decl = this.startNode(); - this.parseVarHead(decl); - if (this.eat(tt.eq)) { - decl.init = this.parseMaybeAssign(isFor); - } else if (kind === tt._const && !(this.match(tt._in) || this.isContextual("of"))) { - this.unexpected(); - } else if (decl.id.type !== "Identifier" && !(isFor && (this.match(tt._in) || this.isContextual("of")))) { - this.raise(this.state.lastTokEnd, "Complex binding patterns require an initialization value"); - } else { - decl.init = null; - } - node.declarations.push(this.finishNode(decl, "VariableDeclarator")); - if (!this.eat(tt.comma)) break; - } - return node; + if (isStatement && !optionalId && !this.match(tt.name) && !this.match(tt._yield)) { + this.unexpected(); } - parseVarHead(decl) { - decl.id = this.parseBindingAtom(); - this.checkLVal(decl.id, true, undefined, "variable declaration"); + if (this.match(tt.name) || this.match(tt._yield)) { + node.id = this.parseBindingIdentifier(); } - // Parse a function declaration or literal (depending on the - // `isStatement` parameter). + this.parseFunctionParams(node); + this.parseFunctionBody(node, allowExpressionBody); - parseFunction(node, isStatement, allowExpressionBody, isAsync, optionalId) { - const oldInMethod = this.state.inMethod; - this.state.inMethod = false; + this.state.inMethod = oldInMethod; - this.initFunction(node, isAsync); + return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); +}; - if (this.match(tt.star)) { - if (node.async && !this.hasPlugin("asyncGenerators")) { - this.unexpected(); - } else { - node.generator = true; - this.next(); - } - } +pp.parseFunctionParams = function (node) { + this.expect(tt.parenL); + node.params = this.parseBindingList(tt.parenR); +}; - if (isStatement && !optionalId && !this.match(tt.name) && !this.match(tt._yield)) { - this.unexpected(); - } +// Parse a class declaration or literal (depending on the +// `isStatement` parameter). - if (this.match(tt.name) || this.match(tt._yield)) { - node.id = this.parseBindingIdentifier(); - } +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"); +}; - this.parseFunctionParams(node); - this.parseFunctionBody(node, allowExpressionBody); +pp.isClassProperty = function () { + return this.match(tt.eq) || this.isLineTerminator(); +}; - this.state.inMethod = oldInMethod; +pp.isClassMutatorStarter = function () { + return false; +}; - return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); - } +pp.parseClassBody = function (node) { + // class bodies are implicitly strict + const oldStrict = this.state.strict; + this.state.strict = true; - parseFunctionParams(node) { - this.expect(tt.parenL); - node.params = this.parseBindingList(tt.parenR); - } + let hadConstructorCall = false; + let hadConstructor = false; + let decorators = []; + const classBody = this.startNode(); - // Parse a class declaration or literal (depending on the - // `isStatement` parameter). + classBody.body = []; - parseClass(node, isStatement, optionalId) { + let isEnd; + if (this.hasPlugin("lightscript") && this.match(tt.colon)) { + const indentLevel = this.state.indentLevel; this.next(); - this.takeDecorators(node); - this.parseClassId(node, isStatement, optionalId); - this.parseClassSuper(node); - this.parseClassBody(node); - return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); + isEnd = () => this.state.indentLevel <= indentLevel || this.match(tt.eof); + } else { + this.expect(tt.braceL); + isEnd = () => this.eat(tt.braceR); } - isClassProperty() { - return this.match(tt.eq) || this.match(tt.semi) || this.match(tt.braceR); - } + 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; + } - isClassMethod() { - return this.match(tt.parenL); - } + if (this.match(tt.at)) { + decorators.push(this.parseDecorator()); + continue; + } - isNonstaticConstructor(method) { - return !method.computed && !method.static && ( - (method.key.name === "constructor") || // Identifier - (method.key.value === "constructor") // Literal - ); - } + const method = this.startNode(); - parseClassBody(node) { - // class bodies are implicitly strict - const oldStrict = this.state.strict; - this.state.strict = true; + // steal the decorators if there are any + if (decorators.length) { + method.decorators = decorators; + decorators = []; + } - let hadConstructor = false; - let decorators = []; - const classBody = this.startNode(); + 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; - classBody.body = []; + this.parsePropertyName(method); - this.expect(tt.braceL); + method.static = isMaybeStatic && !this.match(tt.parenL); + if (method.static) { + isGenerator = this.eat(tt.star); + this.parsePropertyName(method); + } - while (!this.eat(tt.braceR)) { - if (this.eat(tt.semi)) { - if (decorators.length > 0) { - this.raise(this.state.lastTokEnd, "Decorators must not be followed by a semicolon"); - } + if (!isGenerator) { + if (this.isClassProperty()) { + classBody.body.push(this.parseClassProperty(method)); continue; } - if (this.match(tt.at)) { - decorators.push(this.parseDecorator()); - continue; + if (method.key.type === "Identifier" && !method.computed && this.hasPlugin("classConstructorCall") && method.key.name === "call" && this.match(tt.name) && this.state.value === "constructor") { + isConstructorCall = true; + this.parsePropertyName(method); } + } - const method = this.startNode(); + 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); + } - // steal the decorators if there are any - if (decorators.length) { - method.decorators = decorators; - decorators = []; - } + method.kind = "method"; - 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; + if (!method.computed) { + let { key } = method; + + // handle get/set methods + // eg. class Foo { get bar() {} set bar() {} } + if (!isAsync && !isGenerator && !this.isClassMutatorStarter() && key.type === "Identifier" && !this.match(tt.parenL) && (key.name === "get" || key.name === "set")) { + isGetSet = true; + method.kind = key.name; + key = this.parsePropertyName(method); } - if (this.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(); - } + // disallow invalid constructors + const isConstructor = !isConstructorCall && !method.static && ( + (key.name === "constructor") || // Identifier + (key.value === "constructor") // Literal + ); + if (isConstructor) { + if (hadConstructor) this.raise(key.start, "Duplicate constructor in the same class"); + if (isGetSet) this.raise(key.start, "Constructor can't have get/set modifier"); + if (isGenerator) this.raise(key.start, "Constructor can't be a generator"); + if (isAsync) this.raise(key.start, "Constructor can't be an async function"); + method.kind = "constructor"; + hadConstructor = true; } - } - if (decorators.length) { - this.raise(this.state.start, "You have trailing decorators with no method"); + // 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"); + } } - 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); + // 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 (this.match(tt.eq)) { - if (!this.hasPlugin("classProperties")) this.raise(this.state.start, noPluginMsg); - this.next(); - node.value = this.parseMaybeAssign(); - } else { - node.value = null; + // disallow decorators on class constructors + if ((method.kind === "constructor" || method.kind === "constructorCall") && method.decorators) { + this.raise(method.start, "You can't attach decorators to a class constructor"); } - this.semicolon(); - return this.finishNode(node, "ClassProperty"); - } - parseClassMethod(classBody, method, isGenerator, isAsync) { - this.parseMethod(method, isGenerator, isAsync); - classBody.body.push(this.finishNode(method, "ClassMethod")); - } + this.parseClassMethod(classBody, method, isGenerator, isAsync); - parseClassId(node, isStatement, optionalId) { - if (this.match(tt.name)) { - node.id = this.parseIdentifier(); - } else { - if (optionalId || !isStatement) { - node.id = null; - } else { - this.unexpected(); - } + if (isGetSet) { + this.checkGetterSetterParamCount(method); } } - parseClassSuper(node) { - node.superClass = this.eat(tt._extends) ? this.parseExprSubscripts() : null; + if (decorators.length) { + this.raise(this.state.start, "You have trailing decorators with no method"); } - // Parses module export declaration. + node.body = this.finishNode(classBody, "ClassBody"); - parseExport(node) { - this.eat(tt._export); + this.state.strict = oldStrict; +}; - // 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); +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(null, "A class name is required"); } - this.checkExport(node, true); - return this.finishNode(node, "ExportNamedDeclaration"); } +}; - parseExportDeclaration() { - return this.parseStatement(true); - } +pp.parseClassSuper = function (node) { + node.superClass = this.eat(tt._extends) ? this.parseExprSubscripts() : null; +}; - isExportDefaultSpecifier() { - if (this.match(tt.name)) { - return this.state.value !== "type" - && this.state.value !== "async" - && this.state.value !== "interface"; - } +// Parses module export declaration. - if (!this.match(tt._default)) { - return false; +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"); } - - 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()); + } 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); } - } - - parseExportFrom(node, expect?) { - if (this.eatContextual("from")) { - node.source = this.match(tt.string) ? this.parseExprAtom() : this.unexpected(); - this.checkExport(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.match(tt._class)) { + expr = this.parseClass(expr, true, true); } else { - if (expect) { - this.unexpected(); - } else { - node.source = null; - } + needsSemi = true; + expr = this.parseMaybeAssign(); } - - this.semicolon(); + 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"; } - 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"); + if (!this.match(tt._default)) { + return false; } - 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); - } - } - } - } + const lookahead = this.lookahead(); + return lookahead.type === tt.comma || (lookahead.type === tt.name && lookahead.value === "from"); +}; - 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); +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; } } - checkDeclaration(node) { - if (node.type === "ObjectPattern") { - for (const prop of node.properties) { - this.checkDeclaration(prop); + 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); } - } else if (node.type === "ArrayPattern") { - for (const elem of node.elements) { - if (elem) { - this.checkDeclaration(elem); + } 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 === "ObjectProperty") { - this.checkDeclaration(node.value); - } else if (node.type === "RestElement") { - this.checkDeclaration(node.argument); - } else if (node.type === "Identifier") { - this.checkDuplicateExports(node, node.name); } } - checkDuplicateExports(node, name) { - if (this.state.exportedIdentifiers.indexOf(name) > -1) { - this.raiseDuplicateExportError(node, name); + 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.state.exportedIdentifiers.push(name); + this.takeDecorators(node.declaration); } +}; - 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.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); } +}; - // Parses a comma-separated list of module exports. +pp.checkDuplicateExports = function(node, name) { + if (this.state.exportedIdentifiers.indexOf(name) > -1) { + this.raiseDuplicateExportError(node, name); + } + this.state.exportedIdentifiers.push(name); +}; - parseExportSpecifiers() { - const nodes = []; - let first = true; - let needsFrom; +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.` + ); +}; - // export { x, y as z } [from '...'] - this.expect(tt.braceL); +// Parses a comma-separated list of module exports. - while (!this.eat(tt.braceR)) { - if (first) { - first = false; - } else { - this.expect(tt.comma); - if (this.eat(tt.braceR)) break; - } +pp.parseExportSpecifiers = function () { + const nodes = []; + let first = true; + let needsFrom; - const isDefault = this.match(tt._default); - if (isDefault && !needsFrom) needsFrom = true; + // export { x, y as z } [from '...'] + this.expect(tt.braceL); - 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")); + while (!this.eat(tt.braceR)) { + if (first) { + first = false; + } else { + this.expect(tt.comma); + if (this.eat(tt.braceR)) break; } - // https://github.com/ember-cli/ember-cli/pull/3739 - if (needsFrom && !this.isContextual("from")) { - this.unexpected(); - } + const isDefault = this.match(tt._default); + if (isDefault && !needsFrom) needsFrom = true; - return nodes; + 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")); } - // Parses import declaration. - - parseImport(node) { - this.eat(tt._import); - - // import '...' - if (this.match(tt.string)) { - node.specifiers = []; - node.source = this.parseExprAtom(); - } else { - node.specifiers = []; - this.parseImportSpecifiers(node); - this.expectContextual("from"); - node.source = this.match(tt.string) ? this.parseExprAtom() : this.unexpected(); - } - this.semicolon(); - return this.finishNode(node, "ImportDeclaration"); + // https://github.com/ember-cli/ember-cli/pull/3739 + if (needsFrom && !this.isContextual("from")) { + this.unexpected(); } - // Parses a comma-separated list of module imports. + return nodes; +}; - 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; - } +// Parses import declaration. - 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.comma); - if (this.eat(tt.braceR)) break; - } +pp.parseImport = function (node) { + this.eat(tt._import); - this.parseImportSpecifier(node); - } + // 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; } - parseImportSpecifier(node) { + if (this.match(tt.star)) { const specifier = this.startNode(); - specifier.imported = this.parseIdentifier(true); - if (this.eatContextual("as")) { - specifier.local = this.parseIdentifier(); + 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 { - this.checkReservedWord(specifier.imported.name, specifier.start, true, true); - specifier.local = specifier.imported.__clone(); + // 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.checkLVal(specifier.local, true, undefined, "import specifier"); - node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); - } - 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.parseImportSpecifier(node); + } +}; + +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(); } -} + 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 89ec41154e..00865943e8 100644 --- a/src/parser/util.js +++ b/src/parser/util.js @@ -1,91 +1,116 @@ -// @flow - -import { types as tt, type TokenType } from "../tokenizer/types"; -import Tokenizer from "../tokenizer"; -import type { Node } from "../types"; +import { types as tt } from "../tokenizer/types"; +import Parser from "./index"; import { lineBreak } from "../util/whitespace"; -// ## Parser utilities - -export default class UtilParser extends Tokenizer { - // TODO - - addExtra(node: Node, key: string, val: any): void { - if (!node) return; - - const extra = node.extra = node.extra || {}; - extra[key] = val; - } - - // TODO - - isRelational(op: "<" | ">"): boolean { - return this.match(tt.relational) && this.state.value === op; - } +const pp = Parser.prototype; - // TODO +// ## Parser utilities - expectRelational(op: "<" | ">"): void { - if (this.isRelational(op)) { - this.next(); - } else { - this.unexpected(null, tt.relational); - } - } +// TODO - // Tests whether parsed token is a contextual keyword. +pp.addExtra = function (node, key, val) { + if (!node) return; - isContextual(name: string): boolean { - return this.match(tt.name) && this.state.value === name; - } + const extra = node.extra = node.extra || {}; + extra[key] = val; +}; - // Consumes contextual keyword if possible. +// TODO - eatContextual(name: string): boolean { - return this.state.value === name && this.eat(tt.name); - } +pp.isRelational = function (op) { + return this.match(tt.relational) && this.state.value === op; +}; - // Asserts that following token is given contextual keyword. +// TODO - expectContextual(name: string, message?: string): void { - if (!this.eatContextual(name)) this.unexpected(null, message); +pp.expectRelational = function (op) { + if (this.isRelational(op)) { + this.next(); + } else { + this.unexpected(null, tt.relational); } +}; - // Test whether a semicolon can be inserted at the current position. +// Tests whether parsed token is a contextual keyword. - canInsertSemicolon(): boolean { - return this.match(tt.eof) || - this.match(tt.braceR) || - lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start)); - } +pp.isContextual = function (name) { + return this.match(tt.name) && this.state.value === name; +}; - // TODO +// Consumes contextual keyword if possible. - isLineTerminator(): boolean { - return this.eat(tt.semi) || this.canInsertSemicolon(); - } +pp.eatContextual = function (name) { + return this.state.value === name && this.eat(tt.name); +}; - // Consume a semicolon, or, failing that, see if we are allowed to - // pretend that there is a semicolon at this position. +// Asserts that following token is given contextual keyword. - semicolon(): void { - if (!this.isLineTerminator()) this.unexpected(null, tt.semi); - } +pp.expectContextual = function (name, message) { + if (!this.eatContextual(name)) this.unexpected(null, message); +}; - // Expect a token of a given type. If found, consume it, otherwise, - // raise an unexpected token error at given pos. +// added for lightscript - expect(type: TokenType, pos?: ?number): void { - this.eat(type) || this.unexpected(pos, type); +pp.isLineBreak = function () { + if (this.hasPlugin("lightscript")) { + // treat start-of-file as newline. + // TODO: reconsider/reevaluate + if (!this.state.lastTokEnd) return true; } - - // Raise an unexpected token error. Can take the expected token type - // instead of a message string. - - 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); + return lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start)); +}; + +// 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() || + (this.hasPlugin("lightscript") && ( + // LSC oneline statement ASI cases + // Allow if x: throw y else: throw z + this.match(tt._else) || + this.match(tt._elif) || + // Allow (-> throw new Error)() + this.match(tt.parenR) || + // Technically it is legal to insert a ; after a ;. + // Allows -> throw new Error; f() + this.state.tokens[this.state.tokens.length - 1].type === tt.semi + )); +}; + +// TODO + +pp.isLineTerminator = function () { + 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. + +pp.semicolon = function () { + 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. + +pp.expect = function (type, pos) { + return this.eat(type) || this.unexpected(pos, type); +}; + +// Expect, but without eating + +pp.check = function (type, pos) { + return this.match(type) || this.unexpected(pos, type); +}; + +// 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}`; } -} + this.raise(pos != null ? pos : this.state.start, messageOrType); +}; diff --git a/src/plugins/estree.js b/src/plugins/estree.js index e4b7041774..55977c1a70 100644 --- a/src/plugins/estree.js +++ b/src/plugins/estree.js @@ -1,228 +1,252 @@ -// @flow - import { types as tt } from "../tokenizer/types"; -import type Parser from "../parser"; -import * as N from "../types"; +import Parser from "../parser"; -function isSimpleProperty(node: N.Node): boolean { - return node != null && - node.type === "Property" && - node.kind === "init" && - node.method === false; -} +const pp = Parser.prototype; -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; +pp.estreeParseRegExpLiteral = function ({ pattern, flags }) { + let regex = null; + try { + regex = new RegExp(pattern, flags); + } catch (e) { + // In environments that don't support these flags value will + // be null as the regex can't be represented natively. } + const node = this.estreeParseLiteral(regex); + node.regex = { pattern, flags }; - estreeParseLiteral(value: any): N.Node { - return this.parseLiteral(value, "Literal"); - } + return node; +}; + +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 { - 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"); +export default function (instance) { + instance.extend("checkDeclaration", function(inner) { + return function (node) { + if (isSimpleProperty(node)) { + this.checkDeclaration(node.value); } else { - this.raise(start, "setter should have exactly one param"); + inner.call(this, node); } - } - } - - 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 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; - } - } + instance.extend("checkGetterSetterParamCount", function(inner) { + return function (prop) { + if (this.hasPlugin("lightscript") && prop.params) { + return inner.apply(this, arguments); + } - 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; + 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 { - // Break for the first non literal expression - break; + this.raise(start, "setter should have exactly one param"); } } - } - - return false; - } - - isValidDirective(stmt: N.Statement): boolean { - return stmt.type === "ExpressionStatement" && - stmt.expression.type === "Literal" && - typeof stmt.expression.value === "string" && - (!stmt.expression.extra || !stmt.expression.extra.parenthesized); - } - - parseBlockBody(node: N.BlockStatementLike, ...args): void { - super.parseBlockBody(node, ...args); - - const directiveStatements = node.directives.map((d) => this.directiveToStmt(d)); - node.body = directiveStatements.concat(node.body); - delete node.directives; - } - - parseClassMethod(classBody, ...args) { - super.parseClassMethod(classBody, ...args); - - const body = classBody.body; - body[body.length - 1].type = "MethodDefinition"; - } - - parseExprAtom(...args): N.Expression { - 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); + }; + }); + + 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; + default: + inner.call(this, expr, isBinding, checkClashes, ...args); + } + }; + }); - case tt._false: - return this.estreeParseLiteral(false); + instance.extend("checkPropClash", function () { + return function (prop, propHash) { + if (prop.computed || !isSimpleProperty(prop)) return; - default: - return super.parseExprAtom(...args); - } - } + const key = prop.key; + // It is either an Identifier or a String/NumericLiteral + const name = key.type === "Identifier" ? key.name : String(key.value); - parseLiteral(...args): T { - const node = super.parseLiteral(...args); - node.raw = node.extra.raw; - delete node.extra; + 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; + } + } + } - return node; - } + 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); + } + }; + }); - 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"); + instance.extend("parseLiteral", function(inner) { + return function (...args) { + const node = inner.call(this, ...args); + node.raw = node.extra.raw; + delete node.extra; - return node; - } + return node; + }; + }); - parseObjectMethod(...args): ?N.ObjectMethod { - const node = super.parseObjectMethod(...args); + 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"); - if (node) { - if (node.kind === "method") node.kind = "init"; - node.type = "Property"; - } + return node; + }; + }); - return node; - } + instance.extend("parseObjectMethod", function(inner) { + return function (...args) { + const node = inner.call(this, ...args); - parseObjectProperty(...args): ?N.ObjectProperty { - const node = super.parseObjectProperty(...args); + if (node) { + if (node.kind === "method") node.kind = "init"; + node.type = "Property"; + } - if (node) { - node.kind = "init"; - node.type = "Property"; - } + return node; + }; + }); - return node; - } + instance.extend("parseObjectProperty", function(inner) { + return function (...args) { + const node = inner.call(this, ...args); - toAssignable(node: N.Node, isBinding: ?boolean, ...args): N.Node { - if (isSimpleProperty(node)) { - this.toAssignable(node.value, isBinding, ...args); + if (node) { + node.kind = "init"; + node.type = "Property"; + } return node; - } 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"); + }; + }); + + 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"); + } } - } - return node; - } + return node; + } - return super.toAssignable(node, isBinding, ...args); - } -}; + return inner.call(this, node, isBinding, ...args); + }; + }); +} diff --git a/src/plugins/flow.js b/src/plugins/flow.js index cad3c4b645..459f6e2c37 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -1,11 +1,8 @@ /* eslint max-len: 0 */ -// @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"; +import { types as tt } from "../tokenizer/types"; +import { types as ct } from "../tokenizer/context"; +import Parser from "../parser"; const primitiveTypes = [ "any", @@ -19,1416 +16,1342 @@ const primitiveTypes = [ "null" ]; -function isEsModuleType(bodyElement: N.Node): boolean { - return bodyElement.type === "DeclareExportAllDeclaration" || - ( - bodyElement.type === "DeclareExportDeclaration" && - ( - !bodyElement.declaration || - (bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration") - ) - ); -} - -const exportSuggestions = { - const: "declare export var", - let: "declare export var", - type: "export type", - interface: "export interface", -}; +const pp = Parser.prototype; -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.flowParseTypeInitialiser = function (tok) { + const oldInType = this.state.inType; + this.state.inType = true; + this.expect(tok || tt.colon); - const type = this.flowParseType(); - this.state.inType = oldInType; - return type; - } + 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"); - } +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"); } +}; - flowParseTypeAndPredicateInitialiser(): [?N.FlowType, ?N.FlowPredicate] { - const oldInType = this.state.inType; - this.state.inType = true; - this.expect(tt.colon); - let type = null; - let predicate = null; +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(); + this.state.inType = oldInType; 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]; - } - - flowParseDeclareClass(node: N.FlowDeclareClass): N.FlowDeclareClass { - this.next(); - this.flowParseInterfaceish(node); - return this.finishNode(node, "DeclareClass"); } + return [type, predicate]; +}; - flowParseDeclareFunction(node: N.FlowDeclareFunction): N.FlowDeclareFunction { - this.next(); - - const id = node.id = this.parseIdentifier(); +pp.flowParseDeclareClass = function (node) { + this.next(); + this.flowParseInterfaceish(node, true); + return this.finishNode(node, "DeclareClass"); +}; - const typeNode = this.startNode(); - const typeContainer = this.startNode(); +pp.flowParseDeclareFunction = function (node) { + this.next(); - if (this.isRelational("<")) { - typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - typeNode.typeParameters = null; - } + const id = node.id = this.parseIdentifier(); - this.expect(tt.parenL); - const tmp = this.flowParseFunctionTypeParams(); - typeNode.params = tmp.params; - typeNode.rest = tmp.rest; - this.expect(tt.parenR); + const typeNode = this.startNode(); + const typeContainer = this.startNode(); - // $FlowFixMe (destructuring not supported yet) - [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); + if (this.isRelational("<")) { + typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + typeNode.typeParameters = null; + } - id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); + 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"); - this.finishNode(id, id.type); + this.finishNode(id, id.type); - this.semicolon(); + this.semicolon(); - return this.finishNode(node, "DeclareFunction"); - } + 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); +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); } else { - throw this.unexpected(); + return this.flowParseDeclareModule(node); } + } else if (this.isContextual("type")) { + return this.flowParseDeclareTypeAlias(node); + } else if (this.isContextual("interface")) { + return this.flowParseDeclareInterface(node); + } else { + this.unexpected(); } +}; - flowParseDeclareVariable(node: N.FlowDeclareVariable): N.FlowDeclareVariable { - this.next(); - node.id = this.flowParseTypeAnnotatableIdentifier(); - this.semicolon(); - return this.finishNode(node, "DeclareVariable"); - } - - flowParseDeclareModule(node: N.FlowDeclareModule): N.FlowDeclareModule { - this.next(); - - if (this.match(tt.string)) { - node.id = this.parseExprAtom(); - } else { - node.id = this.parseIdentifier(); - } +pp.flowParseDeclareVariable = function (node) { + this.next(); + node.id = this.flowParseTypeAnnotatableIdentifier(); + this.semicolon(); + return this.finishNode(node, "DeclareVariable"); +}; - const bodyNode = node.body = this.startNode(); - const body = bodyNode.body = []; - this.expect(tt.braceL); - while (!this.match(tt.braceR)) { - let bodyNode = this.startNode(); +pp.flowParseDeclareModule = function (node) { + this.next(); - 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.string)) { + node.id = this.parseExprAtom(); + } else { + node.id = this.parseIdentifier(); + } - this.parseImport(bodyNode); - } else { - this.expectContextual("declare", "Only declares and type imports are allowed inside declare module"); + const bodyNode = node.body = this.startNode(); + const body = bodyNode.body = []; + this.expect(tt.braceL); + while (!this.match(tt.braceR)) { + let bodyNode = this.startNode(); - bodyNode = this.flowParseDeclare(bodyNode, true); + 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`"); } - body.push(bodyNode); + this.parseImport(bodyNode); + } else { + this.expectContextual("declare", "Only declares and type imports are allowed inside declare module"); + + bodyNode = this.flowParseDeclare(bodyNode, true); } - this.expect(tt.braceR); - - this.finishNode(bodyNode, "BlockStatement"); - - let kind = null; - let hasModuleExport = false; - const errorMessage = "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module"; - body.forEach((bodyElement) => { - if (isEsModuleType(bodyElement)) { - if (kind === "CommonJS") this.unexpected(bodyElement.start, errorMessage); - kind = "ES"; - } else if (bodyElement.type === "DeclareModuleExports") { - if (hasModuleExport) this.unexpected(bodyElement.start, "Duplicate `declare module.exports` statement"); - if (kind === "ES") this.unexpected(bodyElement.start, errorMessage); - kind = "CommonJS"; - hasModuleExport = true; - } - }); - node.kind = kind || "CommonJS"; - return this.finishNode(node, "DeclareModule"); + body.push(bodyNode); } + this.expect(tt.braceR); - flowParseDeclareExportDeclaration(node: N.FlowDeclareExportDeclaration, insideModule: ?boolean): N.FlowDeclareExportDeclaration { - this.expect(tt._export); - - if (this.eat(tt._default)) { - if (this.match(tt._function) || this.match(tt._class)) { - // declare export default class ... - // declare export default function ... - node.declaration = this.flowParseDeclare(this.startNode()); - } else { - // declare export default [type]; - node.declaration = this.flowParseType(); - this.semicolon(); - } - node.default = true; + this.finishNode(bodyNode, "BlockStatement"); + return this.finishNode(node, "DeclareModule"); +}; - 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.flowParseDeclareModuleExports = function (node) { + this.expectContextual("module"); + this.expect(tt.dot); + this.expectContextual("exports"); + node.typeAnnotation = this.flowParseTypeAnnotation(); + this.semicolon(); - 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; - } + return this.finishNode(node, "DeclareModuleExports"); +}; - // $FlowIgnore - node.type = "Declare" + node.type; +pp.flowParseDeclareTypeAlias = function (node) { + this.next(); + this.flowParseTypeAlias(node); + return this.finishNode(node, "DeclareTypeAlias"); +}; - return node; - } - } +pp.flowParseDeclareInterface = function (node) { + this.next(); + this.flowParseInterfaceish(node); + return this.finishNode(node, "DeclareInterface"); +}; - throw this.unexpected(); - } +// Interfaces - flowParseDeclareModuleExports(node: N.FlowDeclareModuleExports): N.FlowDeclareModuleExports { - this.expectContextual("module"); - this.expect(tt.dot); - this.expectContextual("exports"); - node.typeAnnotation = this.flowParseTypeAnnotation(); - this.semicolon(); +pp.flowParseInterfaceish = function (node, allowStatic) { + node.id = this.parseIdentifier(); - return this.finishNode(node, "DeclareModuleExports"); + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + node.typeParameters = null; } - flowParseDeclareTypeAlias(node: N.FlowDeclareTypeAlias): N.FlowDeclareTypeAlias { - this.next(); - this.flowParseTypeAlias(node); - return this.finishNode(node, "DeclareTypeAlias"); + node.extends = []; + node.mixins = []; + + if (this.eat(tt._extends)) { + do { + node.extends.push(this.flowParseInterfaceExtends()); + } while (this.eat(tt.comma)); } - flowParseDeclareInterface(node: N.FlowDeclareInterface): N.FlowDeclareInterface { + if (this.isContextual("mixins")) { this.next(); - this.flowParseInterfaceish(node); - return this.finishNode(node, "DeclareInterface"); + do { + node.mixins.push(this.flowParseInterfaceExtends()); + } while (this.eat(tt.comma)); } - // Interfaces - - flowParseInterfaceish(node: N.FlowDeclare): void { - node.id = this.parseIdentifier(); + node.body = this.flowParseObjectType(allowStatic); +}; - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; - } +pp.flowParseInterfaceExtends = function () { + const node = this.startNode(); - node.extends = []; - node.mixins = []; + node.id = this.flowParseQualifiedTypeIdentifier(); + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } else { + node.typeParameters = null; + } - if (this.eat(tt._extends)) { - do { - node.extends.push(this.flowParseInterfaceExtends()); - } while (this.eat(tt.comma)); - } + return this.finishNode(node, "InterfaceExtends"); +}; - if (this.isContextual("mixins")) { - this.next(); - do { - node.mixins.push(this.flowParseInterfaceExtends()); - } while (this.eat(tt.comma)); - } +pp.flowParseInterface = function (node) { + this.flowParseInterfaceish(node, false); + return this.finishNode(node, "InterfaceDeclaration"); +}; - node.body = this.flowParseObjectType(true, false, false); +pp.flowParseRestrictedIdentifier = function(liberal) { + if (primitiveTypes.indexOf(this.state.value) > -1) { + this.raise(this.state.start, `Cannot overwrite primitive type ${this.state.value}`); } - flowParseInterfaceExtends(): N.FlowInterfaceExtends { - const node = this.startNode(); + return this.parseIdentifier(liberal); +}; - node.id = this.flowParseQualifiedTypeIdentifier(); - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } else { - node.typeParameters = null; - } +// Type aliases - return this.finishNode(node, "InterfaceExtends"); - } +pp.flowParseTypeAlias = function (node) { + node.id = this.flowParseRestrictedIdentifier(); - flowParseInterface(node: N.FlowInterface): N.FlowInterface { - this.flowParseInterfaceish(node); - return this.finishNode(node, "InterfaceDeclaration"); + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + node.typeParameters = null; } - flowParseRestrictedIdentifier(liberal?: boolean): N.Identifier { - if (primitiveTypes.indexOf(this.state.value) > -1) { - this.raise(this.state.start, `Cannot overwrite primitive type ${this.state.value}`); - } + node.right = this.flowParseTypeInitialiser(tt.eq); + this.semicolon(); - return this.parseIdentifier(liberal); - } + return this.finishNode(node, "TypeAlias"); +}; - // Type aliases +// Type annotations - flowParseTypeAlias(node: N.FlowTypeAlias): N.FlowTypeAlias { - node.id = this.flowParseRestrictedIdentifier(); +pp.flowParseTypeParameter = function () { + const node = this.startNode(); - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; - } + const variance = this.flowParseVariance(); - node.right = this.flowParseTypeInitialiser(tt.eq); - this.semicolon(); + const ident = this.flowParseTypeAnnotatableIdentifier(); + node.name = ident.name; + node.variance = variance; + node.bound = ident.typeAnnotation; - return this.finishNode(node, "TypeAlias"); + if (this.match(tt.eq)) { + this.eat(tt.eq); + node.default = this.flowParseType(); } - // Type annotations - - flowParseTypeParameter(): N.FlowTypeParameter { - const node = this.startNode(); - - const variance = this.flowParseVariance(); + return this.finishNode(node, "TypeParameter"); +}; - const ident = this.flowParseTypeAnnotatableIdentifier(); - node.name = ident.name; - node.variance = variance; - node.bound = ident.typeAnnotation; +pp.flowParseTypeParameterDeclaration = function () { + const oldInType = this.state.inType; + const node = this.startNode(); + node.params = []; - if (this.match(tt.eq)) { - this.eat(tt.eq); - node.default = this.flowParseType(); - } + this.state.inType = true; - return this.finishNode(node, "TypeParameter"); + // istanbul ignore else: this condition is already checked at all call sites + if (this.isRelational("<") || this.match(tt.jsxTagStart)) { + this.next(); + } else { + this.unexpected(); } - flowParseTypeParameterDeclaration(): N.FlowTypeParameterDeclaration { - const oldInType = this.state.inType; - const node = this.startNode(); - node.params = []; - - this.state.inType = true; - - // 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(">"); - do { - node.params.push(this.flowParseTypeParameter()); - if (!this.isRelational(">")) { - this.expect(tt.comma); - } - } while (!this.isRelational(">")); - this.expectRelational(">"); - - this.state.inType = oldInType; + this.state.inType = oldInType; - return this.finishNode(node, "TypeParameterDeclaration"); - } + return this.finishNode(node, "TypeParameterDeclaration"); +}; - flowParseTypeParameterInstantiation(): N.FlowTypeParameterInstantiation { - const node = this.startNode(); - const oldInType = this.state.inType; - node.params = []; +pp.flowParseTypeParameterInstantiation = function () { + const node = this.startNode(); + const oldInType = this.state.inType; + 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); - } + this.expectRelational("<"); + while (!this.isRelational(">")) { + node.params.push(this.flowParseType()); + if (!this.isRelational(">")) { + this.expect(tt.comma); } - this.expectRelational(">"); - - this.state.inType = oldInType; - - return this.finishNode(node, "TypeParameterInstantiation"); } + this.expectRelational(">"); - flowParseObjectPropertyKey(): N.Expression { - return (this.match(tt.num) || this.match(tt.string)) ? this.parseExprAtom() : this.parseIdentifier(true); - } + this.state.inType = oldInType; - flowParseObjectTypeIndexer(node: N.FlowObjectTypeIndexer, isStatic: boolean, variance: ?N.FlowVariance): N.FlowObjectTypeIndexer { - node.static = isStatic; + return this.finishNode(node, "TypeParameterInstantiation"); +}; - 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; +pp.flowParseObjectPropertyKey = function () { + return (this.match(tt.num) || this.match(tt.string)) ? this.parseExprAtom() : this.parseIdentifier(true); +}; - return this.finishNode(node, "ObjectTypeIndexer"); +pp.flowParseObjectTypeIndexer = function (node, isStatic, variance) { + node.static = isStatic; + + this.expect(tt.bracketL); + if (this.lookahead().type === tt.colon) { + node.id = this.flowParseObjectPropertyKey(); + node.key = this.flowParseTypeInitialiser(); + } else { + node.id = null; + node.key = this.flowParseType(); } + this.expect(tt.bracketR); + node.value = this.flowParseTypeInitialiser(); + node.variance = variance; - flowParseObjectTypeMethodish(node: N.FlowFunctionTypeAnnotation): N.FlowFunctionTypeAnnotation { - node.params = []; - node.rest = null; - node.typeParameters = null; + this.flowObjectTypeSemicolon(); + return this.finishNode(node, "ObjectTypeIndexer"); +}; - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } +pp.flowParseObjectTypeMethodish = function (node) { + node.params = []; + node.rest = null; + node.typeParameters = null; - 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.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } - if (this.eat(tt.ellipsis)) { - node.rest = this.flowParseFunctionTypeParam(); + this.expect(tt.parenL); + while (this.match(tt.name)) { + node.params.push(this.flowParseFunctionTypeParam()); + if (!this.match(tt.parenR)) { + this.expect(tt.comma); } - this.expect(tt.parenR); - node.returnType = this.flowParseTypeInitialiser(); - - return this.finishNode(node, "FunctionTypeAnnotation"); } - 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"); + if (this.eat(tt.ellipsis)) { + node.rest = this.flowParseFunctionTypeParam(); } + this.expect(tt.parenR); + node.returnType = this.flowParseTypeInitialiser(); - flowParseObjectType(allowStatic: boolean, allowExact: boolean, allowSpread: boolean): N.FlowObjectTypeAnnotation { - const oldInType = this.state.inType; - this.state.inType = true; - - const nodeStart = this.startNode(); - - 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; - } - - nodeStart.exact = exact; + return this.finishNode(node, "FunctionTypeAnnotation"); +}; - 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; - } +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 variance = this.flowParseVariance(); +pp.flowParseObjectTypeCallProperty = function (node, isStatic) { + const valueNode = this.startNode(); + node.static = isStatic; + node.value = this.flowParseObjectTypeMethodish(valueNode); + this.flowObjectTypeSemicolon(); + return this.finishNode(node, "ObjectTypeCallProperty"); +}; - 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(); - } - } +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; + } - nodeStart.properties.push(this.flowParseObjectTypeProperty(node, isStatic, variance, kind, allowSpread)); - } + nodeStart.exact = exact; - this.flowObjectTypeSemicolon(); + 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; } - this.expect(endDelim); - - const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); - - this.state.inType = oldInType; - - return out; - } + const variancePos = this.state.start; + const variance = this.flowParseVariance(); - 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 (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, "Spread properties cannot have variance"); + this.unexpected(variancePos); } - this.expect(tt.ellipsis); - node.argument = this.flowParseType(); - - return this.finishNode(node, "ObjectTypeSpreadProperty"); + nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); } else { - node.key = this.flowParseObjectPropertyKey(); - node.static = isStatic; - node.kind = kind; - - let optional = false; + propertyKey = this.flowParseObjectPropertyKey(); if (this.isRelational("<") || this.match(tt.parenL)) { // This is a method property if (variance) { - this.unexpected(variance.start); + this.unexpected(variancePos); } - - node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start)); - if (kind === "get" || kind === "set") this.flowCheckGetterSetterParamCount(node); + nodeStart.properties.push(this.flowParseObjectTypeMethod(startPos, startLoc, isStatic, propertyKey)); } 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")); } - - node.optional = optional; - - return this.finishNode(node, "ObjectTypeProperty"); - } - } - - // This is similar to checkGetterSetterParamCount, but as - // babylon uses non estree properties we cannot reuse it here - 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"); - } - } - } - - flowObjectTypeSemicolon(): void { - if (!this.eat(tt.semi) && !this.eat(tt.comma) && - !this.match(tt.braceR) && !this.match(tt.braceBarR)) { - this.unexpected(); - } - } - - 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(); - - while (this.eat(tt.dot)) { - const node2 = this.startNodeAt(startPos, startLoc); - node2.qualification = node; - node2.id = this.parseIdentifier(); - node = this.finishNode(node2, "QualifiedTypeIdentifier"); } - return node; + isStatic = false; } - flowParseGenericType(startPos: number, startLoc: Position, id: N.Identifier): N.FlowGenericTypeAnnotation { - const node = this.startNodeAt(startPos, startLoc); + this.expect(endDelim); - node.typeParameters = null; - node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id); + const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } + this.state.inType = oldInType; - return this.finishNode(node, "GenericTypeAnnotation"); - } + return out; +}; - flowParseTypeofType(): N.FlowTypeofTypeAnnotation { - const node = this.startNode(); - this.expect(tt._typeof); - node.argument = this.flowParsePrimaryType(); - return this.finishNode(node, "TypeofTypeAnnotation"); +pp.flowObjectTypeSemicolon = function () { + if (!this.eat(tt.semi) && !this.eat(tt.comma) && + !this.match(tt.braceR) && !this.match(tt.braceBarR)) { + this.unexpected(); } +}; - 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.flowParseQualifiedTypeIdentifier = function (startPos, startLoc, id) { + startPos = startPos || this.state.start; + startLoc = startLoc || this.state.startLoc; + let node = id || this.parseIdentifier(); - 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"); + while (this.eat(tt.dot)) { + const node2 = this.startNodeAt(startPos, startLoc); + node2.qualification = node; + node2.id = this.parseIdentifier(); + node = this.finishNode(node2, "QualifiedTypeIdentifier"); } - 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"); - } + return node; +}; - 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(); - } - return { params, rest }; - } +pp.flowParseGenericType = function (startPos, startLoc, id) { + const node = this.startNodeAt(startPos, startLoc); - flowIdentToTypeAnnotation(startPos: number, startLoc: Position, node: N.FlowTypeAnnotation, id: N.Identifier): N.FlowTypeAnnotation { - switch (id.name) { - case "any": - return this.finishNode(node, "AnyTypeAnnotation"); + node.typeParameters = null; + node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id); - case "void": - return this.finishNode(node, "VoidTypeAnnotation"); + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } - case "bool": - case "boolean": - return this.finishNode(node, "BooleanTypeAnnotation"); + return this.finishNode(node, "GenericTypeAnnotation"); +}; - case "mixed": - return this.finishNode(node, "MixedTypeAnnotation"); +pp.flowParseTypeofType = function () { + const node = this.startNode(); + this.expect(tt._typeof); + node.argument = this.flowParsePrimaryType(); + return this.finishNode(node, "TypeofTypeAnnotation"); +}; - case "empty": - return this.finishNode(node, "EmptyTypeAnnotation"); +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"); +}; - case "number": - return this.finishNode(node, "NumberTypeAnnotation"); +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; + } + typeAnnotation = this.flowParseTypeInitialiser(); + } else { + typeAnnotation = this.flowParseType(); + } + node.name = name; + node.optional = optional; + node.typeAnnotation = typeAnnotation; + return this.finishNode(node, "FunctionTypeParam"); +}; - case "string": - return this.finishNode(node, "StringTypeAnnotation"); +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"); +}; - default: - return this.flowParseGenericType(startPos, startLoc, id); +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); } } + if (this.eat(tt.ellipsis)) { + ret.rest = this.flowParseFunctionTypeParam(); + } + return ret; +}; - // 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); +pp.flowIdentToTypeAnnotation = function (startPos, startLoc, node, id) { + switch (id.name) { + case "any": + return this.finishNode(node, "AnyTypeAnnotation"); - node.returnType = this.flowParseType(); + case "void": + return this.finishNode(node, "VoidTypeAnnotation"); - return this.finishNode(node, "FunctionTypeAnnotation"); - } - break; + case "bool": + case "boolean": + return this.finishNode(node, "BooleanTypeAnnotation"); - case tt.parenL: - this.next(); + case "mixed": + return this.finishNode(node, "MixedTypeAnnotation"); - // 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 "empty": + return this.finishNode(node, "EmptyTypeAnnotation"); - if (isGroupedType) { - this.state.noAnonFunctionType = false; - type = this.flowParseType(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; + case "number": + return this.finishNode(node, "NumberTypeAnnotation"); - // 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); - } - } + case "string": + return this.finishNode(node, "StringTypeAnnotation"); - if (type) { - tmp = this.flowParseFunctionTypeParams( - [this.reinterpretTypeAsFunctionTypeParam(type)], - ); - } else { - tmp = this.flowParseFunctionTypeParams(); - } + default: + return this.flowParseGenericType(startPos, startLoc, id); + } +}; +// The parsing of types roughly parallels the parsing of expressions, and +// primary types are kind of like primary expressions...they're the +// primitives with which other types are constructed. +pp.flowParsePrimaryType = function () { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + const node = this.startNode(); + let tmp; + let type; + let isGroupedType = false; + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + + switch (this.state.type) { + case tt.name: + return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier()); + + case tt.braceL: + return this.flowParseObjectType(false, false); + + 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.string: - return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); + case tt.parenL: + this.next(); - case tt._true: case tt._false: - node.value = this.match(tt._true); - this.next(); - return this.finishNode(node, "BooleanLiteralTypeAnnotation"); + // 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.plusMin: - if (this.state.value === "-") { - this.next(); - if (!this.match(tt.num)) this.unexpected(null, "Unexpected token, expected number"); + if (isGroupedType) { + this.state.noAnonFunctionType = false; + type = this.flowParseType(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; - return this.parseLiteral(-this.state.value, "NumberLiteralTypeAnnotation", node.start, node.loc.start); + // 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); } + } - this.unexpected(); - case tt.num: - return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); + if (type) { + tmp = this.flowParseFunctionTypeParams( + [this.reinterpretTypeAsFunctionTypeParam(type)], + ); + } else { + tmp = this.flowParseFunctionTypeParams(); + } - case tt._null: - node.value = this.match(tt._null); - this.next(); - return this.finishNode(node, "NullLiteralTypeAnnotation"); + node.params = tmp.params; + node.rest = tmp.rest; - case tt._this: - node.value = this.match(tt._this); - this.next(); - return this.finishNode(node, "ThisTypeAnnotation"); + this.expect(tt.parenR); + + this.expect(tt.arrow); + + node.returnType = this.flowParseType(); - case tt.star: + 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 === "-") { this.next(); - return this.finishNode(node, "ExistsTypeAnnotation"); + if (!this.match(tt.num)) this.unexpected(null, "Unexpected token, expected number"); - default: - if (this.state.type.keyword === "typeof") { - return this.flowParseTypeofType(); - } - } + return this.parseLiteral(-this.state.value, "NumericLiteralTypeAnnotation", node.start, node.loc.start); + } - throw this.unexpected(); - } + this.unexpected(); + case tt.num: + return this.parseLiteral(this.state.value, "NumericLiteralTypeAnnotation"); - 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; - } + case tt._null: + node.value = this.match(tt._null); + this.next(); + return this.finishNode(node, "NullLiteralTypeAnnotation"); - 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(); - } - } + case tt._this: + node.value = this.match(tt._this); + this.next(); + return this.finishNode(node, "ThisTypeAnnotation"); - 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; + case tt.star: + this.next(); + return this.finishNode(node, "ExistentialTypeParam"); + + default: + if (this.state.type.keyword === "typeof") { + return this.flowParseTypeofType(); + } } - 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"); + 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"); } + return type; +}; - 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"); +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(); } +}; - flowParseType(): N.FlowTypeAnnotation { - const oldInType = this.state.inType; - this.state.inType = true; - const type = this.flowParseUnionType(); - this.state.inType = oldInType; - return type; +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"); } + return param; +}; - flowParseTypeAnnotation(): N.FlowTypeAnnotation { - const node = this.startNode(); - node.typeAnnotation = this.flowParseTypeInitialiser(); - return this.finishNode(node, "TypeAnnotation"); +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()); } + return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); +}; - flowParseTypeAnnotatableIdentifier(): N.Identifier { - const ident = this.flowParseRestrictedIdentifier(); - if (this.match(tt.colon)) { - ident.typeAnnotation = this.flowParseTypeAnnotation(); - this.finishNode(ident, ident.type); - } - return ident; +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()); } + 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; +}; - typeCastToParameter(node: N.Node): N.Node { - node.expression.typeAnnotation = node.typeAnnotation; +pp.flowParseTypeAnnotation = function () { + const node = this.startNode(); + node.typeAnnotation = this.flowParseTypeInitialiser(); + return this.finishNode(node, "TypeAnnotation"); +}; + +pp.flowParseTypeAndPredicateAnnotation = function () { + const node = this.startNode(); + [node.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + return this.finishNode(node, "TypeAnnotation"); +}; - return this.finishNodeAt( - node.expression, - node.expression.type, - node.typeAnnotation.end, - node.typeAnnotation.loc.end - ); +pp.flowParseTypeAnnotatableIdentifier = function () { + const ident = this.flowParseRestrictedIdentifier(); + if (this.match(tt.colon)) { + ident.typeAnnotation = this.flowParseTypeAnnotation(); + this.finishNode(ident, ident.type); } + return ident; +}; - 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"); +pp.typeCastToParameter = function (node) { + node.expression.typeAnnotation = node.typeAnnotation; + + 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"; } - return variance; + this.next(); } + return variance; +}; - // ================================== - // Overrides - // ================================== - +export default function (instance) { // plain function return types: function name(): string {} - 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; - } + 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(); + } - return super.parseFunctionBody(node, allowExpression); - } + return inner.call(this, node, allowExpression); + }; + }); // interfaces - 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); - } - } + 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); + } + }; + }); // declares, interfaces and type aliases - 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); + 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); + } } } - } - return super.parseExpressionStatement(node, expr); - } + return inner.call(this, node, expr); + }; + }); // export type - 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; + 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; + } } } - } - return super.parseConditional(expr, noIn, startPos, startLoc); - } + return inner.call(this, expr, noIn, startPos, startLoc); + }; + }); - parseParenItem(node: N.Expression, startPos: number, startLoc: Position): N.Expression { - node = super.parseParenItem(node, startPos, startLoc); - if (this.eat(tt.question)) { - node.optional = true; - } - - if (this.match(tt.colon)) { - const typeCastNode = this.startNodeAt(startPos, startLoc); - typeCastNode.expression = node; - typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); + 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; + } - return this.finishNode(typeCastNode, "TypeCastExpression"); - } + if (this.match(tt.colon)) { + const typeCastNode = this.startNodeAt(startPos, startLoc); + typeCastNode.expression = node; + typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); - return node; - } + return this.finishNode(typeCastNode, "TypeCastExpression"); + } - parseExport(node: N.ExportNamedDeclaration): N.ExportNamedDeclaration { - node = super.parseExport(node); - if (node.type === "ExportNamedDeclaration") { - node.exportKind = node.exportKind || "value"; - } - return node; - } + 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; + }; + }); - parseExportDeclaration(node: N.ExportNamedDeclaration): ?N.Declaration { - if (this.isContextual("type")) { - node.exportKind = "type"; + instance.extend("parseExportDeclaration", function (inner) { + return function (node) { + if (this.isContextual("type")) { + node.exportKind = "type"; - const declarationNode = this.startNode(); - this.next(); + const declarationNode = this.startNode(); + this.next(); - if (this.match(tt.braceL)) { - // export type { foo, bar }; - node.specifiers = this.parseExportSpecifiers(); - this.parseExportFrom(node); - return null; + 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); } else { - // export type Foo = Bar; - return this.flowParseTypeAlias(declarationNode); + return inner.call(this, node); } - } 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(); - } - } + }; + }); + + instance.extend("parseClassId", function (inner) { + return function (node) { + inner.apply(this, arguments); + 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 - isKeyword(name: string): boolean { - if (this.state.inType && name === "void") { - return false; - } else { - return super.isKeyword(name); - } - } + instance.extend("isKeyword", function (inner) { + return function (name) { + if (this.state.inType && name === "void") { + return false; + } else { + return inner.call(this, name); + } + }; + }); // ensure that inside flow types, we bypass the jsx parser plugin - readToken(code: number): void { - if (this.state.inType && (code === 62 || code === 60)) { - return this.finishOp(tt.relational, 1); - } else { - return super.readToken(code); - } - } + 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); + instance.extend("toAssignableList", function (inner) { + return function (exprList, isBinding, contextDescription) { + for (let i = 0; i < exprList.length; i++) { + const expr = exprList[i]; + if (expr && expr.type === "TypeCastExpression") { + exprList[i] = this.typeCastToParameter(expr); + } } - } - return super.toAssignableList(exprList, isBinding, contextDescription); - } + return inner.call(this, 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 - 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"); + 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"); + } } - } - return exprList; - } + return exprList; + }; + }); // parse an item inside a expression list eg. `(NODE, NODE)` where NODE represents // the position where this function is called - 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("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; + } + }; + }); - checkLVal(node: N.Expression, ...args): void { - if (node.type !== "TypeCastExpression") { - return super.checkLVal(node, ...args); - } - } + instance.extend("checkLVal", function (inner) { + return function (node) { + if (node.type !== "TypeCastExpression") { + return inner.apply(this, arguments); + } + }; + }); // parse class property type annotations - 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(); - } + 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); + }; + }); // determine whether or not we're currently in the position where a class property would appear - isClassProperty(): boolean { - return this.match(tt.colon) || super.isClassProperty(); - } + instance.extend("isClassProperty", function (inner) { + return function () { + return this.match(tt.colon) || inner.call(this); + }; + }); // parse type parameters for class methods - 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(); - } + 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(); + } - super.parseClassMethod(classBody, method, ...args); - } + inner.call(this, classBody, method, ...args); + }; + }); // parse a the super class type parameters and implements - 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("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)); + } + }; + }); - parsePropertyName(node: N.ObjectMember): N.Identifier { - const variance = this.flowParseVariance(); - const key = super.parsePropertyName(node); - node.variance = variance; - return key; - } + 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; + }; + }); // parse type parameters for object method shorthand - parseObjPropValue(prop: N.ObjectMember, ...args): void { - if (prop.variance) { - this.unexpected(prop.variance.start); - } - delete prop.variance; + instance.extend("parseObjPropValue", function (inner) { + return function (prop) { + if (prop.variance) { + this.unexpected(prop.variancePos); + } + delete prop.variance; + delete prop.variancePos; - let typeParameters; + let typeParameters; - // method shorthand - if (this.isRelational("<")) { - typeParameters = this.flowParseTypeParameterDeclaration(); - if (!this.match(tt.parenL)) this.unexpected(); - } + // method shorthand + if (this.isRelational("<")) { + typeParameters = this.flowParseTypeParameterDeclaration(); + if (!this.match(tt.parenL)) this.unexpected(); + } - super.parseObjPropValue(prop, ...args); + inner.apply(this, arguments); - // add typeParameters if we found them - if (typeParameters) { - // $FlowFixMe (trying to set '.typeParameters' on an expression) - (prop.value || prop).typeParameters = typeParameters; - } - } + // add typeParameters if we found them + if (typeParameters) { + (prop.value || prop).typeParameters = typeParameters; + } + }; + }); - 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; - } + 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; + }; + }); - parseMaybeDefault(...args): N.Pattern { - const node = super.parseMaybeDefault(...args); + instance.extend("parseMaybeDefault", function (inner) { + return function (...args) { + const node = inner.apply(this, args); - 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`"); - } + 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; + }; + }); - return node; - } // parse typeof and type imports - 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; + 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; + } } - } - super.parseImportSpecifiers(node); - } + inner.call(this, node); + }; + }); // parse import-type/typeof shorthand - 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"; - } + 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"; + } - 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; + 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); specifier.importKind = specifierTypeKind; - specifier.local = as_ident.__clone(); + if (this.eatContextual("as")) { + specifier.local = this.parseIdentifier(); + } else { + isBinding = true; + specifier.local = specifier.imported.__clone(); + } } else { - // `import {type as foo` + isBinding = true; 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() {} - parseFunctionParams(node: N.NormalFunction): void { - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } - super.parseFunctionParams(node); - } + instance.extend("parseFunctionParams", function (inner) { + return function (node) { + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + inner.call(this, node); + }; + }); // parse flow type annotations on variable declarator heads - let foo: string = bar - 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); - } - } + 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); + } + }; + }); // parse the return type of an async arrow function - let foo = (async (): number => {}); - 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; - } + 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; + } - return super.parseAsyncArrowFromCallExpression(node, call); - } + return inner.call(this, node, call); + }; + }); // todo description - shouldParseAsyncArrow(): boolean { - return this.match(tt.colon) || super.shouldParseAsyncArrow(); - } + instance.extend("shouldParseAsyncArrow", function (inner) { + return function () { + return this.match(tt.colon) || inner.call(this); + }; + }); // We need to support type parameter declarations for arrow functions. This // is tricky. There are three situations we need to handle @@ -1439,93 +1362,101 @@ export default (superClass: Class): Class => class extends super // 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 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; + // 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; + } } } - } - if (jsxError != null || this.isRelational("<")) { - let arrowExpression; - let typeParameters; - try { - typeParameters = this.flowParseTypeParameterDeclaration(); - - arrowExpression = super.parseMaybeAssign(...args); - arrowExpression.typeParameters = typeParameters; - this.resetStartLocationFromNode(arrowExpression, typeParameters); - } catch (err) { - throw jsxError || 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 (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", - ); + 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", + ); + } } - } + this.state.context.pop(); - return super.parseMaybeAssign(...args); - } + return inner.apply(this, args); + }; + }); // handle return types for arrow functions - 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; - - const typeNode = this.startNode(); - // $FlowFixMe (destructuring not supported yet) - [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - - this.state.noAnonFunctionType = oldNoAnonFunctionType; - - if (this.canInsertSemicolon()) this.unexpected(); - if (!this.match(tt.arrow)) this.unexpected(); + 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; - // 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; + 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; + } } } - } - return super.parseArrow(node); - } + return inner.call(this, node); + }; + }); - shouldParseArrow(): boolean { - return this.match(tt.colon) || super.shouldParseArrow(); - } -}; + instance.extend("shouldParseArrow", function (inner) { + return function () { + return this.match(tt.colon) || inner.call(this); + }; + }); + + instance.extend("isClassMutatorStarter", function (inner) { + return function () { + if (this.isRelational("<")) { + return true; + } else { + return inner.call(this); + } + }; + }); +} diff --git a/src/plugins/jsx/fromCodePoint.js b/src/plugins/jsx/fromCodePoint.js new file mode 100644 index 0000000000..a69acf7686 --- /dev/null +++ b/src/plugins/jsx/fromCodePoint.js @@ -0,0 +1,66 @@ +// 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 0d8e6b91a5..de13289e38 100644 --- a/src/plugins/jsx/index.js +++ b/src/plugins/jsx/index.js @@ -1,12 +1,10 @@ -// @flow +import fromCodePoint from "./fromCodePoint"; import XHTMLEntities from "./xhtml"; -import type Parser from "../../parser"; import { TokenType, types as tt } from "../../tokenizer/types"; import { TokContext, types as tc } from "../../tokenizer/context"; -import * as N from "../../types"; +import Parser from "../../parser"; import { isIdentifierChar, isIdentifierStart } from "../../util/identifier"; -import type { Pos, Position } from "../../util/location"; import { isNewLine } from "../../util/whitespace"; const HEX_NUMBER = /^[\da-fA-F]+$/; @@ -37,435 +35,470 @@ tt.jsxTagEnd.updateContext = function(prevType) { } }; -// Transforms JSX element name to string. +const pp = Parser.prototype; -function getQualifiedJSXName(object: N.JSXIdentifier | N.JSXNamespacedName | N.JSXMemberExpression): string { - if (object.type === "JSXIdentifier") { - return object.name; - } +// Reads inline JSX contents token. - if (object.type === "JSXNamespacedName") { - return object.namespace.name + ":" + object.name.name; - } - - if (object.type === "JSXMemberExpression") { - return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); - } - - // istanbul ignore next - throw new Error("Node had unexpected type: " + object.type); -} - -export default (superClass: Class): Class => class extends superClass { - // Reads inline JSX contents token. +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"); + } - 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); - 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); + 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); } - out += this.input.slice(chunkStart, this.state.pos); - return this.finishToken(tt.jsxText, out); + return this.getTokenFromCode(ch); + } + out += this.input.slice(chunkStart, this.state.pos); + return this.finishToken(tt.jsxText, out); - case 38: // "&" + case 38: // "&" + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadEntity(); + chunkStart = this.state.pos; + break; + + default: + if (isNewLine(ch)) { out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadEntity(); + out += this.jsxReadNewLine(true); chunkStart = this.state.pos; - break; - - default: - if (isNewLine(ch)) { - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadNewLine(true); - chunkStart = this.state.pos; - } else { - ++this.state.pos; - } - } + } else { + ++this.state.pos; + } } } +}; - jsxReadNewLine(normalizeCRLF: boolean): string { - const ch = this.input.charCodeAt(this.state.pos); - let out; +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; - if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) { - ++this.state.pos; - out = normalizeCRLF ? "\n" : "\r\n"; - } else { - out = String.fromCharCode(ch); + 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; + } } - ++this.state.curLine; - this.state.lineStart = this.state.pos; - - return out; } - 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"); - } + return out; +}; - 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; - } +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"); + } + + const ch = this.input.charCodeAt(this.state.pos); + if (ch === quote) break; + if (ch === 38) { // "&" + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadEntity(); + chunkStart = this.state.pos; + } else if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadNewLine(false); + chunkStart = this.state.pos; + } else { + ++this.state.pos; } - out += this.input.slice(chunkStart, this.state.pos++); - return this.finishToken(tt.string, out); } + out += this.input.slice(chunkStart, this.state.pos++); + return this.finishToken(tt.string, out); +}; - 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)); - } +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)); } else { - entity = XHTMLEntities[str]; + str = str.substr(1); + if (DECIMAL_NUMBER.test(str)) + entity = fromCodePoint(parseInt(str, 10)); } - break; + } else { + entity = XHTMLEntities[str]; } - str += ch; - } - if (!entity) { - this.state.pos = startPos; - return "&"; + break; } - return entity; + 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. - - 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)); - } +// 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)); +}; - // Parse next token as JSX identifier +// Transforms JSX element name to string. - 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"); +function getQualifiedJSXName(object) { + if (object.type === "JSXIdentifier") { + return object.name; } - // Parse namespaced identifier. - - jsxParseNamespacedName(): N.JSXNamespacedName { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const name = this.jsxParseIdentifier(); - if (!this.eat(tt.colon)) return name; + if (object.type === "JSXNamespacedName") { + return object.namespace.name + ":" + object.name.name; + } - const node = this.startNodeAt(startPos, startLoc); - node.namespace = name; - node.name = this.jsxParseIdentifier(); - return this.finishNode(node, "JSXNamespacedName"); + if (object.type === "JSXMemberExpression") { + return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); } +} - // 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; +// 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(); } + this.next(); + return this.finishNode(node, "JSXIdentifier"); +}; - // Parses any type of JSX attribute value. +// Parse namespaced identifier. - 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; - } +pp.jsxParseNamespacedName = function() { + 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: - return this.parseExprAtom(); + const node = this.startNodeAt(startPos, startLoc); + node.namespace = name; + node.name = this.jsxParseIdentifier(); + return this.finishNode(node, "JSXNamespacedName"); +}; - default: - throw 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. + +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"); } + 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. - jsxParseEmptyExpression(): N.JSXEmptyExpression { - const node = this.startNodeAt(this.state.lastTokEnd, this.state.lastTokEndLoc); - return this.finishNodeAt(node, "JSXEmptyExpression", this.state.start, this.state.startLoc); +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; + } + + case tt.jsxTagStart: + case tt.string: + node = this.parseExprAtom(); + node.extra = null; + return node; + + default: + this.raise(this.state.start, "JSX value should be either an expression or a quoted JSX text"); } +}; - // Parse JSX spread child +// JSXEmptyExpression is unique type since it doesn't actually parse anything, +// and so it should start at the end of last read token (left brace) and finish +// at the beginning of the next one (right brace). - jsxParseSpreadChild(): N.JSXSpreadChild { - const node = this.startNode(); - this.expect(tt.braceL); - this.expect(tt.ellipsis); - node.expression = this.parseExpression(); - this.expect(tt.braceR); +pp.jsxParseEmptyExpression = function() { + const node = this.startNodeAt(this.state.lastTokEnd, this.state.lastTokEndLoc); + return this.finishNodeAt(node, "JSXEmptyExpression", this.state.start, this.state.startLoc); +}; - return this.finishNode(node, "JSXSpreadChild"); - } +// Parse JSX spread child - // Parses JSX expression enclosed into curly brackets. +pp.jsxParseSpreadChild = function() { + const node = this.startNode(); + this.expect(tt.braceL); + this.expect(tt.ellipsis); + node.expression = this.parseExpression(); + this.expect(tt.braceR); + return this.finishNode(node, "JSXSpreadChild"); +}; - 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, "JSXExpressionContainer"); - } +// Parses JSX expression enclosed into curly brackets. - // Parses following JSX attribute name-value pair. - 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"); +pp.jsxParseExpressionContainer = function() { + 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, "JSXExpressionContainer"); +}; - // Parses JSX opening tag starting after "<". +// Parses following JSX attribute name-value pair. - jsxParseOpeningElementAt(startPos: number, startLoc: Position): N.JSXOpeningElement { - 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()); - } - node.selfClosing = this.eat(tt.slash); - this.expect(tt.jsxTagEnd); - return this.finishNode(node, "JSXOpeningElement"); +pp.jsxParseAttribute = function() { + 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"); +}; - // Parses JSX closing tag starting after "" - ); + case tt.jsxText: + children.push(this.parseExprAtom()); + break; + + case tt.braceL: + if (this.lookahead().type === tt.ellipsis) { + children.push(this.jsxParseSpreadChild()); + } else { + children.push(this.jsxParseExpressionContainer()); + } + + break; + + // istanbul ignore next - should never happen + default: + this.unexpected(); } } - 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"); + if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) { + this.raise( + closingElement.start, + "Expected corresponding JSX closing tag for <" + getQualifiedJSXName(openingElement.name) + ">" + ); } - return this.finishNode(node, "JSXElement"); } - // Parses entire JSX element from current position. - - jsxParseElement(): N.JSXElement { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - this.next(); - return this.jsxParseElementAt(startPos, startLoc); + 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"); +}; - // ================================== - // Overrides - // ================================== +// Parses entire JSX element from current position. - 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); - } - } +pp.jsxParseElement = function() { + 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); + } + }; + }); - readToken(code: number): void { - if (this.state.inPropertyName) return super.readToken(code); + instance.extend("readToken", function(inner) { + return function(code) { + if (this.state.inPropertyName) return inner.call(this, code); - const context = this.curContext(); + const context = this.curContext(); - if (context === tc.j_expr) { - return this.jsxReadToken(); - } + if (this.hasPlugin("lightscript") && code === 60) { + const next = this.state.input.charCodeAt(this.state.pos + 1); - if (context === tc.j_oTag || context === tc.j_cTag) { - if (isIdentifierStart(code)) { - return this.jsxReadWord(); - } + // short-circuit for `<-` and ` JSX open tag -> ... anymore + this.state.context.push(tc.j_cTag); // reconsider as closing tag context + this.state.exprAllowed = false; } else { - super.updateContext(prevType); + return inner.call(this, prevType); } - this.state.exprAllowed = true; - } else if (this.match(tt.slash) && prevType === tt.jsxTagStart) { - this.state.context.length -= 2; // do not consider JSX expr -> JSX open tag -> ... anymore - this.state.context.push(tc.j_cTag); // reconsider as closing tag context - this.state.exprAllowed = false; - } else { - return super.updateContext(prevType); - } - } -}; + }; + }); +} diff --git a/src/plugins/jsx/xhtml.js b/src/plugins/jsx/xhtml.js index 022c4e94ac..232f8b1b1a 100644 --- a/src/plugins/jsx/xhtml.js +++ b/src/plugins/jsx/xhtml.js @@ -1,6 +1,4 @@ -// @flow - -const entities: { [name: string]: string } = { +export default { quot: "\u0022", amp: "&", apos: "\u0027", @@ -255,4 +253,3 @@ const entities: { [name: string]: string } = { hearts: "\u2665", diams: "\u2666" }; -export default entities; diff --git a/src/plugins/lightscript.js b/src/plugins/lightscript.js new file mode 100644 index 0000000000..fd992ae6ca --- /dev/null +++ b/src/plugins/lightscript.js @@ -0,0 +1,661 @@ +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 === " false +// x\ny -> true +// x\n y -> false + +pp.isNonIndentedBreakFrom = function (pos) { + const indentLevel = this.indentLevelAt(pos); + return this.isLineBreak() && this.state.indentLevel <= indentLevel; +}; + +// 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; + } + } 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 === "constructor" && val !== "->") this.unexpected(null, "Can only use -> with constructor."); + + if ((node.kind === "get" || node.kind === "set") && val !== "->") { + this.unexpected(node.start, "Can only use -> with getters & setters."); + } + + switch (val) { + case "=/>": case "-/>": + node.async = true; + break; + case "=*>": case "-*>": + node.generator = true; + break; + case "=*/>": case "-*/>": + node.async = true; + node.generator = true; + break; + case "=>": case "->": + break; + default: + this.unexpected(); + } + + if (val[0] === "-") { + node.skinny = true; + } else if (val[0] === "=") { + node.skinny = false; + } else { + this.unexpected(); + } +}; + +// largely c/p from parseFunctionBody + +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; + + const indentLevel = this.state.indentLevel; + const nodeAtArrow = this.startNode(); + this.expect(tt.arrow); + if (!this.isLineBreak()) { + if (this.match(tt.braceL)) { + // restart node at brace start instead of arrow start + node.body = this.startNode(); + this.next(); + this.parseBlockBody(node.body, true, false, tt.braceR); + this.addExtra(node.body, "curly", true); + node.body = this.finishNode(node.body, "BlockStatement"); + } else { + node.body = this.parseInlineWhiteBlock(nodeAtArrow); + } + } else { + node.body = this.parseMultilineWhiteBlock(nodeAtArrow, indentLevel); + } + + if (node.body.type !== "BlockStatement") { + node.expression = true; + } + + this.state.inAsync = oldInAsync; + this.state.inGenerator = oldInGen; + this.state.labels = oldLabels; + this.state.inFunction = oldInFunc; + + this.validateFunctionBody(node, true); +}; + +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"); +}; + +pp.pushBlockState = function (blockType, indentLevel) { + this.state.blockStack.push({ blockType, indentLevel }); +}; + +pp.matchBlockState = function(blockType, indentLevel) { + return this.state.blockStack.some( (x) => x.blockType === blockType && x.indentLevel === indentLevel ); +}; + +pp.popBlockState = function() { + this.state.blockStack.pop(); +}; + +// c/p parseIfStatement + +pp.parseIf = function (node, isExpression, requireColon = null) { + const indentLevel = this.state.indentLevel; + this.next(); + node.test = this.parseParenExpression(); + + const isColon = requireColon + ? this.check(tt.colon) + : this.match(tt.colon); + + // colon not allowed, parent `if` didn't use one. + if (isColon && requireColon === false) this.expect(tt.braceL); + + if (isColon) this.pushBlockState("if", indentLevel); + + if (isExpression) { + // disallow return/continue/break, etc. c/p doExpression + const oldInFunction = this.state.inFunction; + const oldLabels = this.state.labels; + this.state.labels = []; + this.state.inFunction = false; + + if (this.match(tt.braceL)) { + node.consequent = this.parseBlock(false); + } else if (!isColon) { + node.consequent = this.parseMaybeAssign(); + } else { + node.consequent = this.parseWhiteBlock(true); + } + + this.state.inFunction = oldInFunction; + this.state.labels = oldLabels; + } else { + node.consequent = this.parseStatement(false); + } + + node.alternate = this.parseIfAlternate(node, isExpression, isColon, indentLevel); + + if (isColon) this.popBlockState(); + + return this.finishNode(node, isExpression ? "IfExpression" : "IfStatement"); +}; + +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; + } + + if (this.match(tt._elif)) { + return this.parseIf(this.startNode(), isExpression, ifIsWhiteBlock); + } + + 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, ifIsWhiteBlock); + } + + if (ifIsWhiteBlock) { + return this.parseWhiteBlock(isExpression); + } else if (this.match(tt.colon)) { + this.expect(tt.braceL); + } + + if (isExpression) { + if (this.match(tt.braceL)) { + return this.parseBlock(false); + } else { + return this.parseMaybeAssign(); + } + } + + return this.parseStatement(false); + } + + return null; +}; + +pp.parseIfExpression = function (node) { + return this.parseIf(node, true); +}; + + +// c/p parseAwait + +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; + } + } + + 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); + + // Declaration, not Expression + node.type = "NamedArrowDeclaration"; + return node; +}; + +pp.isBitwiseOp = function () { + return ( + this.match(tt.bitwiseOR) || + this.match(tt.bitwiseAND) || + this.match(tt.bitwiseXOR) || + this.match(tt.bitShift) + ); +}; + + +export default function (instance) { + + // if, switch, while, with --> don't need no stinkin' parens no more + + 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; + } + } catch (_err) { + // fall-through, will re-raise if it's an error below + } + + // otherwise, try traditional parseParenExpression + this.state = state; + return inner.apply(this, 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"); + } + } + + // 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); + }; + }); + + // whitespace following a colon + + instance.extend("parseStatement", function (inner) { + return function () { + if (this.match(tt.colon)) { + return this.parseWhiteBlock(); + } + return inner.apply(this, arguments); + }; + }); + + // whitespace following a colon + + instance.extend("parseBlock", function (inner) { + return function () { + if (this.match(tt.colon)) { + return this.parseWhiteBlock(); + } + 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); + }; + }); + + +} diff --git a/src/tokenizer/context.js b/src/tokenizer/context.js index 7b7b97b6d7..81db0499c3 100644 --- a/src/tokenizer/context.js +++ b/src/tokenizer/context.js @@ -1,5 +1,3 @@ -// @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 34f75fa490..deb763a025 100644 --- a/src/tokenizer/index.js +++ b/src/tokenizer/index.js @@ -1,14 +1,9 @@ /* 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 { type TokContext, types as ct } from "./context"; -import LocationParser from "../parser/location"; +import { types as ct } from "./context"; import { SourceLocation } from "../util/location"; import { lineBreak, lineBreakG, isNewLine, nonASCIIwhitespace } from "../util/whitespace"; import State from "./state"; @@ -18,7 +13,7 @@ import State from "./state"; // used for the onToken callback and the external tokenizer. export class Token { - constructor(state: State) { + constructor(state) { this.type = state.type; this.value = state.value; this.start = state.start; @@ -35,7 +30,7 @@ export class Token { // ## Tokenizer -function codePointToString(code: number): string { +function codePointToString(code) { // UTF-16 Decoding if (code <= 0xFFFF) { return String.fromCharCode(code); @@ -44,22 +39,15 @@ function codePointToString(code: number): string { } } -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(); +export default class Tokenizer { + constructor(options, input) { this.state = new State; this.state.init(options, input); } // Move to the next token - next(): void { + next() { if (!this.isLookahead) { this.state.tokens.push(new Token(this.state)); } @@ -73,7 +61,7 @@ export default class Tokenizer extends LocationParser { // TODO - eat(type: TokenType): boolean { + eat(type) { if (this.match(type)) { this.next(); return true; @@ -84,19 +72,19 @@ export default class Tokenizer extends LocationParser { // TODO - match(type: TokenType): boolean { + match(type) { return this.state.type === type; } // TODO - isKeyword(word: string): boolean { + isKeyword(word) { return isKeyword(word); } // TODO - lookahead(): State { + lookahead() { const old = this.state; this.state = old.clone(true); @@ -112,7 +100,7 @@ export default class Tokenizer extends LocationParser { // Toggle strict mode. Re-reads the next number or string to please // pedantic tests (`"use strict"; 010;` should fail). - setStrict(strict: boolean): void { + setStrict(strict) { this.state.strict = strict; if (!this.match(tt.num) && !this.match(tt.string)) return; this.state.pos = this.state.start; @@ -123,14 +111,14 @@ export default class Tokenizer extends LocationParser { this.nextToken(); } - curContext(): TokContext { + curContext() { return this.state.context[this.state.context.length - 1]; } // Read a single token, updating the parser object's token-related // properties. - nextToken(): void { + nextToken() { const curContext = this.curContext(); if (!curContext || !curContext.preserveSpace) this.skipSpace(); @@ -147,7 +135,7 @@ export default class Tokenizer extends LocationParser { } } - readToken(code: number): void { + readToken(code) { // Identifier or keyword. '\uXXXX' sequences are allowed in // identifiers, so '\' also dispatches to that. if (isIdentifierStart(code) || code === 92 /* '\' */) { @@ -157,7 +145,7 @@ export default class Tokenizer extends LocationParser { } } - fullCharCodeAtPos(): number { + fullCharCodeAtPos() { const code = this.input.charCodeAt(this.state.pos); if (code <= 0xd7ff || code >= 0xe000) return code; @@ -165,7 +153,7 @@ export default class Tokenizer extends LocationParser { return (code << 10) + next - 0x35fdc00; } - pushComment(block: boolean, text: string, start: number, end: number, startLoc: Position, endLoc: Position): void { + pushComment(block, text, start, end, startLoc, endLoc) { const comment = { type: block ? "CommentBlock" : "CommentLine", value: text, @@ -181,7 +169,7 @@ export default class Tokenizer extends LocationParser { } } - skipBlockComment(): void { + skipBlockComment() { const startLoc = this.state.curPosition(); const start = this.state.pos; const end = this.input.indexOf("*/", this.state.pos += 2); @@ -198,7 +186,7 @@ export default class Tokenizer extends LocationParser { this.pushComment(true, this.input.slice(start + 2, end), start, this.state.pos, startLoc, this.state.curPosition()); } - skipLineComment(startSkip: number): void { + skipLineComment(startSkip) { const start = this.state.pos; const startLoc = this.state.curPosition(); let ch = this.input.charCodeAt(this.state.pos += startSkip); @@ -213,12 +201,29 @@ export default class Tokenizer extends LocationParser { // Called at the start of the parse and after every token. Skips // whitespace and comments, and. - skipSpace(): void { + skipSpace() { + let isNewLine = this.state.pos === 0; // for lightscript loop: while (this.state.pos < this.input.length) { const ch = this.input.charCodeAt(this.state.pos); switch (ch) { - case 32: case 160: // ' ' + case 160: + if (this.hasPlugin("lightscript")) { + this.unexpected(null, "nbsp is illegal in lightscript; use a normal space."); + } + + case 32: // ' ' ++this.state.pos; + + // DUP in `jsxReadNewLine()` + if (this.hasPlugin("lightscript") && isNewLine) { + if (this.input.charCodeAt(this.state.pos) === 32) { + ++this.state.pos; + ++this.state.indentLevel; + } else { + // TODO: consider + // this.unexpected(null, "Odd indentation."); + } + } break; case 13: @@ -226,10 +231,18 @@ export default class Tokenizer extends LocationParser { ++this.state.pos; } - case 10: case 8232: case 8233: + case 8232: case 8233: + if (this.hasPlugin("lightscript") && ch !== 13) { + this.unexpected(null, "Only '\\n' and '\\r\\n' are legal newlines in lightscript."); + } + case 10: ++this.state.pos; ++this.state.curLine; this.state.lineStart = this.state.pos; + if (this.hasPlugin("lightscript")) { + isNewLine = true; + this.state.indentLevel = 0; + } break; case 47: // '/' @@ -249,6 +262,7 @@ export default class Tokenizer extends LocationParser { default: if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { + if (this.hasPlugin("lightscript")) this.unexpected(null, "Only normal whitespace (ascii-32) is allowed."); ++this.state.pos; } else { break loop; @@ -262,7 +276,7 @@ export default class Tokenizer extends LocationParser { // the token, so that the next one's `start` will point at the // right position. - finishToken(type: TokenType, val: any): void { + finishToken(type, val) { this.state.end = this.state.pos; this.state.endLoc = this.state.curPosition(); const prevType = this.state.type; @@ -281,9 +295,10 @@ export default class Tokenizer extends LocationParser { // // All in the name of speed. // - readToken_dot(): void { + readToken_dot() { const next = this.input.charCodeAt(this.state.pos + 1); - if (next >= 48 && next <= 57) { + // in lightscript, numbers cannot start with a naked `.` + if (next >= 48 && next <= 57 && !this.hasPlugin("lightscript")) { return this.readNumber(true); } @@ -297,8 +312,17 @@ export default class Tokenizer extends LocationParser { } } - readToken_slash(): void { // '/' - if (this.state.exprAllowed) { + readToken_slash() { // '/' + const looksLikeRegex = this.hasPlugin("lightscript") && + this.isLineBreak() && + !this.isWhitespaceAt(this.state.pos + 1) && + // if parsing jsx, allow `/>` etc. + (!this.hasPlugin("jsx") || ( + this.curContext() !== ct.j_oTag && + this.curContext() !== ct.j_cTag + )); + + if (this.state.exprAllowed || looksLikeRegex) { ++this.state.pos; return this.readRegexp(); } @@ -311,7 +335,7 @@ export default class Tokenizer extends LocationParser { } } - readToken_mult_modulo(code: number): void { // '%*' + readToken_mult_modulo(code) { // '%*' let type = code === 42 ? tt.star : tt.modulo; let width = 1; let next = this.input.charCodeAt(this.state.pos + 1); @@ -330,7 +354,7 @@ export default class Tokenizer extends LocationParser { return this.finishOp(type, width); } - readToken_pipe_amp(code: number): void { // '|&' + readToken_pipe_amp(code) { // '|&' 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); @@ -338,7 +362,7 @@ export default class Tokenizer extends LocationParser { return this.finishOp(code === 124 ? tt.bitwiseOR : tt.bitwiseAND, 1); } - readToken_caret(): void { // '^' + readToken_caret() { // '^' const next = this.input.charCodeAt(this.state.pos + 1); if (next === 61) { return this.finishOp(tt.assign, 2); @@ -347,7 +371,7 @@ export default class Tokenizer extends LocationParser { } } - readToken_plus_min(code: number): void { // '+-' + readToken_plus_min(code) { // '+-' const next = this.input.charCodeAt(this.state.pos + 1); if (next === code) { @@ -360,6 +384,32 @@ export default class Tokenizer extends LocationParser { return this.finishOp(tt.incDec, 2); } + // lightscript '->' + // TODO: dedup w/ fat + if (this.hasPlugin("lightscript") && code === 45) { + if (next === 62) { + this.state.pos += 2; + return this.finishToken(tt.arrow, "->"); + } + const next2 = this.input.charCodeAt(this.state.pos + 2); + if (next === 47 && next2 === 62) { + this.state.pos += 3; + return this.finishToken(tt.arrow, "-/>"); + } + if (next === 42 && next2 === 62) { + this.state.pos += 3; + return this.finishToken(tt.arrow, "-*>"); + } + + if (this.hasPlugin("asyncGenerators")) { + const next3 = this.input.charCodeAt(this.state.pos + 3); + if (next === 42 && next2 === 47 && next3 === 62) { + this.state.pos += 4; + return this.finishToken(tt.arrow, "-*/>"); + } + } + } + if (next === 61) { return this.finishOp(tt.assign, 2); } else { @@ -367,7 +417,7 @@ export default class Tokenizer extends LocationParser { } } - readToken_lt_gt(code: number): void { // '<>' + readToken_lt_gt(code) { // '<>' const next = this.input.charCodeAt(this.state.pos + 1); let size = 1; @@ -385,6 +435,17 @@ export default class Tokenizer extends LocationParser { return this.nextToken(); } + if (this.hasPlugin("lightscript") && code === 60) { + // <- + if (next === 45) { + return this.finishOp(tt.awaitArrow, 2); + } + // = size = 2; @@ -393,17 +454,46 @@ export default class Tokenizer extends LocationParser { return this.finishOp(tt.relational, size); } - readToken_eq_excl(code: number): void { // '=!' + readToken_eq_excl(code) { // '=!' 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); + + // lightscript '=>' + // TODO: dedup w/ skinny + if (this.hasPlugin("lightscript") && code === 61) { + if (next === 62) { + this.state.pos += 2; + return this.finishToken(tt.arrow, "=>"); + } + + const next2 = this.input.charCodeAt(this.state.pos + 2); + if (next === 47 && next2 === 62) { + this.state.pos += 3; + return this.finishToken(tt.arrow, "=/>"); + } + if (next === 42 && next2 === 62) { + this.state.pos += 3; + return this.finishToken(tt.arrow, "=*>"); + } + + if (this.hasPlugin("asyncGenerators")) { + const next3 = this.input.charCodeAt(this.state.pos + 3); + if (next === 42 && next2 === 47 && next3 === 62) { + this.state.pos += 4; + return this.finishToken(tt.arrow, "=*/>"); + } + } + } + if (code === 61 && next === 62) { // '=>' this.state.pos += 2; return this.finishToken(tt.arrow); } + return this.finishOp(code === 61 ? tt.eq : tt.prefix, 1); } - getTokenFromCode(code: number): void { + getTokenFromCode(code) { switch (code) { // The interpretation of a dot depends on whether it is followed // by a digit or another two dots. @@ -437,7 +527,16 @@ export default class Tokenizer extends LocationParser { return this.finishToken(tt.colon); } - case 63: ++this.state.pos; return this.finishToken(tt.question); + case 63: + if (this.hasPlugin("lightscript")) { + const next = this.input.charCodeAt(this.state.pos + 1); + // `?.` or `?[` + if (next === 46 || next === 91) { + return this.finishOp(tt.elvis, 2); + } + } + ++this.state.pos; + return this.finishToken(tt.question); case 64: ++this.state.pos; return this.finishToken(tt.at); case 96: // '`' @@ -485,26 +584,42 @@ export default class Tokenizer extends LocationParser { return this.readToken_eq_excl(code); case 126: // '~' - return this.finishOp(tt.prefix, 1); + if (this.hasPlugin("lightscript")) { + ++this.state.pos; + return this.finishToken(tt.tilde); + } else { + return this.finishOp(tt.prefix, 1); + } + } this.raise(this.state.pos, `Unexpected character '${codePointToString(code)}'`); } - finishOp(type: TokenType, size: number): void { + finishOp(type, size) { const str = this.input.slice(this.state.pos, this.state.pos + size); this.state.pos += size; return this.finishToken(type, str); } - readRegexp(): void { + readRegexp() { const start = this.state.pos; let escaped, inClass; + + if (this.hasPlugin("lightscript") && this.input.charCodeAt(start) === 32) { + this.raise(start, "Regex literals cannot start with a space in lightscript; try '\\s' or '\\ ' instead."); + } + + // for lightscript, exprAllowed logic may have been overriden; possibly confusing, try to clarify. + const unterminatedErrMsg = !this.state.exprAllowed + ? "Unterminated regular expression (if you wanted division, add a space after the '/')." + : "Unterminated regular expression"; + for (;;) { - if (this.state.pos >= this.input.length) this.raise(start, "Unterminated regular expression"); + if (this.state.pos >= this.input.length) this.raise(start, unterminatedErrMsg); const ch = this.input.charAt(this.state.pos); if (lineBreak.test(ch)) { - this.raise(start, "Unterminated regular expression"); + this.raise(start, unterminatedErrMsg); } if (escaped) { escaped = false; @@ -539,7 +654,7 @@ export default class Tokenizer extends LocationParser { // were read, the integer value otherwise. When `len` is given, this // will return `null` unless the integer has exactly `len` digits. - readInt(radix: number, len?: number): number | null { + readInt(radix, len) { const start = this.state.pos; let total = 0; @@ -564,7 +679,7 @@ export default class Tokenizer extends LocationParser { return total; } - readRadixNumber(radix: number): void { + readRadixNumber(radix) { this.state.pos += 2; // 0x const val = this.readInt(radix); if (val == null) this.raise(this.state.start + 2, "Expected number in radix " + radix); @@ -574,29 +689,34 @@ export default class Tokenizer extends LocationParser { // Read an integer, octal integer, or floating-point number. - readNumber(startsWithDot: boolean): void { + readNumber(startsWithDot) { const start = this.state.pos; - let octal = this.input.charCodeAt(start) === 48; // '0' + const octal = this.input.charCodeAt(this.state.pos) === 48; let isFloat = false; - if (!startsWithDot && this.readInt(10) === null) this.raise(start, "Invalid number"); - if (octal && this.state.pos == start + 1) octal = false; // number === 0 + // for numeric array access (eg; arr.0), don't read floats (numbers with a decimal). + const noFloatsAllowed = this.hasPlugin("lightscript") && + this.state.tokens.length > 0 && + this.state.tokens[this.state.tokens.length - 1].type === tt.dot; + if (!startsWithDot && this.readInt(10) === null) this.raise(start, "Invalid number"); let next = this.input.charCodeAt(this.state.pos); - if (next === 46 && !octal) { // '.' + if (next === 46 && !noFloatsAllowed) { // '.' ++this.state.pos; this.readInt(10); isFloat = true; next = this.input.charCodeAt(this.state.pos); } - - if ((next === 69 || next === 101) && !octal) { // 'eE' + if (next === 69 || next === 101) { // 'eE' next = this.input.charCodeAt(++this.state.pos); if (next === 43 || next === 45) ++this.state.pos; // '+-' if (this.readInt(10) === null) this.raise(start, "Invalid number"); isFloat = true; } - + // don't read the decimal if it's not followed by a number; `1.` is illegal, must do `1.0` + 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); @@ -605,10 +725,8 @@ export default class Tokenizer extends LocationParser { val = parseFloat(str); } else if (!octal || str.length === 1) { val = parseInt(str, 10); - } else if (this.state.strict) { + } else if (/[89]/.test(str) || this.state.strict) { this.raise(start, "Invalid number"); - } else if (/[89]/.test(str)) { - val = parseInt(str, 10); } else { val = parseInt(str, 8); } @@ -617,31 +735,22 @@ export default class Tokenizer extends LocationParser { // Read a string value, interpreting backslash-escapes. - readCodePoint(throwOnInvalid: boolean): number | null { + readCodePoint() { 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, throwOnInvalid); + code = this.readHexChar(this.input.indexOf("}", this.state.pos) - this.state.pos); ++this.state.pos; - 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; - } - } + if (code > 0x10FFFF) this.raise(codePos, "Code point out of bounds"); } else { - code = this.readHexChar(4, throwOnInvalid); + code = this.readHexChar(4); } return code; } - readString(quote: number): void { + readString(quote) { let out = "", chunkStart = ++this.state.pos; for (;;) { if (this.state.pos >= this.input.length) this.raise(this.state.start, "Unterminated string constant"); @@ -649,7 +758,6 @@ export default class Tokenizer extends LocationParser { 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 { @@ -663,8 +771,8 @@ export default class Tokenizer extends LocationParser { // Reads template string tokens. - readTmplToken(): void { - let out = "", chunkStart = this.state.pos, containsInvalid = false; + readTmplToken() { + let out = "", chunkStart = this.state.pos; for (;;) { if (this.state.pos >= this.input.length) this.raise(this.state.start, "Unterminated template"); const ch = this.input.charCodeAt(this.state.pos); @@ -679,16 +787,11 @@ export default class Tokenizer extends LocationParser { } } out += this.input.slice(chunkStart, this.state.pos); - return this.finishToken(tt.template, containsInvalid ? null : out); + return this.finishToken(tt.template, out); } if (ch === 92) { // '\' out += this.input.slice(chunkStart, this.state.pos); - const escaped = this.readEscapedChar(true); - if (escaped === null) { - containsInvalid = true; - } else { - out += escaped; - } + out += this.readEscapedChar(true); chunkStart = this.state.pos; } else if (isNewLine(ch)) { out += this.input.slice(chunkStart, this.state.pos); @@ -714,21 +817,14 @@ export default class Tokenizer extends LocationParser { // Used to read escaped characters - readEscapedChar(inTemplate: boolean): string | null { - const throwOnInvalid = !inTemplate; + readEscapedChar(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: { // '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 120: return String.fromCharCode(this.readHexChar(2)); // 'x' + case 117: return codePointToString(this.readCodePoint()); // 'u' case 116: return "\t"; // 't' -> '\t' case 98: return "\b"; // 'b' -> '\b' case 118: return "\u000b"; // 'v' -> '\u000b' @@ -740,8 +836,6 @@ export default class Tokenizer extends LocationParser { 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) { @@ -749,16 +843,12 @@ export default class Tokenizer extends LocationParser { octal = parseInt(octalStr, 8); } if (octal > 0) { - 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. + if (!this.state.containsOctal) { this.state.containsOctal = true; - this.state.octalPosition = codePos; + 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.pos += octalStr.length - 1; @@ -768,19 +858,12 @@ export default class Tokenizer extends LocationParser { } } - // Used to read character escape sequences ('\x', '\u'). + // Used to read character escape sequences ('\x', '\u', '\U'). - readHexChar(len: number, throwOnInvalid: boolean): number | null { + readHexChar(len) { const codePos = this.state.pos; const n = this.readInt(16, len); - if (n === null) { - if (throwOnInvalid) { - this.raise(codePos, "Bad character escape sequence"); - } else { - this.state.pos = codePos - 1; - this.state.invalidTemplateEscapePosition = codePos - 1; - } - } + if (n === null) this.raise(codePos, "Bad character escape sequence"); return n; } @@ -790,7 +873,7 @@ export default class Tokenizer extends LocationParser { // Incrementally adds only escaped chars, adding other chunks as-is // as a micro-optimization. - readWord1(): string { + readWord1() { this.state.containsEsc = false; let word = "", first = true, chunkStart = this.state.pos; while (this.state.pos < this.input.length) { @@ -808,13 +891,11 @@ export default class Tokenizer extends LocationParser { } ++this.state.pos; - const esc = this.readCodePoint(true); - // $FlowFixMe (thinks esc may be null, but throwOnInvalid is true) + const esc = this.readCodePoint(); if (!(first ? isIdentifierStart : isIdentifierChar)(esc, true)) { this.raise(escStart, "Invalid Unicode escape"); } - // $FlowFixMe word += codePointToString(esc); chunkStart = this.state.pos; } else { @@ -828,7 +909,7 @@ export default class Tokenizer extends LocationParser { // Read an identifier or keyword token. Will check for reserved // words when necessary. - readWord(): void { + readWord() { const word = this.readWord1(); let type = tt.name; if (!this.state.containsEsc && this.isKeyword(word)) { @@ -837,7 +918,7 @@ export default class Tokenizer extends LocationParser { return this.finishToken(type, word); } - braceIsBlock(prevType: TokenType): boolean { + braceIsBlock(prevType) { if (prevType === tt.colon) { const parent = this.curContext(); if (parent === ct.braceStatement || parent === ct.braceExpression) { @@ -860,7 +941,7 @@ export default class Tokenizer extends LocationParser { return !this.state.exprAllowed; } - updateContext(prevType: TokenType): void { + updateContext(prevType) { const type = this.state.type; let update; diff --git a/src/tokenizer/state.js b/src/tokenizer/state.js index 2e35b3ac4f..e69f12055f 100644 --- a/src/tokenizer/state.js +++ b/src/tokenizer/state.js @@ -33,9 +33,13 @@ export default class State { this.leadingComments = []; this.commentStack = []; + this.blockStack = []; + this.pos = this.lineStart = 0; this.curLine = options.startLine; + this.indentLevel = 0; + this.type = tt.eof; this.value = null; this.start = this.end = this.pos; @@ -50,8 +54,6 @@ 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 e6552249e6..8e0d0a3807 100644 --- a/src/tokenizer/types.js +++ b/src/tokenizer/types.js @@ -1,5 +1,3 @@ -// @flow - // ## Token types // The assignment of fine-grained, information-carrying type objects @@ -25,33 +23,8 @@ 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 { - 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 = {}) { + constructor(label, conf = {}) { this.label = label; this.keyword = conf.keyword; this.beforeExpr = !!conf.beforeExpr; @@ -67,7 +40,7 @@ export class TokenType { } class KeywordTokenType extends TokenType { - constructor(name: string, options: TokenOptions = {}) { + constructor(name, options = {}) { options.keyword = name; super(name, options); @@ -75,12 +48,17 @@ class KeywordTokenType extends TokenType { } export class BinopTokenType extends TokenType { - constructor(name: string, prec: number) { + constructor(name, prec) { super(name, { beforeExpr, binop: prec }); } } -export const types: { [name: string]: TokenType } = { +export const types = { + // LightScript + tilde: new TokenType("~"), + awaitArrow: new TokenType("<-", { beforeExpr, isAssign }), + elvis: new TokenType("?."), + num: new TokenType("num", { startsExpr }), regexp: new TokenType("regexp", { startsExpr }), string: new TokenType("string", { startsExpr }), @@ -102,7 +80,7 @@ export const types: { [name: string]: TokenType } = { doubleColon: new TokenType("::", { beforeExpr }), dot: new TokenType("."), question: new TokenType("?", { beforeExpr }), - arrow: new TokenType("=>", { beforeExpr }), + arrow: new TokenType("=>", { beforeExpr, startsExpr }), template: new TokenType("template"), ellipsis: new TokenType("...", { beforeExpr }), backQuote: new TokenType("`", { startsExpr }), @@ -143,6 +121,13 @@ export const types: { [name: string]: TokenType } = { }; export const keywords = { + // LightScript + "elif": new KeywordTokenType("elif", { beforeExpr }), + "now": new KeywordTokenType("now", { beforeExpr }), + "or": types.logicalOR, + "and": types.logicalAND, + "not": new KeywordTokenType("not", { beforeExpr, prefix, startsExpr }), + "break": new KeywordTokenType("break"), "case": new KeywordTokenType("case", { beforeExpr }), "catch": new KeywordTokenType("catch"), @@ -167,7 +152,7 @@ export const keywords = { "new": new KeywordTokenType("new", { beforeExpr, startsExpr }), "this": new KeywordTokenType("this", { startsExpr }), "super": new KeywordTokenType("super", { startsExpr }), - "class": new KeywordTokenType("class"), + "class": new KeywordTokenType("class", { startsExpr }), "extends": new KeywordTokenType("extends", { beforeExpr }), "export": new KeywordTokenType("export"), "import": new KeywordTokenType("import", { startsExpr }), diff --git a/src/types.js b/src/types.js deleted file mode 100644 index b42f72a154..0000000000 --- a/src/types.js +++ /dev/null @@ -1,709 +0,0 @@ -// @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 3fc6ab2cde..25bbc28d50 100644 --- a/src/util/identifier.js +++ b/src/util/identifier.js @@ -1,7 +1,5 @@ /* 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 @@ -11,24 +9,24 @@ // // It starts by sorting the words by length. -function makePredicate(words: string): (str: string) => boolean { - const wordsArr = words.split(" "); +function makePredicate(words) { + words = words.split(" "); return function (str) { - return wordsArr.indexOf(str) >= 0; + return words.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") }; // And the keywords -export const isKeyword = makePredicate("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this let const class extends export import yield super"); +export const isKeyword = makePredicate("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this let const class extends export import yield super or and not elif now"); // ## Character categories @@ -59,7 +57,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: number, set: $ReadOnlyArray): boolean { +function isInAstralSet(code, set) { let pos = 0x10000; for (let i = 0; i < set.length; i += 2) { pos += set[i]; @@ -68,12 +66,11 @@ function isInAstralSet(code: number, set: $ReadOnlyArray): boolean { pos += set[i + 1]; if (pos >= code) return true; } - return false; } // Test whether a given character code starts an identifier. -export function isIdentifierStart(code: number): boolean { +export function isIdentifierStart(code) { if (code < 65) return code === 36; if (code < 91) return true; if (code < 97) return code === 95; @@ -84,7 +81,7 @@ export function isIdentifierStart(code: number): boolean { // Test whether a given character is part of an identifier. -export function isIdentifierChar(code: number): boolean { +export function isIdentifierChar(code) { 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 aaa4ae531c..38137496c1 100644 --- a/src/util/location.js +++ b/src/util/location.js @@ -1,32 +1,18 @@ -// @flow - import { lineBreakG } from "./whitespace"; -export type Pos = { - start: number; -} - // These are used when `options.locations` is on, for the // `startLoc` and `endLoc` properties. export class Position { - line: number; - column: number; - - constructor(line: number, col: number) { + constructor(line, col) { this.line = line; this.column = col; } } export class SourceLocation { - start: Position; - end: Position; - filename: string; - - constructor(start: Position, end?: Position) { + constructor(start, end) { this.start = start; - // $FlowIgnore (may start as null, but initialized later) this.end = end; } } @@ -37,7 +23,7 @@ export class SourceLocation { // offset. `input` should be the code string that the offset refers // into. -export function getLineInfo(input: string, offset: number): Position { +export function getLineInfo(input, offset) { for (let line = 1, cur = 0; ;) { lineBreakG.lastIndex = cur; const match = lineBreakG.exec(input); @@ -48,6 +34,4 @@ export function getLineInfo(input: string, offset: number): Position { 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 0588213ecd..e345a4cf5e 100644 --- a/src/util/whitespace.js +++ b/src/util/whitespace.js @@ -1,5 +1,3 @@ -// @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 8eeae5dbb5..eba937611a 100644 --- a/test/estree-throws.js +++ b/test/estree-throws.js @@ -1,5 +1,5 @@ import path from "path"; -import { runThrowTestsWithEstree } from "./helpers/runFixtureTests"; +import { runThrowTestsWithEstree } from "./utils/runFixtureTests"; import { parse } from "../lib"; runThrowTestsWithEstree(path.join(__dirname, "fixtures"), parse); diff --git a/test/expressions.js b/test/expressions.js deleted file mode 100644 index 6ecb36971f..0000000000 --- a/test/expressions.js +++ /dev/null @@ -1,5 +0,0 @@ -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 100644 new mode 100755 index 8a36b86cdf..f8f5e28599 --- a/test/fixtures/comments/basic/block-trailing-comment/expected.json +++ b/test/fixtures/comments/basic/block-trailing-comment/expected.json @@ -83,8 +83,7 @@ "end": { "line": 2, "column": 5 - }, - "identifierName": "a" + } }, "name": "a" }, diff --git a/test/fixtures/comments/basic/block-trailing-comment/options.lightscript.json b/test/fixtures/comments/basic/block-trailing-comment/options.lightscript.json new file mode 100644 index 0000000000..d1ffeceb15 --- /dev/null +++ b/test/fixtures/comments/basic/block-trailing-comment/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected { (2:7)" +} \ No newline at end of file diff --git a/test/fixtures/comments/basic/comment-within-condition/expected.json b/test/fixtures/comments/basic/comment-within-condition/expected.json old mode 100644 new mode 100755 index d98e5b584d..695fa34b10 --- a/test/fixtures/comments/basic/comment-within-condition/expected.json +++ b/test/fixtures/comments/basic/comment-within-condition/expected.json @@ -54,8 +54,7 @@ "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 100644 new mode 100755 index 10e0d6cbdc..e42c57b979 --- a/test/fixtures/comments/basic/export-default-anonymous-class/expected.json +++ b/test/fixtures/comments/basic/export-default-anonymous-class/expected.json @@ -87,7 +87,6 @@ "column": 5 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,17 +100,16 @@ "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 0a4d4d6663..3d0e83f874 100644 --- a/test/fixtures/comments/basic/shebang-import/expected.json +++ b/test/fixtures/comments/basic/shebang-import/expected.json @@ -69,11 +69,9 @@ "end": { "line": 3, "column": 13 - }, - "identifierName": "spawn" + } }, - "name": "spawn", - "leadingComments": null + "name": "spawn" }, "local": { "type": "Identifier", @@ -87,12 +85,10 @@ "end": { "line": 3, "column": 13 - }, - "identifierName": "spawn" + } }, "name": "spawn" - }, - "leadingComments": null + } } ], "source": { @@ -155,4 +151,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 1d5ab8aced..199d8d452a 100644 --- a/test/fixtures/comments/basic/shebang-object/expected.json +++ b/test/fixtures/comments/basic/shebang-object/expected.json @@ -101,11 +101,9 @@ "end": { "line": 3, "column": 11 - }, - "identifierName": "spawn" + } }, - "name": "spawn", - "leadingComments": null + "name": "spawn" }, "value": { "type": "Identifier", @@ -119,18 +117,15 @@ "end": { "line": 3, "column": 11 - }, - "identifierName": "spawn" + } }, "name": "spawn" }, - "leadingComments": null, "extra": { "shorthand": true } } - ], - "leadingComments": null + ] }, "init": { "type": "Identifier", @@ -144,12 +139,10 @@ "end": { "line": 3, "column": 17 - }, - "identifierName": "x" + } }, "name": "x" - }, - "leadingComments": null + } } ], "kind": "var", @@ -193,4 +186,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 100644 new mode 100755 index ea2c84fbc9..1b90fb89f0 --- a/test/fixtures/comments/basic/surrounding-call-comments/expected.json +++ b/test/fixtures/comments/basic/surrounding-call-comments/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "a" + } }, "name": "a" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -118,8 +116,7 @@ "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 100644 new mode 100755 index f3fc61bd29..76143585ee --- a/test/fixtures/comments/basic/surrounding-debugger-comments/expected.json +++ b/test/fixtures/comments/basic/surrounding-debugger-comments/expected.json @@ -54,14 +54,12 @@ "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 100644 new mode 100755 index 02cf5d12e9..5ce003f2c5 --- a/test/fixtures/comments/basic/surrounding-return-comments/expected.json +++ b/test/fixtures/comments/basic/surrounding-return-comments/expected.json @@ -54,14 +54,12 @@ "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 100644 new mode 100755 index c76d573a84..5dcfd548ca --- a/test/fixtures/comments/basic/surrounding-throw-comments/expected.json +++ b/test/fixtures/comments/basic/surrounding-throw-comments/expected.json @@ -54,14 +54,12 @@ "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 100644 new mode 100755 index 669d70dc8f..d2805cc6ab --- a/test/fixtures/comments/basic/surrounding-while-loop-comments/expected.json +++ b/test/fixtures/comments/basic/surrounding-while-loop-comments/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "f" + } }, "name": "f" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -206,8 +204,7 @@ "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 100644 new mode 100755 index 3ce051b4a8..4559db028e --- 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,14 +54,12 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "bar" + } }, "name": "bar" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "foo" + } }, "name": "foo" } @@ -122,8 +119,7 @@ "end": { "line": 2, "column": 14 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -256,8 +252,7 @@ "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 100644 new mode 100755 index 1e6c9d5796..9246cd1331 --- a/test/fixtures/comments/basic/switch-fallthrough-comment/expected.json +++ b/test/fixtures/comments/basic/switch-fallthrough-comment/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -188,8 +187,7 @@ "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 100644 new mode 100755 index ec0792f047..aa28503c94 --- 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,14 +54,12 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "bar" + } }, "name": "bar" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "a" + } }, "name": "a" } @@ -122,8 +119,7 @@ "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 100644 new mode 100755 index 2c858e5b45..985d6e376b --- 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,8 +83,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "module" + } }, "name": "module" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "exports" + } }, "name": "exports" }, @@ -124,7 +122,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -138,8 +135,7 @@ "end": { "line": 1, "column": 33 - }, - "identifierName": "context" + } }, "name": "context" } @@ -185,14 +181,12 @@ "end": { "line": 3, "column": 23 - }, - "identifierName": "isConstant" + } }, "name": "isConstant" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -206,8 +200,7 @@ "end": { "line": 3, "column": 28 - }, - "identifierName": "node" + } }, "name": "node" } @@ -267,8 +260,7 @@ "end": { "line": 4, "column": 20 - }, - "identifierName": "node" + } }, "name": "node" }, @@ -284,8 +276,7 @@ "end": { "line": 4, "column": 25 - }, - "identifierName": "type" + } }, "name": "type" }, @@ -347,8 +338,7 @@ "end": { "line": 6, "column": 33 - }, - "identifierName": "isConstant" + } }, "name": "isConstant" }, @@ -393,8 +383,7 @@ "end": { "line": 6, "column": 38 - }, - "identifierName": "node" + } }, "name": "node" }, @@ -410,8 +399,7 @@ "end": { "line": 6, "column": 50 - }, - "identifierName": "expressions" + } }, "name": "expressions" }, @@ -471,8 +459,7 @@ "end": { "line": 6, "column": 55 - }, - "identifierName": "node" + } }, "name": "node" }, @@ -488,8 +475,7 @@ "end": { "line": 6, "column": 67 - }, - "identifierName": "expressions" + } }, "name": "expressions" }, @@ -507,8 +493,7 @@ "end": { "line": 6, "column": 74 - }, - "identifierName": "length" + } }, "name": "length" }, @@ -646,4 +631,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 100644 new mode 100755 index 99e1057f70..95efdd480c --- a/test/fixtures/comments/basic/switch-no-default-comment/expected.json +++ b/test/fixtures/comments/basic/switch-no-default-comment/expected.json @@ -54,8 +54,7 @@ "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 2269e0729d..f48495688b 100644 --- a/test/fixtures/core/categorized/filename-specified/expected.json +++ b/test/fixtures/core/categorized/filename-specified/expected.json @@ -74,8 +74,7 @@ "line": 2, "column": 8 }, - "filename": "path/to/input-file.js", - "identifierName": "node" + "filename": "path/to/input-file.js" }, "name": "node", "leadingComments": null diff --git a/test/fixtures/core/categorized/label-kind-switch/options.lightscript.json b/test/fixtures/core/categorized/label-kind-switch/options.lightscript.json new file mode 100644 index 0000000000..43de8d051d --- /dev/null +++ b/test/fixtures/core/categorized/label-kind-switch/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (2:5)" +} \ No newline at end of file diff --git a/test/fixtures/core/categorized/not-directive/expected.json b/test/fixtures/core/categorized/not-directive/expected.json index 6f0c685ad2..7e25efd1e5 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 8cd916691c..52ce62c781 100644 --- a/test/fixtures/core/categorized/startline-specified/expected.json +++ b/test/fixtures/core/categorized/startline-specified/expected.json @@ -168,5 +168,292 @@ } ], "directives": [] - } -} \ No newline at end of file + }, + "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 + } + } + } + ] +} diff --git a/test/fixtures/core/opts/ranges-false/actual.js b/test/fixtures/core/opts/ranges-false/actual.js deleted file mode 100644 index a5433428e9..0000000000 --- a/test/fixtures/core/opts/ranges-false/actual.js +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index e8ab354792..0000000000 --- a/test/fixtures/core/opts/ranges-false/expected.json +++ /dev/null @@ -1,207 +0,0 @@ -{ - "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 deleted file mode 100644 index a5433428e9..0000000000 --- a/test/fixtures/core/opts/ranges-true/actual.js +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index c5e28e30ea..0000000000 --- a/test/fixtures/core/opts/ranges-true/expected.json +++ /dev/null @@ -1,255 +0,0 @@ -{ - "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 deleted file mode 100644 index 7d108ad39d..0000000000 --- a/test/fixtures/core/opts/ranges-true/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "ranges": true -} diff --git a/test/fixtures/core/regression/2591/expected.json b/test/fixtures/core/regression/2591/expected.json index 71e7684f6c..f7fa0d0dd4 100644 --- a/test/fixtures/core/regression/2591/expected.json +++ b/test/fixtures/core/regression/2591/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "x" + } }, "name": "x" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -119,8 +117,7 @@ "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 b6bfaa93ed..a60c7436d9 100644 --- a/test/fixtures/core/uncategorised/1/expected.json +++ b/test/fixtures/core/uncategorised/1/expected.json @@ -58,7 +58,6 @@ } } } - ], - "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 8b0fba21a9..0af5ba3e9c 100644 --- a/test/fixtures/core/uncategorised/10/expected.json +++ b/test/fixtures/core/uncategorised/10/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/10/expected.lightscript.json b/test/fixtures/core/uncategorised/10/expected.lightscript.json new file mode 100644 index 0000000000..a2a06a1c0e --- /dev/null +++ b/test/fixtures/core/uncategorised/10/expected.lightscript.json @@ -0,0 +1,121 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "ArrayExpression", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 6, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/102/expected.json b/test/fixtures/core/uncategorised/102/expected.json index 1f10ec84f5..043e944588 100644 --- a/test/fixtures/core/uncategorised/102/expected.json +++ b/test/fixtures/core/uncategorised/102/expected.json @@ -69,8 +69,7 @@ "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 fcadc76bf1..7e44569209 100644 --- a/test/fixtures/core/uncategorised/103/expected.json +++ b/test/fixtures/core/uncategorised/103/expected.json @@ -69,8 +69,7 @@ "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 5deda8be2b..caa4a97a89 100644 --- a/test/fixtures/core/uncategorised/104/expected.json +++ b/test/fixtures/core/uncategorised/104/expected.json @@ -69,8 +69,7 @@ "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 d9695a7ebf..a6c7677449 100644 --- a/test/fixtures/core/uncategorised/105/expected.json +++ b/test/fixtures/core/uncategorised/105/expected.json @@ -69,8 +69,7 @@ "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 aaae474d9c..d0ccbfb250 100644 --- a/test/fixtures/core/uncategorised/106/expected.json +++ b/test/fixtures/core/uncategorised/106/expected.json @@ -69,8 +69,7 @@ "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 d866871347..5eafc662cb 100644 --- a/test/fixtures/core/uncategorised/107/expected.json +++ b/test/fixtures/core/uncategorised/107/expected.json @@ -69,8 +69,7 @@ "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 83c8e811c9..a8e37406e8 100644 --- a/test/fixtures/core/uncategorised/108/expected.json +++ b/test/fixtures/core/uncategorised/108/expected.json @@ -69,8 +69,7 @@ "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 8a400eec78..08c175955a 100644 --- a/test/fixtures/core/uncategorised/109/expected.json +++ b/test/fixtures/core/uncategorised/109/expected.json @@ -68,15 +68,13 @@ "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 05a6e4f3d1..6cb8b01d29 100644 --- a/test/fixtures/core/uncategorised/11/expected.json +++ b/test/fixtures/core/uncategorised/11/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/11/expected.lightscript.json b/test/fixtures/core/uncategorised/11/expected.lightscript.json new file mode 100644 index 0000000000..fa9f9d733b --- /dev/null +++ b/test/fixtures/core/uncategorised/11/expected.lightscript.json @@ -0,0 +1,123 @@ +{ + "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 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "ArrayExpression", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "elements": [ + null, + null, + { + "type": "NumericLiteral", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/110/expected.json b/test/fixtures/core/uncategorised/110/expected.json index 05c9a2e459..782d5ea7e4 100644 --- a/test/fixtures/core/uncategorised/110/expected.json +++ b/test/fixtures/core/uncategorised/110/expected.json @@ -68,15 +68,13 @@ "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 42758a1f4e..376081c391 100644 --- a/test/fixtures/core/uncategorised/111/expected.json +++ b/test/fixtures/core/uncategorised/111/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -92,7 +91,6 @@ "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 99a0eebd01..5c476aa6cf 100644 --- a/test/fixtures/core/uncategorised/112/expected.json +++ b/test/fixtures/core/uncategorised/112/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -92,7 +91,6 @@ "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 b7777dc84a..1b87993df9 100644 --- a/test/fixtures/core/uncategorised/113/expected.json +++ b/test/fixtures/core/uncategorised/113/expected.json @@ -96,8 +96,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -115,8 +114,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -125,7 +123,6 @@ "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 ee47879eca..952d418f50 100644 --- a/test/fixtures/core/uncategorised/114/expected.json +++ b/test/fixtures/core/uncategorised/114/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -99,8 +98,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -109,7 +107,6 @@ "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 dc595a854e..7ace856b56 100644 --- a/test/fixtures/core/uncategorised/115/expected.json +++ b/test/fixtures/core/uncategorised/115/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -99,8 +98,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -109,7 +107,6 @@ "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 36a8e9983d..5e0c9c3c30 100644 --- a/test/fixtures/core/uncategorised/116/expected.json +++ b/test/fixtures/core/uncategorised/116/expected.json @@ -96,15 +96,13 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "foo" + } }, "name": "foo" }, "arguments": [], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } }, "property": { @@ -119,8 +117,7 @@ "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 14abd247cf..c20918ced6 100644 --- a/test/fixtures/core/uncategorised/117/expected.json +++ b/test/fixtures/core/uncategorised/117/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -86,8 +85,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -103,15 +101,13 @@ "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 55989c03bf..2a92530d73 100644 --- a/test/fixtures/core/uncategorised/118/expected.json +++ b/test/fixtures/core/uncategorised/118/expected.json @@ -68,13 +68,11 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "foo" + } }, "name": "foo", "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } }, "arguments": [] diff --git a/test/fixtures/core/uncategorised/119/expected.json b/test/fixtures/core/uncategorised/119/expected.json index 85def70954..937e364bb2 100644 --- a/test/fixtures/core/uncategorised/119/expected.json +++ b/test/fixtures/core/uncategorised/119/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "universe" + } }, "name": "universe" }, @@ -85,15 +84,13 @@ "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 b6b96223fa..5e38d61c9f 100644 --- a/test/fixtures/core/uncategorised/12/expected.json +++ b/test/fixtures/core/uncategorised/12/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/12/expected.lightscript.json b/test/fixtures/core/uncategorised/12/expected.lightscript.json new file mode 100644 index 0000000000..cda01d8a7c --- /dev/null +++ b/test/fixtures/core/uncategorised/12/expected.lightscript.json @@ -0,0 +1,161 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "ArrayExpression", + "start": 4, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "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 + }, + { + "type": "NumericLiteral", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + }, + { + "type": "NumericLiteral", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/120/expected.json b/test/fixtures/core/uncategorised/120/expected.json index 9b29fb40a0..9b9c988c91 100644 --- a/test/fixtures/core/uncategorised/120/expected.json +++ b/test/fixtures/core/uncategorised/120/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "universe" + } }, "name": "universe" }, @@ -99,8 +98,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "milkyway" + } }, "name": "milkyway" }, @@ -118,15 +116,13 @@ "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 3a03cde9b1..e160672e6a 100644 --- a/test/fixtures/core/uncategorised/121/expected.json +++ b/test/fixtures/core/uncategorised/121/expected.json @@ -96,8 +96,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "universe" + } }, "name": "universe" }, @@ -113,8 +112,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "milkyway" + } }, "name": "milkyway" }, @@ -132,8 +130,7 @@ "end": { "line": 1, "column": 29 - }, - "identifierName": "solarsystem" + } }, "name": "solarsystem" }, @@ -151,15 +148,13 @@ "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 fcc39e4ecc..269aad8658 100644 --- a/test/fixtures/core/uncategorised/122/expected.json +++ b/test/fixtures/core/uncategorised/122/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "universe" + } }, "name": "universe" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "galaxyName" + } }, "name": "galaxyName" }, @@ -117,8 +115,7 @@ "end": { "line": 1, "column": 37 - }, - "identifierName": "otherUselessName" + } }, "name": "otherUselessName" } @@ -127,7 +124,6 @@ "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 6a6c95e194..fd2ad08336 100644 --- a/test/fixtures/core/uncategorised/123/expected.json +++ b/test/fixtures/core/uncategorised/123/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "universe" + } }, "name": "universe" }, @@ -85,15 +84,13 @@ "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 7dbf01ef02..ff93859240 100644 --- a/test/fixtures/core/uncategorised/124/expected.json +++ b/test/fixtures/core/uncategorised/124/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "universe" + } }, "name": "universe" }, @@ -121,8 +120,7 @@ "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 a732436290..a12ebbfc91 100644 --- a/test/fixtures/core/uncategorised/125/expected.json +++ b/test/fixtures/core/uncategorised/125/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "universe" + } }, "name": "universe" }, @@ -122,8 +121,7 @@ "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 fa67fb5375..a8ceaa9228 100644 --- a/test/fixtures/core/uncategorised/126/expected.json +++ b/test/fixtures/core/uncategorised/126/expected.json @@ -110,8 +110,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "universe" + } }, "name": "universe" }, @@ -150,8 +149,7 @@ "end": { "line": 1, "column": 21 - }, - "identifierName": "galaxies" + } }, "name": "galaxies" }, @@ -232,8 +230,7 @@ "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 edbf36b172..0286b0ea65 100644 --- a/test/fixtures/core/uncategorised/127/expected.json +++ b/test/fixtures/core/uncategorised/127/expected.json @@ -110,8 +110,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "earth" + } }, "name": "earth" }, @@ -127,8 +126,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "asia" + } }, "name": "asia" }, @@ -146,8 +144,7 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "Indonesia" + } }, "name": "Indonesia" }, @@ -165,8 +162,7 @@ "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 92b467b8e9..41129f5624 100644 --- a/test/fixtures/core/uncategorised/128/expected.json +++ b/test/fixtures/core/uncategorised/128/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "universe" + } }, "name": "universe" }, @@ -85,15 +84,13 @@ "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 43038cf090..b31bc7542a 100644 --- a/test/fixtures/core/uncategorised/129/expected.json +++ b/test/fixtures/core/uncategorised/129/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "universe" + } }, "name": "universe" }, @@ -85,15 +84,13 @@ "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 9a01559bd9..838c80a0b4 100644 --- a/test/fixtures/core/uncategorised/13/expected.json +++ b/test/fixtures/core/uncategorised/13/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/13/expected.lightscript.json b/test/fixtures/core/uncategorised/13/expected.lightscript.json new file mode 100644 index 0000000000..4e5305a122 --- /dev/null +++ b/test/fixtures/core/uncategorised/13/expected.lightscript.json @@ -0,0 +1,162 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "ArrayExpression", + "start": 4, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "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 + }, + { + "type": "NumericLiteral", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + }, + null, + { + "type": "NumericLiteral", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/130/expected.json b/test/fixtures/core/uncategorised/130/expected.json index 76fd57dc7a..5bc538a2b9 100644 --- a/test/fixtures/core/uncategorised/130/expected.json +++ b/test/fixtures/core/uncategorised/130/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "universe" + } }, "name": "universe" }, @@ -85,15 +84,13 @@ "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 1e0fe82f7b..a8f3caddc1 100644 --- a/test/fixtures/core/uncategorised/131/expected.json +++ b/test/fixtures/core/uncategorised/131/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "universe" + } }, "name": "universe" }, @@ -85,15 +84,13 @@ "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 6cff980e29..0712715b16 100644 --- a/test/fixtures/core/uncategorised/132/expected.json +++ b/test/fixtures/core/uncategorised/132/expected.json @@ -70,14 +70,12 @@ "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 b402ef1d3f..c4ea608985 100644 --- a/test/fixtures/core/uncategorised/133/expected.json +++ b/test/fixtures/core/uncategorised/133/expected.json @@ -70,14 +70,12 @@ "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 4436502a54..b1909f3acc 100644 --- a/test/fixtures/core/uncategorised/134/expected.json +++ b/test/fixtures/core/uncategorised/134/expected.json @@ -70,14 +70,12 @@ "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 28309341ef..aaebc648e7 100644 --- a/test/fixtures/core/uncategorised/135/expected.json +++ b/test/fixtures/core/uncategorised/135/expected.json @@ -70,14 +70,12 @@ "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 397833c9f4..bb07286fc5 100644 --- a/test/fixtures/core/uncategorised/136/expected.json +++ b/test/fixtures/core/uncategorised/136/expected.json @@ -70,14 +70,12 @@ "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 b27829eedc..5fdbf545d2 100644 --- a/test/fixtures/core/uncategorised/137/expected.json +++ b/test/fixtures/core/uncategorised/137/expected.json @@ -70,14 +70,12 @@ "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 a072a29131..b8e60e420d 100644 --- a/test/fixtures/core/uncategorised/138/expected.json +++ b/test/fixtures/core/uncategorised/138/expected.json @@ -70,17 +70,12 @@ "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 29f62109f3..74d0f506ec 100644 --- a/test/fixtures/core/uncategorised/139/expected.json +++ b/test/fixtures/core/uncategorised/139/expected.json @@ -70,17 +70,12 @@ "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 51f1d84750..ade504173a 100644 --- a/test/fixtures/core/uncategorised/14/expected.json +++ b/test/fixtures/core/uncategorised/14/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "日本語" + } }, "name": "日本語" }, @@ -92,7 +91,6 @@ } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/14/expected.lightscript.json b/test/fixtures/core/uncategorised/14/expected.lightscript.json new file mode 100644 index 0000000000..366ec457e1 --- /dev/null +++ b/test/fixtures/core/uncategorised/14/expected.lightscript.json @@ -0,0 +1,100 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "日本語" + }, + "name": "日本語" + }, + "init": { + "type": "ArrayExpression", + "start": 6, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "elements": [] + } + } + ] + } + ], + "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 164c7de5e1..892974799e 100644 --- a/test/fixtures/core/uncategorised/140/expected.json +++ b/test/fixtures/core/uncategorised/140/expected.json @@ -70,17 +70,12 @@ "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 e24ebd8ae3..f82908bc2b 100644 --- a/test/fixtures/core/uncategorised/141/expected.json +++ b/test/fixtures/core/uncategorised/141/expected.json @@ -70,17 +70,12 @@ "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 f8c24a6e5c..e190c488dd 100644 --- a/test/fixtures/core/uncategorised/142/expected.json +++ b/test/fixtures/core/uncategorised/142/expected.json @@ -70,17 +70,12 @@ "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 7c9d3dd0a4..8451361753 100644 --- a/test/fixtures/core/uncategorised/143/expected.json +++ b/test/fixtures/core/uncategorised/143/expected.json @@ -70,17 +70,12 @@ "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 8c0aefbb8e..62ee624c4c 100644 --- a/test/fixtures/core/uncategorised/144/expected.json +++ b/test/fixtures/core/uncategorised/144/expected.json @@ -70,17 +70,12 @@ "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 d0695f2e20..4b614da625 100644 --- a/test/fixtures/core/uncategorised/145/expected.json +++ b/test/fixtures/core/uncategorised/145/expected.json @@ -70,17 +70,12 @@ "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 900b160cf8..326a3d6c51 100644 --- a/test/fixtures/core/uncategorised/146/expected.json +++ b/test/fixtures/core/uncategorised/146/expected.json @@ -70,17 +70,12 @@ "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/options.lightscript.json b/test/fixtures/core/uncategorised/146/options.lightscript.json new file mode 100644 index 0000000000..919c05ec87 --- /dev/null +++ b/test/fixtures/core/uncategorised/146/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:0)" +} \ 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 47e35ce89d..5db05c771f 100644 --- a/test/fixtures/core/uncategorised/147/expected.json +++ b/test/fixtures/core/uncategorised/147/expected.json @@ -70,17 +70,12 @@ "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 9c3d31a745..776ed71df2 100644 --- a/test/fixtures/core/uncategorised/148/expected.json +++ b/test/fixtures/core/uncategorised/148/expected.json @@ -70,17 +70,12 @@ "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 87f98df461..f5edc45759 100644 --- a/test/fixtures/core/uncategorised/149/expected.json +++ b/test/fixtures/core/uncategorised/149/expected.json @@ -70,17 +70,12 @@ "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 2699a24ddc..81dfb24bee 100644 --- a/test/fixtures/core/uncategorised/15/expected.json +++ b/test/fixtures/core/uncategorised/15/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "T‿" + } }, "name": "T‿" }, @@ -92,7 +91,6 @@ } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/15/expected.lightscript.json b/test/fixtures/core/uncategorised/15/expected.lightscript.json new file mode 100644 index 0000000000..1a8fcbd3ad --- /dev/null +++ b/test/fixtures/core/uncategorised/15/expected.lightscript.json @@ -0,0 +1,100 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "T‿" + }, + "name": "T‿" + }, + "init": { + "type": "ArrayExpression", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "elements": [] + } + } + ] + } + ], + "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 644e2e6689..137dc642bc 100644 --- a/test/fixtures/core/uncategorised/150/expected.json +++ b/test/fixtures/core/uncategorised/150/expected.json @@ -70,17 +70,12 @@ "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 e4544003c4..89022ede9f 100644 --- a/test/fixtures/core/uncategorised/151/expected.json +++ b/test/fixtures/core/uncategorised/151/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 328a727dec..8a860dd890 100644 --- a/test/fixtures/core/uncategorised/152/expected.json +++ b/test/fixtures/core/uncategorised/152/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 ee2eb7b83f..2887a84d0e 100644 --- a/test/fixtures/core/uncategorised/153/expected.json +++ b/test/fixtures/core/uncategorised/153/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 4f4281d12b..951a2c8573 100644 --- a/test/fixtures/core/uncategorised/154/expected.json +++ b/test/fixtures/core/uncategorised/154/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 e715c38ccb..4be8cd12bf 100644 --- a/test/fixtures/core/uncategorised/155/expected.json +++ b/test/fixtures/core/uncategorised/155/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 1d480a3e1a..7da984159e 100644 --- a/test/fixtures/core/uncategorised/156/expected.json +++ b/test/fixtures/core/uncategorised/156/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "y" + } }, "name": "y" } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/156/options.lightscript.json b/test/fixtures/core/uncategorised/156/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/core/uncategorised/156/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 80210cee23..51b1fefd9e 100644 --- a/test/fixtures/core/uncategorised/157/expected.json +++ b/test/fixtures/core/uncategorised/157/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "y" + } }, "name": "y" } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/157/options.lightscript.json b/test/fixtures/core/uncategorised/157/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/core/uncategorised/157/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 5edfbca9c7..c61c63d02d 100644 --- a/test/fixtures/core/uncategorised/158/expected.json +++ b/test/fixtures/core/uncategorised/158/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "y" + } }, "name": "y" } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/158/options.lightscript.json b/test/fixtures/core/uncategorised/158/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/core/uncategorised/158/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 39ed4b1c81..da2300c3ba 100644 --- a/test/fixtures/core/uncategorised/159/expected.json +++ b/test/fixtures/core/uncategorised/159/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 0f87b255d7..5a6cd38868 100644 --- a/test/fixtures/core/uncategorised/16/expected.json +++ b/test/fixtures/core/uncategorised/16/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "T‌" + } }, "name": "T‌" }, @@ -92,7 +91,6 @@ } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/16/expected.lightscript.json b/test/fixtures/core/uncategorised/16/expected.lightscript.json new file mode 100644 index 0000000000..5e77c8829e --- /dev/null +++ b/test/fixtures/core/uncategorised/16/expected.lightscript.json @@ -0,0 +1,100 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "T‌" + }, + "name": "T‌" + }, + "init": { + "type": "ArrayExpression", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "elements": [] + } + } + ] + } + ], + "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 edbe85495e..d036898e8d 100644 --- a/test/fixtures/core/uncategorised/160/expected.json +++ b/test/fixtures/core/uncategorised/160/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 f4fd2421d9..21272df967 100644 --- a/test/fixtures/core/uncategorised/161/expected.json +++ b/test/fixtures/core/uncategorised/161/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 fab9884151..4eba25fa96 100644 --- a/test/fixtures/core/uncategorised/162/expected.json +++ b/test/fixtures/core/uncategorised/162/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 09804a0b7c..179ec5032f 100644 --- a/test/fixtures/core/uncategorised/163/expected.json +++ b/test/fixtures/core/uncategorised/163/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 992fb876e2..8edd71168c 100644 --- a/test/fixtures/core/uncategorised/164/expected.json +++ b/test/fixtures/core/uncategorised/164/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 39e74f7d29..855baa45d7 100644 --- a/test/fixtures/core/uncategorised/165/expected.json +++ b/test/fixtures/core/uncategorised/165/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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 582e04e0dc..c1e5bf26af 100644 --- a/test/fixtures/core/uncategorised/166/expected.json +++ b/test/fixtures/core/uncategorised/166/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "y" + } }, "name": "y" } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/166/expected.lightscript.json b/test/fixtures/core/uncategorised/166/expected.lightscript.json new file mode 100644 index 0000000000..40f289ed6c --- /dev/null +++ b/test/fixtures/core/uncategorised/166/expected.lightscript.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "===", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "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 507ec12519..8eb45e6a10 100644 --- a/test/fixtures/core/uncategorised/167/expected.json +++ b/test/fixtures/core/uncategorised/167/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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.lightscript.json b/test/fixtures/core/uncategorised/167/expected.lightscript.json new file mode 100644 index 0000000000..f49e94403e --- /dev/null +++ b/test/fixtures/core/uncategorised/167/expected.lightscript.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "!==", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "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 aada50d79c..2610f3986a 100644 --- a/test/fixtures/core/uncategorised/168/expected.json +++ b/test/fixtures/core/uncategorised/168/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 a22ceaea6a..ab3b9424ab 100644 --- a/test/fixtures/core/uncategorised/169/expected.json +++ b/test/fixtures/core/uncategorised/169/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 26bc8c13c9..2fbb41c2a6 100644 --- a/test/fixtures/core/uncategorised/17/expected.json +++ b/test/fixtures/core/uncategorised/17/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "T‍" + } }, "name": "T‍" }, @@ -92,7 +91,6 @@ } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/17/expected.lightscript.json b/test/fixtures/core/uncategorised/17/expected.lightscript.json new file mode 100644 index 0000000000..9ea7c787de --- /dev/null +++ b/test/fixtures/core/uncategorised/17/expected.lightscript.json @@ -0,0 +1,100 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "T‍" + }, + "name": "T‍" + }, + "init": { + "type": "ArrayExpression", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "elements": [] + } + } + ] + } + ], + "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 a479164a06..a21f7900f7 100644 --- a/test/fixtures/core/uncategorised/170/expected.json +++ b/test/fixtures/core/uncategorised/170/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/170/options.lightscript.json b/test/fixtures/core/uncategorised/170/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/core/uncategorised/170/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 e22094073c..9ff129d06b 100644 --- a/test/fixtures/core/uncategorised/171/expected.json +++ b/test/fixtures/core/uncategorised/171/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/171/options.lightscript.json b/test/fixtures/core/uncategorised/171/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/core/uncategorised/171/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 7cd159ef07..2c6c6a71aa 100644 --- a/test/fixtures/core/uncategorised/172/expected.json +++ b/test/fixtures/core/uncategorised/172/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/172/options.lightscript.json b/test/fixtures/core/uncategorised/172/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/core/uncategorised/172/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 8d5866efa2..102f5d3d69 100644 --- a/test/fixtures/core/uncategorised/173/expected.json +++ b/test/fixtures/core/uncategorised/173/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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 bcc48922f6..de56597e6a 100644 --- a/test/fixtures/core/uncategorised/174/expected.json +++ b/test/fixtures/core/uncategorised/174/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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 d4924593c3..edc0351968 100644 --- a/test/fixtures/core/uncategorised/175/expected.json +++ b/test/fixtures/core/uncategorised/175/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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 3b53c28f8f..74e0ab65b8 100644 --- a/test/fixtures/core/uncategorised/176/expected.json +++ b/test/fixtures/core/uncategorised/176/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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 3eab6d0286..510073e483 100644 --- a/test/fixtures/core/uncategorised/177/expected.json +++ b/test/fixtures/core/uncategorised/177/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -118,15 +116,13 @@ "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 e929279a89..5e5fca2313 100644 --- a/test/fixtures/core/uncategorised/178/expected.json +++ b/test/fixtures/core/uncategorised/178/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -118,15 +116,13 @@ "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 e0124c982f..dc0ac6b9bf 100644 --- a/test/fixtures/core/uncategorised/179/expected.json +++ b/test/fixtures/core/uncategorised/179/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -118,15 +116,13 @@ "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 3e3a06842f..86195734f1 100644 --- a/test/fixtures/core/uncategorised/18/expected.json +++ b/test/fixtures/core/uncategorised/18/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "ⅣⅡ" + } }, "name": "ⅣⅡ" }, @@ -92,7 +91,6 @@ } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/18/expected.lightscript.json b/test/fixtures/core/uncategorised/18/expected.lightscript.json new file mode 100644 index 0000000000..b8dee83d5f --- /dev/null +++ b/test/fixtures/core/uncategorised/18/expected.lightscript.json @@ -0,0 +1,100 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "ⅣⅡ" + }, + "name": "ⅣⅡ" + }, + "init": { + "type": "ArrayExpression", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "elements": [] + } + } + ] + } + ], + "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 d891a4741e..4beef8dd3d 100644 --- a/test/fixtures/core/uncategorised/180/expected.json +++ b/test/fixtures/core/uncategorised/180/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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 07dfb3ff15..9d743b0d39 100644 --- a/test/fixtures/core/uncategorised/181/expected.json +++ b/test/fixtures/core/uncategorised/181/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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 a251fd60d7..3e5a22a223 100644 --- a/test/fixtures/core/uncategorised/182/expected.json +++ b/test/fixtures/core/uncategorised/182/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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 63a295482e..2174559e10 100644 --- a/test/fixtures/core/uncategorised/183/expected.json +++ b/test/fixtures/core/uncategorised/183/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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 8384ff1b91..92c65557e6 100644 --- a/test/fixtures/core/uncategorised/184/expected.json +++ b/test/fixtures/core/uncategorised/184/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "z" + } }, "name": "z" } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/184/options.lightscript.json b/test/fixtures/core/uncategorised/184/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/core/uncategorised/184/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 11335ea1d3..188c481bfc 100644 --- a/test/fixtures/core/uncategorised/185/expected.json +++ b/test/fixtures/core/uncategorised/185/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "z" + } }, "name": "z" } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/185/options.lightscript.json b/test/fixtures/core/uncategorised/185/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/core/uncategorised/185/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 1cfab365e3..3c6c2f0817 100644 --- a/test/fixtures/core/uncategorised/186/expected.json +++ b/test/fixtures/core/uncategorised/186/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "z" + } }, "name": "z" } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/186/options.lightscript.json b/test/fixtures/core/uncategorised/186/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/core/uncategorised/186/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 e819fc3506..48e47e4198 100644 --- a/test/fixtures/core/uncategorised/187/expected.json +++ b/test/fixtures/core/uncategorised/187/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "z" + } }, "name": "z" } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/187/options.lightscript.json b/test/fixtures/core/uncategorised/187/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/core/uncategorised/187/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 f14d54ace0..0fa66acc0b 100644 --- a/test/fixtures/core/uncategorised/188/expected.json +++ b/test/fixtures/core/uncategorised/188/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "z" + } }, "name": "z" } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/188/options.lightscript.json b/test/fixtures/core/uncategorised/188/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/core/uncategorised/188/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 481b96d976..c8df10d3d8 100644 --- a/test/fixtures/core/uncategorised/189/expected.json +++ b/test/fixtures/core/uncategorised/189/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -118,15 +116,13 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "z" + } }, "name": "z" } } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/189/options.lightscript.json b/test/fixtures/core/uncategorised/189/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/core/uncategorised/189/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 3e3a06842f..86195734f1 100644 --- a/test/fixtures/core/uncategorised/19/expected.json +++ b/test/fixtures/core/uncategorised/19/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "ⅣⅡ" + } }, "name": "ⅣⅡ" }, @@ -92,7 +91,6 @@ } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/19/options.lightscript.json b/test/fixtures/core/uncategorised/19/options.lightscript.json new file mode 100644 index 0000000000..b33d18f79b --- /dev/null +++ b/test/fixtures/core/uncategorised/19/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Only normal whitespace (ascii-32) is allowed. (1:0)" +} \ 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 ff26c296d7..c66d330503 100644 --- a/test/fixtures/core/uncategorised/190/expected.json +++ b/test/fixtures/core/uncategorised/190/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -118,15 +116,13 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "z" + } }, "name": "z" } } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/190/options.lightscript.json b/test/fixtures/core/uncategorised/190/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/core/uncategorised/190/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 3dbff25ba9..43821da431 100644 --- a/test/fixtures/core/uncategorised/191/expected.json +++ b/test/fixtures/core/uncategorised/191/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 b4327fea4a..7b3dce0fdb 100644 --- a/test/fixtures/core/uncategorised/192/expected.json +++ b/test/fixtures/core/uncategorised/192/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 3e277f2fb0..313205c734 100644 --- a/test/fixtures/core/uncategorised/193/expected.json +++ b/test/fixtures/core/uncategorised/193/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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 759ef90eeb..076e9826f5 100644 --- a/test/fixtures/core/uncategorised/194/expected.json +++ b/test/fixtures/core/uncategorised/194/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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 51c2a9cc9c..39a92de27e 100644 --- a/test/fixtures/core/uncategorised/195/expected.json +++ b/test/fixtures/core/uncategorised/195/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -118,15 +116,13 @@ "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 663534b1b4..27399a9c53 100644 --- a/test/fixtures/core/uncategorised/196/expected.json +++ b/test/fixtures/core/uncategorised/196/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -118,15 +116,13 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "z" + } }, "name": "z" } } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/196/options.lightscript.json b/test/fixtures/core/uncategorised/196/options.lightscript.json new file mode 100644 index 0000000000..bceb20dcb9 --- /dev/null +++ b/test/fixtures/core/uncategorised/196/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:7)" +} \ 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 ca2df57148..11b669b4ea 100644 --- a/test/fixtures/core/uncategorised/197/expected.json +++ b/test/fixtures/core/uncategorised/197/expected.json @@ -68,8 +68,7 @@ "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 7ec28110ed..32682fb46d 100644 --- a/test/fixtures/core/uncategorised/198/expected.json +++ b/test/fixtures/core/uncategorised/198/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "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 0f7d218b48..712d4fd6c1 100644 --- a/test/fixtures/core/uncategorised/199/expected.json +++ b/test/fixtures/core/uncategorised/199/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/199/expected.lightscript.json b/test/fixtures/core/uncategorised/199/expected.lightscript.json new file mode 100644 index 0000000000..d9f0b22df8 --- /dev/null +++ b/test/fixtures/core/uncategorised/199/expected.lightscript.json @@ -0,0 +1,104 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "NumericLiteral", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/2/expected.json b/test/fixtures/core/uncategorised/2/expected.json index bdfeb76fd1..9ca3c11021 100644 --- a/test/fixtures/core/uncategorised/2/expected.json +++ b/test/fixtures/core/uncategorised/2/expected.json @@ -58,7 +58,6 @@ } } } - ], - "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 7634638322..fcc6f37efa 100644 --- a/test/fixtures/core/uncategorised/20/expected.json +++ b/test/fixtures/core/uncategorised/20/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -92,7 +91,6 @@ } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/20/expected.lightscript.json b/test/fixtures/core/uncategorised/20/expected.lightscript.json new file mode 100644 index 0000000000..90f5c353ea --- /dev/null +++ b/test/fixtures/core/uncategorised/20/expected.lightscript.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "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": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "properties": [] + } + } + ] + } + ], + "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 08e10f09be..01bf6f0d71 100644 --- a/test/fixtures/core/uncategorised/200/expected.json +++ b/test/fixtures/core/uncategorised/200/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "eval" + } }, "name": "eval" }, diff --git a/test/fixtures/core/uncategorised/200/expected.lightscript.json b/test/fixtures/core/uncategorised/200/expected.lightscript.json new file mode 100644 index 0000000000..132f31bfdd --- /dev/null +++ b/test/fixtures/core/uncategorised/200/expected.lightscript.json @@ -0,0 +1,104 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "init": { + "type": "NumericLiteral", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/201/expected.json b/test/fixtures/core/uncategorised/201/expected.json index 588a74e579..691796ca2f 100644 --- a/test/fixtures/core/uncategorised/201/expected.json +++ b/test/fixtures/core/uncategorised/201/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "arguments" + } }, "name": "arguments" }, diff --git a/test/fixtures/core/uncategorised/201/expected.lightscript.json b/test/fixtures/core/uncategorised/201/expected.lightscript.json new file mode 100644 index 0000000000..cbbba15b1c --- /dev/null +++ b/test/fixtures/core/uncategorised/201/expected.lightscript.json @@ -0,0 +1,104 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + "init": { + "type": "NumericLiteral", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/202/expected.json b/test/fixtures/core/uncategorised/202/expected.json index 3a99ca3eb6..4a01dfd629 100644 --- a/test/fixtures/core/uncategorised/202/expected.json +++ b/test/fixtures/core/uncategorised/202/expected.json @@ -69,8 +69,7 @@ "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 ec473b3207..1382a9b238 100644 --- a/test/fixtures/core/uncategorised/203/expected.json +++ b/test/fixtures/core/uncategorised/203/expected.json @@ -69,8 +69,7 @@ "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 812fb07cc1..e2a6524e00 100644 --- a/test/fixtures/core/uncategorised/204/expected.json +++ b/test/fixtures/core/uncategorised/204/expected.json @@ -69,8 +69,7 @@ "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 4d6b358971..3fb8e6a109 100644 --- a/test/fixtures/core/uncategorised/205/expected.json +++ b/test/fixtures/core/uncategorised/205/expected.json @@ -69,8 +69,7 @@ "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 26b624a7d4..8b681331b0 100644 --- a/test/fixtures/core/uncategorised/206/expected.json +++ b/test/fixtures/core/uncategorised/206/expected.json @@ -69,8 +69,7 @@ "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 441330c54c..827b99dbe0 100644 --- a/test/fixtures/core/uncategorised/207/expected.json +++ b/test/fixtures/core/uncategorised/207/expected.json @@ -69,8 +69,7 @@ "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 1d99f52655..d27aeea8cc 100644 --- a/test/fixtures/core/uncategorised/208/expected.json +++ b/test/fixtures/core/uncategorised/208/expected.json @@ -69,8 +69,7 @@ "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 10665e9e41..ea2c4e00ff 100644 --- a/test/fixtures/core/uncategorised/209/expected.json +++ b/test/fixtures/core/uncategorised/209/expected.json @@ -69,8 +69,7 @@ "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 53768b945f..ed3af08e0b 100644 --- a/test/fixtures/core/uncategorised/21/expected.json +++ b/test/fixtures/core/uncategorised/21/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -92,7 +91,6 @@ } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/21/expected.lightscript.json b/test/fixtures/core/uncategorised/21/expected.lightscript.json new file mode 100644 index 0000000000..c5667d51ee --- /dev/null +++ b/test/fixtures/core/uncategorised/21/expected.lightscript.json @@ -0,0 +1,100 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "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": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "properties": [] + } + } + ] + } + ], + "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 ffab2697d0..12db3bd78f 100644 --- a/test/fixtures/core/uncategorised/210/expected.json +++ b/test/fixtures/core/uncategorised/210/expected.json @@ -69,8 +69,7 @@ "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 a4a9088d93..2b34e74553 100644 --- a/test/fixtures/core/uncategorised/211/expected.json +++ b/test/fixtures/core/uncategorised/211/expected.json @@ -69,8 +69,7 @@ "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 173d746401..ef886d2c97 100644 --- a/test/fixtures/core/uncategorised/212/expected.json +++ b/test/fixtures/core/uncategorised/212/expected.json @@ -69,8 +69,7 @@ "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 ca5a5fb0eb..5d5053da91 100644 --- a/test/fixtures/core/uncategorised/213/expected.json +++ b/test/fixtures/core/uncategorised/213/expected.json @@ -69,16 +69,13 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "foo" + } }, "name": "foo" } } - ], - "directives": [] + ] } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/213/expected.lightscript.json b/test/fixtures/core/uncategorised/213/expected.lightscript.json new file mode 100644 index 0000000000..39aa99c7f0 --- /dev/null +++ b/test/fixtures/core/uncategorised/213/expected.lightscript.json @@ -0,0 +1,121 @@ +{ + "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": "ObjectExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "value": { + "type": "Identifier", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "extra": { + "shorthand": true + } + } + ] + } + } + ], + "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 b271f0a04c..eec6775871 100644 --- a/test/fixtures/core/uncategorised/214/expected.json +++ b/test/fixtures/core/uncategorised/214/expected.json @@ -83,8 +83,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "doThis" + } }, "name": "doThis" }, @@ -131,18 +130,15 @@ "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/214/options.lightscript.json b/test/fixtures/core/uncategorised/214/options.lightscript.json new file mode 100644 index 0000000000..779ebfe878 --- /dev/null +++ b/test/fixtures/core/uncategorised/214/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected { (1:10)" +} \ 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 d209b58703..5792211240 100644 --- a/test/fixtures/core/uncategorised/215/expected.json +++ b/test/fixtures/core/uncategorised/215/expected.json @@ -42,10 +42,8 @@ "column": 2 } }, - "body": [], - "directives": [] + "body": [] } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/215/expected.lightscript.json b/test/fixtures/core/uncategorised/215/expected.lightscript.json new file mode 100644 index 0000000000..a44549f455 --- /dev/null +++ b/test/fixtures/core/uncategorised/215/expected.lightscript.json @@ -0,0 +1,65 @@ +{ + "type": "File", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "properties": [] + } + } + ], + "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 2dc156600a..ec2dadfcf0 100644 --- a/test/fixtures/core/uncategorised/216/expected.json +++ b/test/fixtures/core/uncategorised/216/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -79,7 +78,6 @@ ], "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 efb47e7394..4ed5077fe0 100644 --- a/test/fixtures/core/uncategorised/217/expected.json +++ b/test/fixtures/core/uncategorised/217/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -102,8 +101,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -112,7 +110,6 @@ ], "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 8515e2fd31..fceb7088d9 100644 --- a/test/fixtures/core/uncategorised/218/expected.json +++ b/test/fixtures/core/uncategorised/218/expected.json @@ -69,8 +69,7 @@ "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 c43470cfea..0937c1b68d 100644 --- a/test/fixtures/core/uncategorised/219/expected.json +++ b/test/fixtures/core/uncategorised/219/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "eval" + } }, "name": "eval" }, @@ -121,8 +120,7 @@ "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 bc44d62df8..87f4913585 100644 --- a/test/fixtures/core/uncategorised/22/expected.json +++ b/test/fixtures/core/uncategorised/22/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "answer" + } }, "name": "answer" }, diff --git a/test/fixtures/core/uncategorised/22/expected.lightscript.json b/test/fixtures/core/uncategorised/22/expected.lightscript.json new file mode 100644 index 0000000000..65a29b6f89 --- /dev/null +++ b/test/fixtures/core/uncategorised/22/expected.lightscript.json @@ -0,0 +1,156 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "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": 18, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 6, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "answer" + }, + "name": "answer" + }, + "value": { + "type": "NumericLiteral", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/220/expected.json b/test/fixtures/core/uncategorised/220/expected.json index 880833c662..4c14f501ea 100644 --- a/test/fixtures/core/uncategorised/220/expected.json +++ b/test/fixtures/core/uncategorised/220/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -121,8 +120,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -173,8 +171,7 @@ "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 3b4811d947..17a5559327 100644 --- a/test/fixtures/core/uncategorised/221/expected.json +++ b/test/fixtures/core/uncategorised/221/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "implements" + } }, "name": "implements" }, @@ -102,8 +101,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "interface" + } }, "name": "interface" }, @@ -135,8 +133,7 @@ "end": { "line": 1, "column": 34 - }, - "identifierName": "package" + } }, "name": "package" }, @@ -145,7 +142,6 @@ ], "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 1afee34c9e..8744560249 100644 --- a/test/fixtures/core/uncategorised/222/expected.json +++ b/test/fixtures/core/uncategorised/222/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "private" + } }, "name": "private" }, @@ -102,8 +101,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "protected" + } }, "name": "protected" }, @@ -135,8 +133,7 @@ "end": { "line": 1, "column": 30 - }, - "identifierName": "public" + } }, "name": "public" }, @@ -168,8 +165,7 @@ "end": { "line": 1, "column": 38 - }, - "identifierName": "static" + } }, "name": "static" }, @@ -178,7 +174,6 @@ ], "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 e48902c158..d76894f1aa 100644 --- a/test/fixtures/core/uncategorised/223/expected.json +++ b/test/fixtures/core/uncategorised/223/expected.json @@ -43,7 +43,6 @@ } } } - ], - "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 7d660bdda7..470ad995ab 100644 --- a/test/fixtures/core/uncategorised/224/expected.json +++ b/test/fixtures/core/uncategorised/224/expected.json @@ -54,13 +54,11 @@ "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 a8a40d3c2b..a1f0e67018 100644 --- a/test/fixtures/core/uncategorised/225/expected.json +++ b/test/fixtures/core/uncategorised/225/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,15 +85,13 @@ "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 f144d42ff4..afc7d69fc3 100644 --- a/test/fixtures/core/uncategorised/226/expected.json +++ b/test/fixtures/core/uncategorised/226/expected.json @@ -54,13 +54,11 @@ "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 69f5646954..2f6ae75852 100644 --- a/test/fixtures/core/uncategorised/227/expected.json +++ b/test/fixtures/core/uncategorised/227/expected.json @@ -54,13 +54,11 @@ "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 18f37a7b65..61f0887961 100644 --- a/test/fixtures/core/uncategorised/228/expected.json +++ b/test/fixtures/core/uncategorised/228/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "morning" + } }, "name": "morning" }, @@ -99,8 +98,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "goodMorning" + } }, "name": "goodMorning" }, @@ -109,7 +107,6 @@ }, "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 38198e3d25..640c5691c2 100644 --- a/test/fixtures/core/uncategorised/229/expected.json +++ b/test/fixtures/core/uncategorised/229/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "morning" + } }, "name": "morning" }, @@ -90,7 +89,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -110,8 +108,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 13 + "parenthesized": true } } }, diff --git a/test/fixtures/core/uncategorised/23/expected.json b/test/fixtures/core/uncategorised/23/expected.json index 8373348ba7..fa3c158b8a 100644 --- a/test/fixtures/core/uncategorised/23/expected.json +++ b/test/fixtures/core/uncategorised/23/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "if" + } }, "name": "if" }, diff --git a/test/fixtures/core/uncategorised/23/expected.lightscript.json b/test/fixtures/core/uncategorised/23/expected.lightscript.json new file mode 100644 index 0000000000..d215c5621f --- /dev/null +++ b/test/fixtures/core/uncategorised/23/expected.lightscript.json @@ -0,0 +1,156 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "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": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "if" + }, + "name": "if" + }, + "value": { + "type": "NumericLiteral", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/230/expected.json b/test/fixtures/core/uncategorised/230/expected.json index 492f0ac62c..bf2044c42a 100644 --- a/test/fixtures/core/uncategorised/230/expected.json +++ b/test/fixtures/core/uncategorised/230/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "morning" + } }, "name": "morning" }, @@ -100,8 +99,7 @@ "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 453c4e700d..720f53798d 100644 --- a/test/fixtures/core/uncategorised/231/expected.json +++ b/test/fixtures/core/uncategorised/231/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "morning" + } }, "name": "morning" }, @@ -99,8 +98,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "goodMorning" + } }, "name": "goodMorning" }, @@ -147,8 +145,7 @@ "end": { "line": 1, "column": 40 - }, - "identifierName": "goodDay" + } }, "name": "goodDay" }, @@ -156,7 +153,6 @@ } } } - ], - "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 6b99345c09..52f64a4d6b 100644 --- a/test/fixtures/core/uncategorised/232/expected.json +++ b/test/fixtures/core/uncategorised/232/expected.json @@ -82,8 +82,7 @@ "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 a131703fce..04998adb58 100644 --- a/test/fixtures/core/uncategorised/233/expected.json +++ b/test/fixtures/core/uncategorised/233/expected.json @@ -82,8 +82,7 @@ "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 e2f50113d3..9814bc6039 100644 --- a/test/fixtures/core/uncategorised/234/expected.json +++ b/test/fixtures/core/uncategorised/234/expected.json @@ -99,8 +99,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "x" + } }, "name": "x" } @@ -148,8 +147,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "y" + } }, "name": "y" } @@ -184,8 +182,7 @@ "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 new file mode 100644 index 0000000000..78b21c5363 --- /dev/null +++ b/test/fixtures/core/uncategorised/235/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected , (1:5)" +} \ 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 1cd371f080..b154f386f7 100644 --- a/test/fixtures/core/uncategorised/236/expected.json +++ b/test/fixtures/core/uncategorised/236/expected.json @@ -98,8 +98,7 @@ "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 f08d3a9485..8ca1322823 100644 --- a/test/fixtures/core/uncategorised/237/expected.json +++ b/test/fixtures/core/uncategorised/237/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -152,8 +151,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "x" + } }, "name": "x" } @@ -201,8 +199,7 @@ "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 5f4998d8a0..9474ed02f5 100644 --- a/test/fixtures/core/uncategorised/238/expected.json +++ b/test/fixtures/core/uncategorised/238/expected.json @@ -61,7 +61,6 @@ } } } - ], - "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 67a281d20e..ee4511c5df 100644 --- a/test/fixtures/core/uncategorised/239/expected.json +++ b/test/fixtures/core/uncategorised/239/expected.json @@ -59,11 +59,9 @@ "column": 9 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "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 723c8db2a5..e332b892cc 100644 --- a/test/fixtures/core/uncategorised/24/expected.json +++ b/test/fixtures/core/uncategorised/24/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "true" + } }, "name": "true" }, diff --git a/test/fixtures/core/uncategorised/24/expected.lightscript.json b/test/fixtures/core/uncategorised/24/expected.lightscript.json new file mode 100644 index 0000000000..328ba92ada --- /dev/null +++ b/test/fixtures/core/uncategorised/24/expected.lightscript.json @@ -0,0 +1,156 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "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": 16, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "true" + }, + "name": "true" + }, + "value": { + "type": "NumericLiteral", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/240/expected.json b/test/fixtures/core/uncategorised/240/expected.json index ac885ace49..96e6163073 100644 --- a/test/fixtures/core/uncategorised/240/expected.json +++ b/test/fixtures/core/uncategorised/240/expected.json @@ -69,8 +69,7 @@ "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 424fedd8b8..06e23e5726 100644 --- a/test/fixtures/core/uncategorised/241/expected.json +++ b/test/fixtures/core/uncategorised/241/expected.json @@ -83,8 +83,7 @@ "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 f701a8cc20..9703da41dc 100644 --- a/test/fixtures/core/uncategorised/242/expected.json +++ b/test/fixtures/core/uncategorised/242/expected.json @@ -83,8 +83,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -135,8 +134,7 @@ "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 019c93da93..799bca6bd8 100644 --- a/test/fixtures/core/uncategorised/243/expected.json +++ b/test/fixtures/core/uncategorised/243/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -121,8 +120,7 @@ "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 d44ae9616d..bab630bd14 100644 --- a/test/fixtures/core/uncategorised/244/expected.json +++ b/test/fixtures/core/uncategorised/244/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -121,8 +120,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -176,8 +174,7 @@ "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 bd932cf468..88e0fa1c9f 100644 --- a/test/fixtures/core/uncategorised/245/expected.json +++ b/test/fixtures/core/uncategorised/245/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -121,8 +120,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -176,8 +174,7 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "x" + } }, "name": "x" } @@ -222,8 +219,7 @@ "end": { "line": 1, "column": 31 - }, - "identifierName": "process" + } }, "name": "process" }, @@ -240,8 +236,7 @@ "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 9c7cdebe0f..f95b2f15a7 100644 --- a/test/fixtures/core/uncategorised/246/expected.json +++ b/test/fixtures/core/uncategorised/246/expected.json @@ -42,7 +42,6 @@ "column": 26 } }, - "await": false, "left": { "type": "Identifier", "start": 4, @@ -55,8 +54,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -72,8 +70,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "list" + } }, "name": "list" }, @@ -117,8 +114,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "process" + } }, "name": "process" }, @@ -135,8 +131,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "x" + } }, "name": "x" } @@ -144,7 +139,6 @@ } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/246/options.lightscript.json b/test/fixtures/core/uncategorised/246/options.lightscript.json new file mode 100644 index 0000000000..4fa5b8e28b --- /dev/null +++ b/test/fixtures/core/uncategorised/246/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "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. (1:4)" +} diff --git a/test/fixtures/core/uncategorised/247/expected.json b/test/fixtures/core/uncategorised/247/expected.json index 4a3a0ecfda..50d29b5d32 100644 --- a/test/fixtures/core/uncategorised/247/expected.json +++ b/test/fixtures/core/uncategorised/247/expected.json @@ -42,7 +42,6 @@ "column": 31 } }, - "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -84,8 +83,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -106,8 +104,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "list" + } }, "name": "list" }, @@ -151,8 +148,7 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "process" + } }, "name": "process" }, @@ -169,8 +165,7 @@ "end": { "line": 1, "column": 29 - }, - "identifierName": "x" + } }, "name": "x" } @@ -178,7 +173,6 @@ } } } - ], - "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 1245b12ad3..dbe5f3ef0b 100644 --- a/test/fixtures/core/uncategorised/25/expected.json +++ b/test/fixtures/core/uncategorised/25/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "false" + } }, "name": "false" }, diff --git a/test/fixtures/core/uncategorised/25/expected.lightscript.json b/test/fixtures/core/uncategorised/25/expected.lightscript.json new file mode 100644 index 0000000000..716b9a0207 --- /dev/null +++ b/test/fixtures/core/uncategorised/25/expected.lightscript.json @@ -0,0 +1,156 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "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": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "false" + }, + "name": "false" + }, + "value": { + "type": "NumericLiteral", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/252/expected.json b/test/fixtures/core/uncategorised/252/expected.json index 7b69d3e398..3d3611769c 100644 --- a/test/fixtures/core/uncategorised/252/expected.json +++ b/test/fixtures/core/uncategorised/252/expected.json @@ -113,8 +113,7 @@ "end": { "line": 1, "column": 34 - }, - "identifierName": "done" + } }, "name": "done" } @@ -135,8 +134,7 @@ "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 73a3847e0b..e2eede95cf 100644 --- a/test/fixtures/core/uncategorised/253/expected.json +++ b/test/fixtures/core/uncategorised/253/expected.json @@ -113,8 +113,7 @@ "end": { "line": 1, "column": 34 - }, - "identifierName": "done" + } }, "name": "done" } @@ -135,8 +134,7 @@ "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 b46b8cecc6..930203bdfe 100644 --- a/test/fixtures/core/uncategorised/255/expected.json +++ b/test/fixtures/core/uncategorised/255/expected.json @@ -113,8 +113,7 @@ "end": { "line": 1, "column": 31 - }, - "identifierName": "done" + } }, "name": "done" } @@ -135,8 +134,7 @@ "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 75ce4af774..207d4cf4c5 100644 --- a/test/fixtures/core/uncategorised/256/expected.json +++ b/test/fixtures/core/uncategorised/256/expected.json @@ -113,8 +113,7 @@ "end": { "line": 1, "column": 31 - }, - "identifierName": "done" + } }, "name": "done" } @@ -135,8 +134,7 @@ "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 31e7290e5c..9e26dfeeb6 100644 --- a/test/fixtures/core/uncategorised/257/expected.json +++ b/test/fixtures/core/uncategorised/257/expected.json @@ -1,179 +1 @@ -{ - "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 +{} \ 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 b806d609b1..9e26dfeeb6 100644 --- a/test/fixtures/core/uncategorised/258/expected.json +++ b/test/fixtures/core/uncategorised/258/expected.json @@ -1,211 +1 @@ -{ - "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 +{} \ 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 fe9666a99e..3811851cf2 100644 --- a/test/fixtures/core/uncategorised/259/expected.json +++ b/test/fixtures/core/uncategorised/259/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -96,8 +95,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/core/uncategorised/26/expected.json b/test/fixtures/core/uncategorised/26/expected.json index 17acbb207e..88e109fbf9 100644 --- a/test/fixtures/core/uncategorised/26/expected.json +++ b/test/fixtures/core/uncategorised/26/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "null" + } }, "name": "null" }, diff --git a/test/fixtures/core/uncategorised/26/expected.lightscript.json b/test/fixtures/core/uncategorised/26/expected.lightscript.json new file mode 100644 index 0000000000..aaf51683e8 --- /dev/null +++ b/test/fixtures/core/uncategorised/26/expected.lightscript.json @@ -0,0 +1,156 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "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": 16, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "null" + }, + "name": "null" + }, + "value": { + "type": "NumericLiteral", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/260/expected.json b/test/fixtures/core/uncategorised/260/expected.json index 1f4ff8a16a..cfc30f8e34 100644 --- a/test/fixtures/core/uncategorised/260/expected.json +++ b/test/fixtures/core/uncategorised/260/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -96,8 +95,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/core/uncategorised/261/expected.json b/test/fixtures/core/uncategorised/261/expected.json index 05b71f8cff..7e253235fc 100644 --- a/test/fixtures/core/uncategorised/261/expected.json +++ b/test/fixtures/core/uncategorised/261/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -102,8 +101,7 @@ "end": { "line": 1, "column": 21 - }, - "identifierName": "x" + } }, "name": "x" } @@ -112,8 +110,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/core/uncategorised/262/expected.json b/test/fixtures/core/uncategorised/262/expected.json index bd73928291..d4f71c39ad 100644 --- a/test/fixtures/core/uncategorised/262/expected.json +++ b/test/fixtures/core/uncategorised/262/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -116,8 +115,7 @@ "end": { "line": 1, "column": 21 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -134,8 +132,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "y" + } }, "name": "y" } @@ -145,8 +142,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/core/uncategorised/263/expected.json b/test/fixtures/core/uncategorised/263/expected.json index 88cf010a10..9e26dfeeb6 100644 --- a/test/fixtures/core/uncategorised/263/expected.json +++ b/test/fixtures/core/uncategorised/263/expected.json @@ -1,167 +1 @@ -{ - "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 +{} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/264/expected.json b/test/fixtures/core/uncategorised/264/expected.json index 43dab0dc7a..9e26dfeeb6 100644 --- a/test/fixtures/core/uncategorised/264/expected.json +++ b/test/fixtures/core/uncategorised/264/expected.json @@ -1,167 +1 @@ -{ - "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 +{} \ 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 c1ca938f16..f4e3da9d15 100644 --- a/test/fixtures/core/uncategorised/265/expected.json +++ b/test/fixtures/core/uncategorised/265/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -117,15 +115,13 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "bar" + } }, "name": "bar" } } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/265/expected.lightscript.json b/test/fixtures/core/uncategorised/265/expected.lightscript.json new file mode 100644 index 0000000000..cf49c292d6 --- /dev/null +++ b/test/fixtures/core/uncategorised/265/expected.lightscript.json @@ -0,0 +1,133 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WithStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "object": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "x" + }, + "name": "x" + }, + "body": { + "type": "VariableDeclaration", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 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 bca8b9d7da..9e895a7f45 100644 --- a/test/fixtures/core/uncategorised/266/expected.json +++ b/test/fixtures/core/uncategorised/266/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -117,15 +115,13 @@ "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.lightscript.json b/test/fixtures/core/uncategorised/266/expected.lightscript.json new file mode 100644 index 0000000000..184633b878 --- /dev/null +++ b/test/fixtures/core/uncategorised/266/expected.lightscript.json @@ -0,0 +1,133 @@ +{ + "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": "WithStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "object": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "x" + }, + "name": "x" + }, + "body": { + "type": "VariableDeclaration", + "start": 9, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 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 e44e902aa7..d9e30cca90 100644 --- a/test/fixtures/core/uncategorised/267/expected.json +++ b/test/fixtures/core/uncategorised/267/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -115,8 +114,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -132,18 +130,15 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "bar" + } }, "name": "bar" } } } - ], - "directives": [] + ] } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/267/expected.lightscript.json b/test/fixtures/core/uncategorised/267/expected.lightscript.json new file mode 100644 index 0000000000..d39409dcc3 --- /dev/null +++ b/test/fixtures/core/uncategorised/267/expected.lightscript.json @@ -0,0 +1,154 @@ +{ + "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": "WithStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "object": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "x" + }, + "name": "x" + }, + "body": { + "type": "BlockStatement", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 11, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 11, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "bar" + }, + "name": "bar" + } + } + ] + } + ], + "directives": [], + "extra": { + "curly": true + } + } + } + ], + "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 b77f94e94a..e48fd0f035 100644 --- a/test/fixtures/core/uncategorised/268/expected.json +++ b/test/fixtures/core/uncategorised/268/expected.json @@ -54,14 +54,12 @@ "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 3c3a42b257..54b7c12792 100644 --- a/test/fixtures/core/uncategorised/269/expected.json +++ b/test/fixtures/core/uncategorised/269/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "answer" + } }, "name": "answer" }, @@ -115,8 +114,7 @@ "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 df92c26e13..b292e26154 100644 --- a/test/fixtures/core/uncategorised/27/expected.json +++ b/test/fixtures/core/uncategorised/27/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/27/expected.lightscript.json b/test/fixtures/core/uncategorised/27/expected.lightscript.json new file mode 100644 index 0000000000..f778ec5218 --- /dev/null +++ b/test/fixtures/core/uncategorised/27/expected.lightscript.json @@ -0,0 +1,159 @@ +{ + "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 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "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": 20, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 6, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "StringLiteral", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": "answer", + "raw": "\"answer\"" + }, + "value": "answer" + }, + "value": { + "type": "NumericLiteral", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/270/expected.json b/test/fixtures/core/uncategorised/270/expected.json index f474c77e7d..ce967090f0 100644 --- a/test/fixtures/core/uncategorised/270/expected.json +++ b/test/fixtures/core/uncategorised/270/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "answer" + } }, "name": "answer" }, @@ -115,8 +114,7 @@ "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 0edfa7e1e6..ea2201a00e 100644 --- a/test/fixtures/core/uncategorised/271/expected.json +++ b/test/fixtures/core/uncategorised/271/expected.json @@ -85,8 +85,7 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "start" + } }, "name": "start" } @@ -104,13 +103,11 @@ "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 0c49d0e8f9..5157602658 100644 --- a/test/fixtures/core/uncategorised/272/expected.json +++ b/test/fixtures/core/uncategorised/272/expected.json @@ -98,8 +98,7 @@ "end": { "line": 1, "column": 31 - }, - "identifierName": "start" + } }, "name": "start" } @@ -117,8 +116,7 @@ "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 a5a7fc11ac..0e9f3c0da0 100644 --- a/test/fixtures/core/uncategorised/273/expected.json +++ b/test/fixtures/core/uncategorised/273/expected.json @@ -54,13 +54,11 @@ "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 fbc9ab8952..91f3d0ffa7 100644 --- a/test/fixtures/core/uncategorised/274/expected.json +++ b/test/fixtures/core/uncategorised/274/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 e0ef904785..1586888a8b 100644 --- a/test/fixtures/core/uncategorised/275/expected.json +++ b/test/fixtures/core/uncategorised/275/expected.json @@ -86,8 +86,7 @@ "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 e5753c7cc2..49a3324324 100644 --- a/test/fixtures/core/uncategorised/276/expected.json +++ b/test/fixtures/core/uncategorised/276/expected.json @@ -56,8 +56,7 @@ "column": 7 } }, - "body": [], - "directives": [] + "body": [] }, "handler": { "type": "CatchClause", @@ -85,8 +84,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "e" + } }, "name": "e" }, @@ -104,14 +102,12 @@ "column": 21 } }, - "body": [], - "directives": [] + "body": [] } }, "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 7a8e08f5e0..4fa8f999b5 100644 --- a/test/fixtures/core/uncategorised/277/expected.json +++ b/test/fixtures/core/uncategorised/277/expected.json @@ -56,8 +56,7 @@ "column": 7 } }, - "body": [], - "directives": [] + "body": [] }, "handler": { "type": "CatchClause", @@ -85,8 +84,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "eval" + } }, "name": "eval" }, @@ -104,14 +102,12 @@ "column": 24 } }, - "body": [], - "directives": [] + "body": [] } }, "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 a6eb4ec45b..42cc2e8bf7 100644 --- a/test/fixtures/core/uncategorised/278/expected.json +++ b/test/fixtures/core/uncategorised/278/expected.json @@ -56,8 +56,7 @@ "column": 7 } }, - "body": [], - "directives": [] + "body": [] }, "handler": { "type": "CatchClause", @@ -85,8 +84,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "arguments" + } }, "name": "arguments" }, @@ -104,14 +102,12 @@ "column": 29 } }, - "body": [], - "directives": [] + "body": [] } }, "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 2e17e596c6..bb353db32f 100644 --- a/test/fixtures/core/uncategorised/279/expected.json +++ b/test/fixtures/core/uncategorised/279/expected.json @@ -56,8 +56,7 @@ "column": 7 } }, - "body": [], - "directives": [] + "body": [] }, "handler": { "type": "CatchClause", @@ -85,8 +84,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "e" + } }, "name": "e" }, @@ -145,8 +143,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "say" + } }, "name": "say" }, @@ -163,22 +160,19 @@ "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 c3ee0acf14..a2566571e4 100644 --- a/test/fixtures/core/uncategorised/28/expected.json +++ b/test/fixtures/core/uncategorised/28/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -173,8 +171,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "x" + } }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/28/expected.lightscript.json b/test/fixtures/core/uncategorised/28/expected.lightscript.json new file mode 100644 index 0000000000..4df49fd010 --- /dev/null +++ b/test/fixtures/core/uncategorised/28/expected.lightscript.json @@ -0,0 +1,211 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "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": 18, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "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": "x" + }, + "name": "x" + }, + "value": { + "type": "NumericLiteral", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "ObjectProperty", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "x" + }, + "name": "x" + }, + "value": { + "type": "NumericLiteral", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/280/expected.json b/test/fixtures/core/uncategorised/280/expected.json index 4f92072de7..ca8f6bd080 100644 --- a/test/fixtures/core/uncategorised/280/expected.json +++ b/test/fixtures/core/uncategorised/280/expected.json @@ -56,8 +56,7 @@ "column": 7 } }, - "body": [], - "directives": [] + "body": [] }, "handler": null, "guardedHandlers": [], @@ -116,8 +115,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "cleanup" + } }, "name": "cleanup" }, @@ -134,19 +132,16 @@ "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 6024793dbd..291705c18b 100644 --- a/test/fixtures/core/uncategorised/281/expected.json +++ b/test/fixtures/core/uncategorised/281/expected.json @@ -97,16 +97,14 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "doThat" + } }, "name": "doThat" }, "arguments": [] } } - ], - "directives": [] + ] }, "handler": { "type": "CatchClause", @@ -134,8 +132,7 @@ "end": { "line": 1, "column": 26 - }, - "identifierName": "e" + } }, "name": "e" }, @@ -194,8 +191,7 @@ "end": { "line": 1, "column": 33 - }, - "identifierName": "say" + } }, "name": "say" }, @@ -212,22 +208,19 @@ "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 c73f720c72..9dd799f3ee 100644 --- a/test/fixtures/core/uncategorised/282/expected.json +++ b/test/fixtures/core/uncategorised/282/expected.json @@ -97,16 +97,14 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "doThat" + } }, "name": "doThat" }, "arguments": [] } } - ], - "directives": [] + ] }, "handler": { "type": "CatchClause", @@ -134,8 +132,7 @@ "end": { "line": 1, "column": 26 - }, - "identifierName": "e" + } }, "name": "e" }, @@ -194,8 +191,7 @@ "end": { "line": 1, "column": 33 - }, - "identifierName": "say" + } }, "name": "say" }, @@ -212,16 +208,14 @@ "end": { "line": 1, "column": 35 - }, - "identifierName": "e" + } }, "name": "e" } ] } } - ], - "directives": [] + ] } }, "guardedHandlers": [], @@ -280,8 +274,7 @@ "end": { "line": 1, "column": 56 - }, - "identifierName": "cleanup" + } }, "name": "cleanup" }, @@ -298,19 +291,16 @@ "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 c70dc07eb5..bf36100cfe 100644 --- a/test/fixtures/core/uncategorised/283/expected.json +++ b/test/fixtures/core/uncategorised/283/expected.json @@ -43,7 +43,6 @@ } } } - ], - "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 89d8911652..8de460e887 100644 --- a/test/fixtures/core/uncategorised/284/expected.json +++ b/test/fixtures/core/uncategorised/284/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "hello" + } }, "name": "hello" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -118,19 +116,16 @@ "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 01acb188ed..d8bcde0844 100644 --- a/test/fixtures/core/uncategorised/285/expected.json +++ b/test/fixtures/core/uncategorised/285/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "eval" + } }, "name": "eval" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -77,11 +75,9 @@ "column": 19 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "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 93d4d923bf..086e1ef65b 100644 --- a/test/fixtures/core/uncategorised/286/expected.json +++ b/test/fixtures/core/uncategorised/286/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "arguments" + } }, "name": "arguments" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -77,11 +75,9 @@ "column": 24 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "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 05cce3b8f3..c081c978ea 100644 --- a/test/fixtures/core/uncategorised/287/expected.json +++ b/test/fixtures/core/uncategorised/287/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "test" + } }, "name": "test" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "t" + } }, "name": "t" }, @@ -92,8 +89,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "t" + } }, "name": "t" } @@ -112,11 +108,9 @@ "column": 23 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "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 4b79120694..a9c517251e 100644 --- a/test/fixtures/core/uncategorised/288/expected.json +++ b/test/fixtures/core/uncategorised/288/expected.json @@ -68,14 +68,12 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "test" + } }, "name": "test" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -89,8 +87,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "t" + } }, "name": "t" }, @@ -106,8 +103,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "t" + } }, "name": "t" } @@ -130,8 +126,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/core/uncategorised/289/expected.json b/test/fixtures/core/uncategorised/289/expected.json index 1b08145eb9..5924cefb02 100644 --- a/test/fixtures/core/uncategorised/289/expected.json +++ b/test/fixtures/core/uncategorised/289/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "eval" + } }, "name": "eval" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -104,14 +102,12 @@ "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 057f1cf08d..1462403c0d 100644 --- a/test/fixtures/core/uncategorised/29/expected.json +++ b/test/fixtures/core/uncategorised/29/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "width" + } }, "name": "width" }, @@ -127,7 +125,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -170,8 +167,7 @@ "end": { "line": 1, "column": 34 - }, - "identifierName": "m_width" + } }, "name": "m_width" } diff --git a/test/fixtures/core/uncategorised/29/expected.lightscript.json b/test/fixtures/core/uncategorised/29/expected.lightscript.json new file mode 100644 index 0000000000..65dac437a8 --- /dev/null +++ b/test/fixtures/core/uncategorised/29/expected.lightscript.json @@ -0,0 +1,195 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "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": 38, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "width" + }, + "name": "width" + }, + "kind": "get", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 20, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "argument": { + "type": "Identifier", + "start": 27, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 34 + }, + "identifierName": "m_width" + }, + "name": "m_width" + } + } + ], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/290/expected.json b/test/fixtures/core/uncategorised/290/expected.json index a5373f5a79..3d1b214f48 100644 --- a/test/fixtures/core/uncategorised/290/expected.json +++ b/test/fixtures/core/uncategorised/290/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "hello" + } }, "name": "hello" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "a" + } }, "name": "a" } @@ -136,19 +133,16 @@ "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 cdfeb7b019..8bc6714852 100644 --- a/test/fixtures/core/uncategorised/291/expected.json +++ b/test/fixtures/core/uncategorised/291/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "hello" + } }, "name": "hello" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -92,8 +89,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "b" + } }, "name": "b" } @@ -153,19 +149,16 @@ "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 2a928b39d2..70213bc4ee 100644 --- a/test/fixtures/core/uncategorised/292/expected.json +++ b/test/fixtures/core/uncategorised/292/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "hello" + } }, "name": "hello" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "RestElement", @@ -89,8 +87,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "rest" + } }, "name": "rest" } @@ -110,11 +107,9 @@ "column": 27 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "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 ed3d6655c1..73f53f2cd1 100644 --- a/test/fixtures/core/uncategorised/293/expected.json +++ b/test/fixtures/core/uncategorised/293/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "hello" + } }, "name": "hello" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -106,8 +103,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "rest" + } }, "name": "rest" } @@ -127,11 +123,9 @@ "column": 30 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "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 7df304a88a..6483debdcd 100644 --- a/test/fixtures/core/uncategorised/294/expected.json +++ b/test/fixtures/core/uncategorised/294/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "hi" + } }, "name": "hi" }, @@ -91,7 +90,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -148,23 +146,20 @@ "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 53520cfe7f..3aee1a20fd 100644 --- a/test/fixtures/core/uncategorised/295/expected.json +++ b/test/fixtures/core/uncategorised/295/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "hi" + } }, "name": "hi" }, @@ -91,7 +90,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "RestElement", @@ -119,8 +117,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "r" + } }, "name": "r" } @@ -181,23 +178,20 @@ "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 ce5cb42288..b4b770ef03 100644 --- a/test/fixtures/core/uncategorised/296/expected.json +++ b/test/fixtures/core/uncategorised/296/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "hi" + } }, "name": "hi" }, @@ -100,14 +99,12 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "eval" + } }, "name": "eval" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -123,15 +120,13 @@ "column": 28 } }, - "body": [], - "directives": [] + "body": [] } } } ], "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 2b88f0d953..75abd7b81c 100644 --- a/test/fixtures/core/uncategorised/297/expected.json +++ b/test/fixtures/core/uncategorised/297/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "hi" + } }, "name": "hi" }, @@ -100,14 +99,12 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "arguments" + } }, "name": "arguments" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -123,15 +120,13 @@ "column": 33 } }, - "body": [], - "directives": [] + "body": [] } } } ], "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 f3e529622f..71c7365c51 100644 --- a/test/fixtures/core/uncategorised/298/expected.json +++ b/test/fixtures/core/uncategorised/298/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "hello" + } }, "name": "hello" }, @@ -100,14 +99,12 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "hi" + } }, "name": "hi" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -164,23 +161,20 @@ "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 f79af90cc1..fac0f4b32c 100644 --- a/test/fixtures/core/uncategorised/299/expected.json +++ b/test/fixtures/core/uncategorised/299/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -79,8 +78,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/core/uncategorised/30/expected.json b/test/fixtures/core/uncategorised/30/expected.json index b2a8bf8168..7694f2fd33 100644 --- a/test/fixtures/core/uncategorised/30/expected.json +++ b/test/fixtures/core/uncategorised/30/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "undef" + } }, "name": "undef" }, @@ -127,7 +125,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/core/uncategorised/30/expected.lightscript.json b/test/fixtures/core/uncategorised/30/expected.lightscript.json new file mode 100644 index 0000000000..ac702ac507 --- /dev/null +++ b/test/fixtures/core/uncategorised/30/expected.lightscript.json @@ -0,0 +1,162 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "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": 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": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "undef" + }, + "name": "undef" + }, + "kind": "get", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/300/expected.json b/test/fixtures/core/uncategorised/300/expected.json index 855b9666cc..bab8079535 100644 --- a/test/fixtures/core/uncategorised/300/expected.json +++ b/test/fixtures/core/uncategorised/300/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "x" + } }, "name": "x" } @@ -117,20 +116,14 @@ "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/300/options.lightscript.json b/test/fixtures/core/uncategorised/300/options.lightscript.json new file mode 100644 index 0000000000..0361d7c7d2 --- /dev/null +++ b/test/fixtures/core/uncategorised/300/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (2:0)" +} \ 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 f531eb96b4..e7aa5f92ff 100644 --- a/test/fixtures/core/uncategorised/301/expected.json +++ b/test/fixtures/core/uncategorised/301/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "x" + } }, "name": "x" } @@ -117,20 +116,14 @@ "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/options.lightscript.json b/test/fixtures/core/uncategorised/301/options.lightscript.json new file mode 100644 index 0000000000..0361d7c7d2 --- /dev/null +++ b/test/fixtures/core/uncategorised/301/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (2:0)" +} \ 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 3840e25325..b80d317427 100644 --- a/test/fixtures/core/uncategorised/302/expected.json +++ b/test/fixtures/core/uncategorised/302/expected.json @@ -69,8 +69,7 @@ "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 3881fa499d..0c955c4730 100644 --- a/test/fixtures/core/uncategorised/303/expected.json +++ b/test/fixtures/core/uncategorised/303/expected.json @@ -84,8 +84,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -136,8 +135,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -191,8 +189,7 @@ "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 new file mode 100644 index 0000000000..5a91ab8f84 --- /dev/null +++ b/test/fixtures/core/uncategorised/303/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected , (1:6)" +} \ 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 84e28f3bd9..1c02f6ef66 100644 --- a/test/fixtures/core/uncategorised/304/expected.json +++ b/test/fixtures/core/uncategorised/304/expected.json @@ -115,8 +115,7 @@ "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 fd7f41293b..675fe056a3 100644 --- a/test/fixtures/core/uncategorised/305/expected.json +++ b/test/fixtures/core/uncategorised/305/expected.json @@ -134,8 +134,7 @@ "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 820264c6d1..dfef6b5c50 100644 --- a/test/fixtures/core/uncategorised/306/expected.json +++ b/test/fixtures/core/uncategorised/306/expected.json @@ -134,8 +134,7 @@ "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 560762d177..2b8d9fef9f 100644 --- a/test/fixtures/core/uncategorised/307/expected.json +++ b/test/fixtures/core/uncategorised/307/expected.json @@ -115,8 +115,7 @@ "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 b5794cac3a..21c911cbbc 100644 --- a/test/fixtures/core/uncategorised/308/expected.json +++ b/test/fixtures/core/uncategorised/308/expected.json @@ -134,8 +134,7 @@ "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 62b72404df..55ac6a29a8 100644 --- a/test/fixtures/core/uncategorised/309/expected.json +++ b/test/fixtures/core/uncategorised/309/expected.json @@ -134,8 +134,7 @@ "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 5b18965177..966b9f90ca 100644 --- a/test/fixtures/core/uncategorised/31/expected.json +++ b/test/fixtures/core/uncategorised/31/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "if" + } }, "name": "if" }, @@ -127,7 +125,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/core/uncategorised/31/expected.lightscript.json b/test/fixtures/core/uncategorised/31/expected.lightscript.json new file mode 100644 index 0000000000..599bc2e6ee --- /dev/null +++ b/test/fixtures/core/uncategorised/31/expected.lightscript.json @@ -0,0 +1,162 @@ +{ + "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 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "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": 19, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "if" + }, + "name": "if" + }, + "kind": "get", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/310/expected.json b/test/fixtures/core/uncategorised/310/expected.json index e5fa9ec260..7d4c8d5bb6 100644 --- a/test/fixtures/core/uncategorised/310/expected.json +++ b/test/fixtures/core/uncategorised/310/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -118,8 +117,7 @@ "end": { "line": 2, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" } @@ -128,8 +126,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/core/uncategorised/311/expected.json b/test/fixtures/core/uncategorised/311/expected.json index 3b50dd8b73..f0cf8a4b53 100644 --- a/test/fixtures/core/uncategorised/311/expected.json +++ b/test/fixtures/core/uncategorised/311/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -137,8 +136,7 @@ "end": { "line": 2, "column": 1 - }, - "identifierName": "x" + } }, "name": "x", "leadingComments": null @@ -166,8 +164,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/core/uncategorised/312/expected.json b/test/fixtures/core/uncategorised/312/expected.json index 6ae21e8aa6..975bfdf605 100644 --- a/test/fixtures/core/uncategorised/312/expected.json +++ b/test/fixtures/core/uncategorised/312/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -137,8 +136,7 @@ "end": { "line": 2, "column": 11 - }, - "identifierName": "x" + } }, "name": "x", "leadingComments": null @@ -166,8 +164,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/core/uncategorised/313/expected.json b/test/fixtures/core/uncategorised/313/expected.json index d1fb3ac429..d55af430c7 100644 --- a/test/fixtures/core/uncategorised/313/expected.json +++ b/test/fixtures/core/uncategorised/313/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "error" + } }, "name": "error" } @@ -101,16 +100,13 @@ "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 new file mode 100644 index 0000000000..930a14478b --- /dev/null +++ b/test/fixtures/core/uncategorised/313/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected , (1:8)" +} \ 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 55562ff024..1340d70360 100644 --- a/test/fixtures/core/uncategorised/314/expected.json +++ b/test/fixtures/core/uncategorised/314/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "error" + } }, "name": "error", "leadingComments": null, @@ -121,8 +120,7 @@ "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 new file mode 100644 index 0000000000..930a14478b --- /dev/null +++ b/test/fixtures/core/uncategorised/314/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected , (1:8)" +} \ 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 acb5183a09..fcf481f414 100644 --- a/test/fixtures/core/uncategorised/315/expected.json +++ b/test/fixtures/core/uncategorised/315/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "error" + } }, "name": "error", "leadingComments": null, @@ -121,8 +120,7 @@ "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 new file mode 100644 index 0000000000..930a14478b --- /dev/null +++ b/test/fixtures/core/uncategorised/315/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected , (1:8)" +} \ 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 1df1b8a0fb..10130f3578 100644 --- a/test/fixtures/core/uncategorised/316/expected.json +++ b/test/fixtures/core/uncategorised/316/expected.json @@ -27,7 +27,6 @@ } }, "sourceType": "script", - "body": [], - "directives": [] + "body": [] } } \ 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 75aac067bd..96b5884573 100644 --- a/test/fixtures/core/uncategorised/317/expected.json +++ b/test/fixtures/core/uncategorised/317/expected.json @@ -98,8 +98,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "foo" + } }, "name": "foo" } @@ -118,8 +117,7 @@ "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 be25c9494b..1fda36e9a7 100644 --- a/test/fixtures/core/uncategorised/318/expected.json +++ b/test/fixtures/core/uncategorised/318/expected.json @@ -73,7 +73,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -166,8 +165,7 @@ }, "arguments": [], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/core/uncategorised/319/expected.json b/test/fixtures/core/uncategorised/319/expected.json index 712b896d4b..9cb04403f1 100644 --- a/test/fixtures/core/uncategorised/319/expected.json +++ b/test/fixtures/core/uncategorised/319/expected.json @@ -102,8 +102,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "toString" + } }, "name": "toString" }, diff --git a/test/fixtures/core/uncategorised/319/options.lightscript.json b/test/fixtures/core/uncategorised/319/options.lightscript.json new file mode 100644 index 0000000000..6133e0c611 --- /dev/null +++ b/test/fixtures/core/uncategorised/319/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Numbers with a decimal must end in a number (eg; `1.0`) in LightScript. (1:3)" +} diff --git a/test/fixtures/core/uncategorised/32/expected.json b/test/fixtures/core/uncategorised/32/expected.json index 5ed0dee78e..0ab2082d42 100644 --- a/test/fixtures/core/uncategorised/32/expected.json +++ b/test/fixtures/core/uncategorised/32/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "true" + } }, "name": "true" }, @@ -127,7 +125,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/core/uncategorised/32/expected.lightscript.json b/test/fixtures/core/uncategorised/32/expected.lightscript.json new file mode 100644 index 0000000000..bac8031077 --- /dev/null +++ b/test/fixtures/core/uncategorised/32/expected.lightscript.json @@ -0,0 +1,162 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "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": 21, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "true" + }, + "name": "true" + }, + "kind": "get", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/320/options.lightscript.json b/test/fixtures/core/uncategorised/320/options.lightscript.json new file mode 100644 index 0000000000..6133e0c611 --- /dev/null +++ b/test/fixtures/core/uncategorised/320/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Numbers with a decimal must end in a number (eg; `1.0`) in LightScript. (1:3)" +} diff --git a/test/fixtures/core/uncategorised/321/expected.json b/test/fixtures/core/uncategorised/321/expected.json index 93c8373aec..0fbaec1ec3 100644 --- a/test/fixtures/core/uncategorised/321/expected.json +++ b/test/fixtures/core/uncategorised/321/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "a" + } }, "name": "a" } @@ -86,13 +85,11 @@ "end": { "line": 2, "column": 1 - }, - "identifierName": "b" + } }, "name": "b" } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/321/options.lightscript.json b/test/fixtures/core/uncategorised/321/options.lightscript.json new file mode 100644 index 0000000000..53f2009381 --- /dev/null +++ b/test/fixtures/core/uncategorised/321/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Only '\\n' and '\\r\\n' are legal newlines in lightscript. (1:0)" +} \ 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 1fd3d16a4b..662a04aa6e 100644 --- a/test/fixtures/core/uncategorised/323/expected.json +++ b/test/fixtures/core/uncategorised/323/expected.json @@ -89,8 +89,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "foo" + } }, "name": "foo" } @@ -156,8 +155,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" } diff --git a/test/fixtures/core/uncategorised/324/options.lightscript.json b/test/fixtures/core/uncategorised/324/options.lightscript.json new file mode 100644 index 0000000000..51c089448e --- /dev/null +++ b/test/fixtures/core/uncategorised/324/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Regex literals cannot start with a space in lightscript; try '\\s' or '\\ ' instead. (1:6)" +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/325/expected.json b/test/fixtures/core/uncategorised/325/expected.json index 2d2a386aeb..60a0422da0 100644 --- a/test/fixtures/core/uncategorised/325/expected.json +++ b/test/fixtures/core/uncategorised/325/expected.json @@ -54,13 +54,11 @@ "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 818768b81f..ddb03e0cb1 100644 --- a/test/fixtures/core/uncategorised/326/expected.json +++ b/test/fixtures/core/uncategorised/326/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -99,8 +98,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "in" + } }, "name": "in" }, @@ -119,14 +117,12 @@ "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 faafaf7932..9e26dfeeb6 100644 --- a/test/fixtures/core/uncategorised/327/expected.json +++ b/test/fixtures/core/uncategorised/327/expected.json @@ -1,101 +1 @@ -{ - "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 +{} \ 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 fdb2242bec..9e26dfeeb6 100644 --- a/test/fixtures/core/uncategorised/328/expected.json +++ b/test/fixtures/core/uncategorised/328/expected.json @@ -1,102 +1 @@ -{ - "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 +{} \ 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 a8b5a5435c..9e26dfeeb6 100644 --- a/test/fixtures/core/uncategorised/329/expected.json +++ b/test/fixtures/core/uncategorised/329/expected.json @@ -1,121 +1 @@ -{ - "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 +{} \ 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 a0a3fa12fd..ccc78d04a7 100644 --- a/test/fixtures/core/uncategorised/33/expected.json +++ b/test/fixtures/core/uncategorised/33/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "false" + } }, "name": "false" }, @@ -127,7 +125,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/core/uncategorised/33/expected.lightscript.json b/test/fixtures/core/uncategorised/33/expected.lightscript.json new file mode 100644 index 0000000000..847bd4f0bf --- /dev/null +++ b/test/fixtures/core/uncategorised/33/expected.lightscript.json @@ -0,0 +1,162 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "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": 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": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "false" + }, + "name": "false" + }, + "kind": "get", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/330/expected.json b/test/fixtures/core/uncategorised/330/expected.json index 0f4d9b4428..9e26dfeeb6 100644 --- a/test/fixtures/core/uncategorised/330/expected.json +++ b/test/fixtures/core/uncategorised/330/expected.json @@ -1,86 +1 @@ -{ - "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 +{} \ 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 e5046ea184..9e26dfeeb6 100644 --- a/test/fixtures/core/uncategorised/331/expected.json +++ b/test/fixtures/core/uncategorised/331/expected.json @@ -1,135 +1 @@ -{ - "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 +{} \ 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 aace18f78b..9e26dfeeb6 100644 --- a/test/fixtures/core/uncategorised/332/expected.json +++ b/test/fixtures/core/uncategorised/332/expected.json @@ -1,104 +1 @@ -{ - "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 +{} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/332/options.lightscript.json b/test/fixtures/core/uncategorised/332/options.lightscript.json new file mode 100644 index 0000000000..04b967a2ee --- /dev/null +++ b/test/fixtures/core/uncategorised/332/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:1)" +} \ 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 f8c581d82e..9e26dfeeb6 100644 --- a/test/fixtures/core/uncategorised/333/expected.json +++ b/test/fixtures/core/uncategorised/333/expected.json @@ -1,104 +1 @@ -{ - "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 +{} \ 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 abfa6cae3c..9e26dfeeb6 100644 --- a/test/fixtures/core/uncategorised/334/expected.json +++ b/test/fixtures/core/uncategorised/334/expected.json @@ -1,107 +1 @@ -{ - "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 +{} \ 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 7ecc877cd8..9e26dfeeb6 100644 --- a/test/fixtures/core/uncategorised/335/expected.json +++ b/test/fixtures/core/uncategorised/335/expected.json @@ -1,210 +1 @@ -{ - "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 +{} \ 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 63ecb1d5de..9e26dfeeb6 100644 --- a/test/fixtures/core/uncategorised/336/expected.json +++ b/test/fixtures/core/uncategorised/336/expected.json @@ -1,139 +1 @@ -{ - "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 +{} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/336/options.lightscript.json b/test/fixtures/core/uncategorised/336/options.lightscript.json new file mode 100644 index 0000000000..9f7910a413 --- /dev/null +++ b/test/fixtures/core/uncategorised/336/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:4)" +} \ 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 202e7d6c52..9e26dfeeb6 100644 --- a/test/fixtures/core/uncategorised/337/expected.json +++ b/test/fixtures/core/uncategorised/337/expected.json @@ -1,157 +1 @@ -{ - "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 +{} \ 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 fe0875e9a4..9e26dfeeb6 100644 --- a/test/fixtures/core/uncategorised/338/expected.json +++ b/test/fixtures/core/uncategorised/338/expected.json @@ -1,160 +1 @@ -{ - "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 +{} \ 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 f219c75e64..9e26dfeeb6 100644 --- a/test/fixtures/core/uncategorised/339/expected.json +++ b/test/fixtures/core/uncategorised/339/expected.json @@ -1,139 +1 @@ -{ - "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 +{} \ 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 5ccdf34d1e..c8ef1380a8 100644 --- a/test/fixtures/core/uncategorised/34/expected.json +++ b/test/fixtures/core/uncategorised/34/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "null" + } }, "name": "null" }, @@ -127,7 +125,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/core/uncategorised/34/expected.lightscript.json b/test/fixtures/core/uncategorised/34/expected.lightscript.json new file mode 100644 index 0000000000..f621fd3da3 --- /dev/null +++ b/test/fixtures/core/uncategorised/34/expected.lightscript.json @@ -0,0 +1,162 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "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": 21, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "null" + }, + "name": "null" + }, + "kind": "get", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/340/expected.json b/test/fixtures/core/uncategorised/340/expected.json index 7ccbc843ad..9e26dfeeb6 100644 --- a/test/fixtures/core/uncategorised/340/expected.json +++ b/test/fixtures/core/uncategorised/340/expected.json @@ -1,151 +1 @@ -{ - "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 +{} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/341/options.lightscript.json b/test/fixtures/core/uncategorised/341/options.lightscript.json new file mode 100644 index 0000000000..3044657f4d --- /dev/null +++ b/test/fixtures/core/uncategorised/341/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected ; (1:2)" +} \ 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 4501a541b5..418f936ff6 100644 --- a/test/fixtures/core/uncategorised/342/expected.json +++ b/test/fixtures/core/uncategorised/342/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "foo" + } }, "name": "foo", "leadingComments": null, @@ -105,8 +104,7 @@ "end": { "line": 2, "column": 4 - }, - "identifierName": "baz" + } }, "name": "baz", "leadingComments": [ diff --git a/test/fixtures/core/uncategorised/342/expected.lightscript.json b/test/fixtures/core/uncategorised/342/expected.lightscript.json new file mode 100644 index 0000000000..835f51a012 --- /dev/null +++ b/test/fixtures/core/uncategorised/342/expected.lightscript.json @@ -0,0 +1,176 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "foo" + }, + "name": "foo", + "leadingComments": null, + "trailingComments": null + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": "bar", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + } + } + ] + }, + { + "type": "ExpressionStatement", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "expression": { + "type": "UnaryExpression", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "operator": "+", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 4 + }, + "identifierName": "baz" + }, + "name": "baz", + "leadingComments": null + }, + "extra": { + "parenthesizedArgument": false + }, + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": "bar", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + } + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": "bar", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + } + } + ] +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/343/expected.json b/test/fixtures/core/uncategorised/343/expected.json index 16b19e6130..e3a56910e4 100644 --- a/test/fixtures/core/uncategorised/343/expected.json +++ b/test/fixtures/core/uncategorised/343/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -116,8 +115,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } diff --git a/test/fixtures/core/uncategorised/343/expected.lightscript.json b/test/fixtures/core/uncategorised/343/expected.lightscript.json new file mode 100644 index 0000000000..e367f3d69b --- /dev/null +++ b/test/fixtures/core/uncategorised/343/expected.lightscript.json @@ -0,0 +1,190 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "BinaryExpression", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "left": { + "type": "UpdateExpression", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "--", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + } + }, + "operator": ">", + "right": { + "type": "NumericLiteral", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + } + } + ], + "trailingComments": [ + { + "type": "CommentLine", + "value": " nothing", + "start": 13, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 12 + } + } + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " nothing", + "start": 13, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 12 + } + } + } + ] +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/344/expected.json b/test/fixtures/core/uncategorised/344/expected.json index 7bf2896043..827aebf2db 100644 --- a/test/fixtures/core/uncategorised/344/expected.json +++ b/test/fixtures/core/uncategorised/344/expected.json @@ -82,8 +82,7 @@ "end": { "line": 2, "column": 6 - }, - "identifierName": "object" + } }, "name": "object" }, @@ -99,8 +98,7 @@ "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 36830ddf37..6a4504c896 100644 --- a/test/fixtures/core/uncategorised/35/expected.json +++ b/test/fixtures/core/uncategorised/35/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -130,7 +129,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/core/uncategorised/35/expected.lightscript.json b/test/fixtures/core/uncategorised/35/expected.lightscript.json new file mode 100644 index 0000000000..f730a3550c --- /dev/null +++ b/test/fixtures/core/uncategorised/35/expected.lightscript.json @@ -0,0 +1,165 @@ +{ + "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 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "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": 24, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "StringLiteral", + "start": 10, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": "undef", + "raw": "\"undef\"" + }, + "value": "undef" + }, + "kind": "get", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/355/expected.json b/test/fixtures/core/uncategorised/355/expected.json deleted file mode 100644 index 08de8c762b..0000000000 --- a/test/fixtures/core/uncategorised/355/expected.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - }, - "expression": { - "type": "NumericLiteral", - "start": 0, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - }, - "extra": { - "rawValue": 9, - "raw": "09" - }, - "value": 9 - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/355/options.json b/test/fixtures/core/uncategorised/355/options.json new file mode 100644 index 0000000000..cf3086295c --- /dev/null +++ b/test/fixtures/core/uncategorised/355/options.json @@ -0,0 +1,3 @@ +{ + "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 deleted file mode 100644 index 6d04954399..0000000000 --- a/test/fixtures/core/uncategorised/356/expected.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "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 new file mode 100644 index 0000000000..cf3086295c --- /dev/null +++ b/test/fixtures/core/uncategorised/356/options.json @@ -0,0 +1,3 @@ +{ + "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 dfbd42e884..80eca1b9e4 100644 --- a/test/fixtures/core/uncategorised/36/expected.json +++ b/test/fixtures/core/uncategorised/36/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -130,7 +129,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/core/uncategorised/36/expected.lightscript.json b/test/fixtures/core/uncategorised/36/expected.lightscript.json new file mode 100644 index 0000000000..b569b59adc --- /dev/null +++ b/test/fixtures/core/uncategorised/36/expected.lightscript.json @@ -0,0 +1,165 @@ +{ + "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 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "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": 19, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "NumericLiteral", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + }, + "kind": "get", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/37/expected.json b/test/fixtures/core/uncategorised/37/expected.json index 821787cfd7..ad75991dc1 100644 --- a/test/fixtures/core/uncategorised/37/expected.json +++ b/test/fixtures/core/uncategorised/37/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "width" + } }, "name": "width" }, @@ -127,7 +125,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -141,8 +138,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "w" + } }, "name": "w" } @@ -203,8 +199,7 @@ "end": { "line": 1, "column": 28 - }, - "identifierName": "m_width" + } }, "name": "m_width" }, @@ -220,8 +215,7 @@ "end": { "line": 1, "column": 32 - }, - "identifierName": "w" + } }, "name": "w" } diff --git a/test/fixtures/core/uncategorised/37/expected.lightscript.json b/test/fixtures/core/uncategorised/37/expected.lightscript.json new file mode 100644 index 0000000000..181f9363ed --- /dev/null +++ b/test/fixtures/core/uncategorised/37/expected.lightscript.json @@ -0,0 +1,248 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "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": 36, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "width" + }, + "name": "width" + }, + "kind": "set", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "w" + }, + "name": "w" + } + ], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 21, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 21, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 21, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 28 + }, + "identifierName": "m_width" + }, + "name": "m_width" + }, + "init": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 32 + }, + "identifierName": "w" + }, + "name": "w" + } + } + ] + } + ], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/374/options.lightscript.json b/test/fixtures/core/uncategorised/374/options.lightscript.json new file mode 100644 index 0000000000..002b66a77a --- /dev/null +++ b/test/fixtures/core/uncategorised/374/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "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. (1:10)" +} diff --git a/test/fixtures/core/uncategorised/38/expected.json b/test/fixtures/core/uncategorised/38/expected.json index 8b525fb80c..e290b184de 100644 --- a/test/fixtures/core/uncategorised/38/expected.json +++ b/test/fixtures/core/uncategorised/38/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "if" + } }, "name": "if" }, @@ -127,7 +125,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -141,8 +138,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "w" + } }, "name": "w" } @@ -203,8 +199,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "m_if" + } }, "name": "m_if" }, @@ -220,8 +215,7 @@ "end": { "line": 1, "column": 26 - }, - "identifierName": "w" + } }, "name": "w" } diff --git a/test/fixtures/core/uncategorised/38/expected.lightscript.json b/test/fixtures/core/uncategorised/38/expected.lightscript.json new file mode 100644 index 0000000000..999d338c61 --- /dev/null +++ b/test/fixtures/core/uncategorised/38/expected.lightscript.json @@ -0,0 +1,248 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "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": 30, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "if" + }, + "name": "if" + }, + "kind": "set", + "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": "w" + }, + "name": "w" + } + ], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 18, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 18, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": { + "type": "Identifier", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "m_if" + }, + "name": "m_if" + }, + "init": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + }, + "identifierName": "w" + }, + "name": "w" + } + } + ] + } + ], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/388/options.lightscript.json b/test/fixtures/core/uncategorised/388/options.lightscript.json new file mode 100644 index 0000000000..1dccc09c72 --- /dev/null +++ b/test/fixtures/core/uncategorised/388/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected ( (1:8)" +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/389/options.lightscript.json b/test/fixtures/core/uncategorised/389/options.lightscript.json new file mode 100644 index 0000000000..1dccc09c72 --- /dev/null +++ b/test/fixtures/core/uncategorised/389/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected ( (1:8)" +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/39/expected.json b/test/fixtures/core/uncategorised/39/expected.json index 6d693c7fb0..60ca06a14b 100644 --- a/test/fixtures/core/uncategorised/39/expected.json +++ b/test/fixtures/core/uncategorised/39/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "true" + } }, "name": "true" }, @@ -127,7 +125,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -141,8 +138,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "w" + } }, "name": "w" } @@ -203,8 +199,7 @@ "end": { "line": 1, "column": 26 - }, - "identifierName": "m_true" + } }, "name": "m_true" }, @@ -220,8 +215,7 @@ "end": { "line": 1, "column": 30 - }, - "identifierName": "w" + } }, "name": "w" } diff --git a/test/fixtures/core/uncategorised/39/expected.lightscript.json b/test/fixtures/core/uncategorised/39/expected.lightscript.json new file mode 100644 index 0000000000..2a4210a274 --- /dev/null +++ b/test/fixtures/core/uncategorised/39/expected.lightscript.json @@ -0,0 +1,248 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "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": 34, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "true" + }, + "name": "true" + }, + "kind": "set", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "w" + }, + "name": "w" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": { + "type": "Identifier", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 26 + }, + "identifierName": "m_true" + }, + "name": "m_true" + }, + "init": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "w" + }, + "name": "w" + } + } + ] + } + ], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/390/options.lightscript.json b/test/fixtures/core/uncategorised/390/options.lightscript.json new file mode 100644 index 0000000000..358068a16a --- /dev/null +++ b/test/fixtures/core/uncategorised/390/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:12)" +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/40/expected.json b/test/fixtures/core/uncategorised/40/expected.json index 226cdce5f6..2e92b355f6 100644 --- a/test/fixtures/core/uncategorised/40/expected.json +++ b/test/fixtures/core/uncategorised/40/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "false" + } }, "name": "false" }, @@ -127,7 +125,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -141,8 +138,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "w" + } }, "name": "w" } @@ -203,8 +199,7 @@ "end": { "line": 1, "column": 28 - }, - "identifierName": "m_false" + } }, "name": "m_false" }, @@ -220,8 +215,7 @@ "end": { "line": 1, "column": 32 - }, - "identifierName": "w" + } }, "name": "w" } diff --git a/test/fixtures/core/uncategorised/40/expected.lightscript.json b/test/fixtures/core/uncategorised/40/expected.lightscript.json new file mode 100644 index 0000000000..570daf3443 --- /dev/null +++ b/test/fixtures/core/uncategorised/40/expected.lightscript.json @@ -0,0 +1,248 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "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": 36, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "false" + }, + "name": "false" + }, + "kind": "set", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "w" + }, + "name": "w" + } + ], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 21, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 21, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 21, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 28 + }, + "identifierName": "m_false" + }, + "name": "m_false" + }, + "init": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 32 + }, + "identifierName": "w" + }, + "name": "w" + } + } + ] + } + ], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/406/options.lightscript.json b/test/fixtures/core/uncategorised/406/options.lightscript.json new file mode 100644 index 0000000000..e68fbb6aec --- /dev/null +++ b/test/fixtures/core/uncategorised/406/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/41/expected.json b/test/fixtures/core/uncategorised/41/expected.json index 6fb466dce4..af9300d188 100644 --- a/test/fixtures/core/uncategorised/41/expected.json +++ b/test/fixtures/core/uncategorised/41/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "null" + } }, "name": "null" }, @@ -127,7 +125,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -141,8 +138,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "w" + } }, "name": "w" } @@ -203,8 +199,7 @@ "end": { "line": 1, "column": 26 - }, - "identifierName": "m_null" + } }, "name": "m_null" }, @@ -220,8 +215,7 @@ "end": { "line": 1, "column": 30 - }, - "identifierName": "w" + } }, "name": "w" } diff --git a/test/fixtures/core/uncategorised/41/expected.lightscript.json b/test/fixtures/core/uncategorised/41/expected.lightscript.json new file mode 100644 index 0000000000..8a455e1454 --- /dev/null +++ b/test/fixtures/core/uncategorised/41/expected.lightscript.json @@ -0,0 +1,248 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "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": 34, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "null" + }, + "name": "null" + }, + "kind": "set", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "w" + }, + "name": "w" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": { + "type": "Identifier", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 26 + }, + "identifierName": "m_null" + }, + "name": "m_null" + }, + "init": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "w" + }, + "name": "w" + } + } + ] + } + ], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/417/options.lightscript.json b/test/fixtures/core/uncategorised/417/options.lightscript.json new file mode 100644 index 0000000000..34583d5638 --- /dev/null +++ b/test/fixtures/core/uncategorised/417/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "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. (1:9)" +} diff --git a/test/fixtures/core/uncategorised/418/options.lightscript.json b/test/fixtures/core/uncategorised/418/options.lightscript.json new file mode 100644 index 0000000000..1bc50d2d19 --- /dev/null +++ b/test/fixtures/core/uncategorised/418/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "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. (1:6)" +} diff --git a/test/fixtures/core/uncategorised/42/expected.json b/test/fixtures/core/uncategorised/42/expected.json index c0d601a0c6..7bc3ec6059 100644 --- a/test/fixtures/core/uncategorised/42/expected.json +++ b/test/fixtures/core/uncategorised/42/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -130,7 +129,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -144,8 +142,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "w" + } }, "name": "w" } @@ -206,8 +203,7 @@ "end": { "line": 1, "column": 28 - }, - "identifierName": "m_null" + } }, "name": "m_null" }, @@ -223,8 +219,7 @@ "end": { "line": 1, "column": 32 - }, - "identifierName": "w" + } }, "name": "w" } diff --git a/test/fixtures/core/uncategorised/42/expected.lightscript.json b/test/fixtures/core/uncategorised/42/expected.lightscript.json new file mode 100644 index 0000000000..564ca8686f --- /dev/null +++ b/test/fixtures/core/uncategorised/42/expected.lightscript.json @@ -0,0 +1,251 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "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": 36, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "StringLiteral", + "start": 10, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "extra": { + "rawValue": "null", + "raw": "\"null\"" + }, + "value": "null" + }, + "kind": "set", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "w" + }, + "name": "w" + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 22, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 22, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 22, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 28 + }, + "identifierName": "m_null" + }, + "name": "m_null" + }, + "init": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 32 + }, + "identifierName": "w" + }, + "name": "w" + } + } + ] + } + ], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/43/expected.json b/test/fixtures/core/uncategorised/43/expected.json index ef2d3f1eb7..b2b46810dc 100644 --- a/test/fixtures/core/uncategorised/43/expected.json +++ b/test/fixtures/core/uncategorised/43/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -130,7 +129,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -144,8 +142,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "w" + } }, "name": "w" } @@ -206,8 +203,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "m_null" + } }, "name": "m_null" }, @@ -223,8 +219,7 @@ "end": { "line": 1, "column": 28 - }, - "identifierName": "w" + } }, "name": "w" } diff --git a/test/fixtures/core/uncategorised/43/expected.lightscript.json b/test/fixtures/core/uncategorised/43/expected.lightscript.json new file mode 100644 index 0000000000..87aca7d36b --- /dev/null +++ b/test/fixtures/core/uncategorised/43/expected.lightscript.json @@ -0,0 +1,251 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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": 32, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "NumericLiteral", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + }, + "kind": "set", + "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": "w" + }, + "name": "w" + } + ], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 18, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 18, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": { + "type": "Identifier", + "start": 18, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "m_null" + }, + "name": "m_null" + }, + "init": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + }, + "identifierName": "w" + }, + "name": "w" + } + } + ] + } + ], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/44/expected.json b/test/fixtures/core/uncategorised/44/expected.json index da5e30670e..33f2638826 100644 --- a/test/fixtures/core/uncategorised/44/expected.json +++ b/test/fixtures/core/uncategorised/44/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "get" + } }, "name": "get" }, diff --git a/test/fixtures/core/uncategorised/44/expected.lightscript.json b/test/fixtures/core/uncategorised/44/expected.lightscript.json new file mode 100644 index 0000000000..65ea9eadfb --- /dev/null +++ b/test/fixtures/core/uncategorised/44/expected.lightscript.json @@ -0,0 +1,156 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "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": 15, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 6, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "get" + }, + "name": "get" + }, + "value": { + "type": "NumericLiteral", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/45/expected.json b/test/fixtures/core/uncategorised/45/expected.json index 36c20d4050..bb724805ea 100644 --- a/test/fixtures/core/uncategorised/45/expected.json +++ b/test/fixtures/core/uncategorised/45/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "set" + } }, "name": "set" }, diff --git a/test/fixtures/core/uncategorised/45/expected.lightscript.json b/test/fixtures/core/uncategorised/45/expected.lightscript.json new file mode 100644 index 0000000000..a5756bd456 --- /dev/null +++ b/test/fixtures/core/uncategorised/45/expected.lightscript.json @@ -0,0 +1,156 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "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": 15, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 6, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "set" + }, + "name": "set" + }, + "value": { + "type": "NumericLiteral", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "extra": { + "rawValue": 43, + "raw": "43" + }, + "value": 43 + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/499/options.json b/test/fixtures/core/uncategorised/499/options.json index 11a57d6c56..68bfd75832 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:35)" + "throws": "Octal literal in strict mode (1:34)" } \ 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 2984958689..fa3a33b55e 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:38)" + "throws": "Octal literal in strict mode (1:37)" } \ 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 e92ad336dd..e689079a79 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:69)" + "throws": "Octal literal in strict mode (1:68)" } \ 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 76753120a1..9e7caa0016 100644 --- a/test/fixtures/core/uncategorised/525/expected.json +++ b/test/fixtures/core/uncategorised/525/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -79,7 +78,6 @@ ], "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 e762adfed3..9e32e59ad2 100644 --- a/test/fixtures/core/uncategorised/526/expected.json +++ b/test/fixtures/core/uncategorised/526/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -102,8 +101,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -112,7 +110,6 @@ ], "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 157910021f..8db391b3af 100644 --- a/test/fixtures/core/uncategorised/527/expected.json +++ b/test/fixtures/core/uncategorised/527/expected.json @@ -69,8 +69,7 @@ "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 f678e52654..ebe4c4d182 100644 --- a/test/fixtures/core/uncategorised/528/expected.json +++ b/test/fixtures/core/uncategorised/528/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "eval" + } }, "name": "eval" }, @@ -121,8 +120,7 @@ "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 1067b58643..e883fbe4f2 100644 --- a/test/fixtures/core/uncategorised/529/expected.json +++ b/test/fixtures/core/uncategorised/529/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -121,8 +120,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -173,8 +171,7 @@ "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 a1ccc73433..ced9b7da30 100644 --- a/test/fixtures/core/uncategorised/530/expected.json +++ b/test/fixtures/core/uncategorised/530/expected.json @@ -83,8 +83,7 @@ "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 26a28de03c..a40116c512 100644 --- a/test/fixtures/core/uncategorised/531/expected.json +++ b/test/fixtures/core/uncategorised/531/expected.json @@ -83,8 +83,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -135,8 +134,7 @@ "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 c86ced2dd6..12d30b3dd3 100644 --- a/test/fixtures/core/uncategorised/532/expected.json +++ b/test/fixtures/core/uncategorised/532/expected.json @@ -42,7 +42,6 @@ "column": 31 } }, - "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -84,8 +83,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -106,8 +104,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "list" + } }, "name": "list" }, @@ -151,8 +148,7 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "process" + } }, "name": "process" }, @@ -169,8 +165,7 @@ "end": { "line": 1, "column": 29 - }, - "identifierName": "x" + } }, "name": "x" } @@ -178,7 +173,6 @@ } } } - ], - "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 5b8946932d..e194cd4fc2 100644 --- a/test/fixtures/core/uncategorised/533/expected.json +++ b/test/fixtures/core/uncategorised/533/expected.json @@ -69,8 +69,7 @@ "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 e09754f492..ee0b458ad8 100644 --- a/test/fixtures/core/uncategorised/534/expected.json +++ b/test/fixtures/core/uncategorised/534/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "eval" + } }, "name": "eval" }, @@ -121,8 +120,7 @@ "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 62dc6d154e..446cd2cbed 100644 --- a/test/fixtures/core/uncategorised/535/expected.json +++ b/test/fixtures/core/uncategorised/535/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -121,8 +120,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -173,8 +171,7 @@ "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 958b6ab0cc..0ad053b30e 100644 --- a/test/fixtures/core/uncategorised/537/expected.json +++ b/test/fixtures/core/uncategorised/537/expected.json @@ -83,8 +83,7 @@ "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 2bd4333d31..9e26dfeeb6 100644 --- a/test/fixtures/core/uncategorised/539/expected.json +++ b/test/fixtures/core/uncategorised/539/expected.json @@ -1,141 +1 @@ -{ - "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 +{} \ 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 0decbaaefa..ffbcf34606 100644 --- a/test/fixtures/core/uncategorised/540/expected.json +++ b/test/fixtures/core/uncategorised/540/expected.json @@ -73,7 +73,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -115,8 +114,7 @@ "value": 1 }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/core/uncategorised/541/expected.json b/test/fixtures/core/uncategorised/541/expected.json index db7df06cb3..c9f5c36ac7 100644 --- a/test/fixtures/core/uncategorised/541/expected.json +++ b/test/fixtures/core/uncategorised/541/expected.json @@ -54,14 +54,12 @@ "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/541/options.lightscript.json b/test/fixtures/core/uncategorised/541/options.lightscript.json new file mode 100644 index 0000000000..4a7c3aab91 --- /dev/null +++ b/test/fixtures/core/uncategorised/541/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Regex literals cannot start with a space in lightscript; try '\\s' or '\\ ' instead. (1:17)" +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/542/expected.json b/test/fixtures/core/uncategorised/542/expected.json index 3dc935f6be..dac534f2f7 100644 --- a/test/fixtures/core/uncategorised/542/expected.json +++ b/test/fixtures/core/uncategorised/542/expected.json @@ -102,8 +102,7 @@ "end": { "line": 2, "column": 6 - }, - "identifierName": "split" + } }, "name": "split" }, @@ -136,4 +135,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/core/uncategorised/542/options.lightscript.json b/test/fixtures/core/uncategorised/542/options.lightscript.json new file mode 100644 index 0000000000..0d4c46e093 --- /dev/null +++ b/test/fixtures/core/uncategorised/542/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Indentation required. (2:0)" +} \ 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 174e12e8d2..ecc6f809c9 100644 --- a/test/fixtures/core/uncategorised/543/expected.json +++ b/test/fixtures/core/uncategorised/543/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "fn" + } }, "name": "fn" }, @@ -91,7 +90,6 @@ "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 deleted file mode 100644 index 64dcf36896..0000000000 --- a/test/fixtures/core/uncategorised/550/actual.js +++ /dev/null @@ -1,2 +0,0 @@ -'use strict'; -const a = 07; diff --git a/test/fixtures/core/uncategorised/550/options.json b/test/fixtures/core/uncategorised/550/options.json deleted file mode 100644 index f635fb88c5..0000000000 --- a/test/fixtures/core/uncategorised/550/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid number (2:10)" -} diff --git a/test/fixtures/core/uncategorised/551/actual.js b/test/fixtures/core/uncategorised/551/actual.js deleted file mode 100644 index 524f32795d..0000000000 --- a/test/fixtures/core/uncategorised/551/actual.js +++ /dev/null @@ -1 +0,0 @@ -0111 \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/551/expected.json b/test/fixtures/core/uncategorised/551/expected.json deleted file mode 100644 index 07311dd1eb..0000000000 --- a/test/fixtures/core/uncategorised/551/expected.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, - "expression": { - "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, - "extra": { - "rawValue": 73, - "raw": "0111" - }, - "value": 73 - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/552/actual.js b/test/fixtures/core/uncategorised/552/actual.js deleted file mode 100644 index 63f4544f72..0000000000 --- a/test/fixtures/core/uncategorised/552/actual.js +++ /dev/null @@ -1,2 +0,0 @@ -'use strict'; -const a = 08; diff --git a/test/fixtures/core/uncategorised/552/options.json b/test/fixtures/core/uncategorised/552/options.json deleted file mode 100644 index f635fb88c5..0000000000 --- a/test/fixtures/core/uncategorised/552/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid number (2:10)" -} diff --git a/test/fixtures/core/uncategorised/553/actual.js b/test/fixtures/core/uncategorised/553/actual.js deleted file mode 100644 index 6b07531279..0000000000 --- a/test/fixtures/core/uncategorised/553/actual.js +++ /dev/null @@ -1 +0,0 @@ -0274134317073 \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/553/expected.json b/test/fixtures/core/uncategorised/553/expected.json deleted file mode 100644 index 756da7f491..0000000000 --- a/test/fixtures/core/uncategorised/553/expected.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "expression": { - "type": "NumericLiteral", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "extra": { - "rawValue": 25257156155, - "raw": "0274134317073" - }, - "value": 25257156155 - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/554/actual.js b/test/fixtures/core/uncategorised/554/actual.js deleted file mode 100644 index 204735a64f..0000000000 --- a/test/fixtures/core/uncategorised/554/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index e247a786c1..0000000000 --- a/test/fixtures/core/uncategorised/554/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token (1:13)" -} diff --git a/test/fixtures/core/uncategorised/6/expected.json b/test/fixtures/core/uncategorised/6/expected.json index 213f57310d..33043e035c 100644 --- a/test/fixtures/core/uncategorised/6/expected.json +++ b/test/fixtures/core/uncategorised/6/expected.json @@ -112,8 +112,7 @@ "value": 2 }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } }, "operator": "*", diff --git a/test/fixtures/core/uncategorised/64/expected.json b/test/fixtures/core/uncategorised/64/expected.json index 9c1a6d4b50..417e718ef6 100644 --- a/test/fixtures/core/uncategorised/64/expected.json +++ b/test/fixtures/core/uncategorised/64/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -114,8 +113,7 @@ "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 dfcf35acfe..7a17ba3527 100644 --- a/test/fixtures/core/uncategorised/65/expected.json +++ b/test/fixtures/core/uncategorised/65/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "answer" + } }, "name": "answer" }, @@ -115,8 +114,7 @@ "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 7653286f2a..eecbadfa66 100644 --- a/test/fixtures/core/uncategorised/7/expected.json +++ b/test/fixtures/core/uncategorised/7/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -92,7 +91,6 @@ } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/7/expected.lightscript.json b/test/fixtures/core/uncategorised/7/expected.lightscript.json new file mode 100644 index 0000000000..5ced4a5335 --- /dev/null +++ b/test/fixtures/core/uncategorised/7/expected.lightscript.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "ArrayExpression", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "elements": [] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/70/options.lightscript.json b/test/fixtures/core/uncategorised/70/options.lightscript.json new file mode 100644 index 0000000000..2e62cfd8ed --- /dev/null +++ b/test/fixtures/core/uncategorised/70/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Decimal numbers must be prefixed with a `0` in LightScript (eg; `0.1`). (1:0)" +} \ 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 a971641682..afd3885785 100644 --- a/test/fixtures/core/uncategorised/8/expected.json +++ b/test/fixtures/core/uncategorised/8/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -92,7 +91,6 @@ } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/8/expected.lightscript.json b/test/fixtures/core/uncategorised/8/expected.lightscript.json new file mode 100644 index 0000000000..0cce3c11ee --- /dev/null +++ b/test/fixtures/core/uncategorised/8/expected.lightscript.json @@ -0,0 +1,100 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "ArrayExpression", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "elements": [] + } + } + ] + } + ], + "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 e07b3ce88d..13c08de8ec 100644 --- a/test/fixtures/core/uncategorised/9/expected.json +++ b/test/fixtures/core/uncategorised/9/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/9/expected.lightscript.json b/test/fixtures/core/uncategorised/9/expected.lightscript.json new file mode 100644 index 0000000000..71167de3fd --- /dev/null +++ b/test/fixtures/core/uncategorised/9/expected.lightscript.json @@ -0,0 +1,121 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "ArrayExpression", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 6, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/array-rest-spread/invalid-location/options.json b/test/fixtures/es2015/array-rest-spread/invalid-location/options.json deleted file mode 100644 index beef14a214..0000000000 --- a/test/fixtures/es2015/array-rest-spread/invalid-location/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 8bf2600909..0000000000 --- a/test/fixtures/es2015/array-rest-spread/with-object/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index bf10b699ac..0000000000 --- a/test/fixtures/es2015/array-rest-spread/with-object/expected.json +++ /dev/null @@ -1,248 +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": "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 718795d103..00b780b1c4 100644 --- a/test/fixtures/es2015/arrow-functions/object-rest-spread/expected.json +++ b/test/fixtures/es2015/arrow-functions/object-rest-spread/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -91,7 +90,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "ObjectPattern", @@ -137,8 +135,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "title" + } }, "name": "title" }, @@ -154,8 +151,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "title" + } }, "name": "title" }, @@ -164,7 +160,7 @@ } }, { - "type": "RestElement", + "type": "RestProperty", "start": 21, "end": 29, "loc": { @@ -189,8 +185,7 @@ "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 faef53359b..476bc13a2b 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() is only valid inside a class constructor. Make sure the method name is spelled exactly as 'constructor'. (2:8)" -} + "throws": "super() outside of class constructor (2:8)" +} \ No newline at end of file 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 deleted file mode 100644 index d96088851c..0000000000 --- a/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/actual.js +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 00c025e551..0000000000 --- a/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 4c68e68f03..0000000000 --- a/test/fixtures/es2015/class-methods/linebreaks/actual.js +++ /dev/null @@ -1,42 +0,0 @@ -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 deleted file mode 100644 index 7094788e97..0000000000 --- a/test/fixtures/es2015/class-methods/linebreaks/expected.json +++ /dev/null @@ -1,690 +0,0 @@ -{ - "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 deleted file mode 100644 index 35e8ddeefe..0000000000 --- a/test/fixtures/es2015/class-methods/tricky-names/actual.js +++ /dev/null @@ -1,45 +0,0 @@ -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 deleted file mode 100644 index 5a167e4d71..0000000000 --- a/test/fixtures/es2015/class-methods/tricky-names/expected.json +++ /dev/null @@ -1,711 +0,0 @@ -{ - "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 876a6855b0..6a6f627eec 100644 --- a/test/fixtures/es2015/computed-properties/call-expression/expected.json +++ b/test/fixtures/es2015/computed-properties/call-expression/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -132,8 +131,7 @@ "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 7b3fa80cce..3d8ba60894 100644 --- a/test/fixtures/es2015/modules/duplicate-named-export-destructuring/expected.json +++ b/test/fixtures/es2015/modules/duplicate-named-export-destructuring/expected.json @@ -2521,8 +2521,7 @@ "end": { "line": 12, "column": 18 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -2555,8 +2554,7 @@ "end": { "line": 12, "column": 29 - }, - "identifierName": "qux7" + } }, "name": "qux7" } @@ -2577,8 +2575,7 @@ "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 8106cf01a0..499e822973 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,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -106,13 +105,11 @@ "end": { "line": 2, "column": 4 - }, - "identifierName": "foo" + } }, "name": "foo", "extra": { - "parenthesized": true, - "parenStart": 30 + "parenthesized": true } } } 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 ffc9c92fd4..182219d69c 100644 --- a/test/fixtures/es2015/modules/export-default-function-declaration/expected.json +++ b/test/fixtures/es2015/modules/export-default-function-declaration/expected.json @@ -68,14 +68,12 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "a" + } }, "name": "a" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -91,12 +89,10 @@ "column": 30 } }, - "body": [], - "directives": [] + "body": [] } } } - ], - "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 845de0632b..a83ccafb0b 100644 --- a/test/fixtures/es2015/modules/export-default-function-expression/expected.json +++ b/test/fixtures/es2015/modules/export-default-function-expression/expected.json @@ -68,14 +68,12 @@ "end": { "line": 1, "column": 26 - }, - "identifierName": "a" + } }, "name": "a" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -95,8 +93,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 15 + "parenthesized": true } } } diff --git a/test/fixtures/es2015/regression/186/expected.json b/test/fixtures/es2015/regression/186/expected.json index 080e9bbb8d..fc3a010f4e 100644 --- a/test/fixtures/es2015/regression/186/expected.json +++ b/test/fixtures/es2015/regression/186/expected.json @@ -122,7 +122,6 @@ }, "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 deleted file mode 100644 index 5ce7c9deac..0000000000 --- a/test/fixtures/es2015/shorthand/1/actual.js +++ /dev/null @@ -1 +0,0 @@ -var x = ({ const }); diff --git a/test/fixtures/es2015/shorthand/1/options.json b/test/fixtures/es2015/shorthand/1/options.json deleted file mode 100644 index a618f5e2ef..0000000000 --- a/test/fixtures/es2015/shorthand/1/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index fabf36837d..0000000000 --- a/test/fixtures/es2015/shorthand/2/actual.js +++ /dev/null @@ -1 +0,0 @@ -({ get, this, if }); diff --git a/test/fixtures/es2015/shorthand/2/options.json b/test/fixtures/es2015/shorthand/2/options.json deleted file mode 100644 index 7691eb820f..0000000000 --- a/test/fixtures/es2015/shorthand/2/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "this is a reserved word (1:8)" -} diff --git a/test/fixtures/es2015/uncategorised/.191/expected.json b/test/fixtures/es2015/uncategorised/.191/expected.json new file mode 100644 index 0000000000..2b36873e36 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/.191/expected.json @@ -0,0 +1,180 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "ArrayPattern", + "start": 4, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "a" + }, + { + "type": "RestElement", + "start": 8, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 11, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "b" + }, + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "c" + } + ] + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "d" + } + } + ], + "kind": "var" + } + ] + }, + "comments": [] +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/.335/expected.json b/test/fixtures/es2015/uncategorised/.335/expected.json new file mode 100644 index 0000000000..5e726736c7 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/.335/expected.json @@ -0,0 +1,152 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "y" + }, + "generator": true, + "expression": false, + "params": [ + { + "type": "ObjectPattern", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "properties": [ + { + "type": "Property", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "yield" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "yield" + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/.343/expected.json b/test/fixtures/es2015/uncategorised/.343/expected.json new file mode 100644 index 0000000000..dd64dc845d --- /dev/null +++ b/test/fixtures/es2015/uncategorised/.343/expected.json @@ -0,0 +1,68 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "raw": "/\\u{110000}/u", + "regex": { + "pattern": "\\u{110000}", + "flags": "u" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/100/expected.json b/test/fixtures/es2015/uncategorised/100/expected.json index dca7e84e4b..6cf9d34539 100644 --- a/test/fixtures/es2015/uncategorised/100/expected.json +++ b/test/fixtures/es2015/uncategorised/100/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -134,8 +133,7 @@ "end": { "line": 2, "column": 1 - }, - "identifierName": "v" + } }, "name": "v" } @@ -144,8 +142,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/es2015/uncategorised/101/expected.json b/test/fixtures/es2015/uncategorised/101/expected.json index 19da0b61bb..474fa746b1 100644 --- a/test/fixtures/es2015/uncategorised/101/expected.json +++ b/test/fixtures/es2015/uncategorised/101/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -117,8 +116,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "v" + } }, "name": "v" } @@ -128,8 +126,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/es2015/uncategorised/102/expected.json b/test/fixtures/es2015/uncategorised/102/expected.json index 44a42a67a3..313a50f769 100644 --- a/test/fixtures/es2015/uncategorised/102/expected.json +++ b/test/fixtures/es2015/uncategorised/102/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "test" + } }, "name": "test" }, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -119,18 +117,16 @@ "end": { "line": 1, "column": 28 - }, - "identifierName": "v" + } }, "name": "v" } } } - ], - "directives": [] + ] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 fc3feab5f7..1397cc5c38 100644 --- a/test/fixtures/es2015/uncategorised/103/expected.json +++ b/test/fixtures/es2015/uncategorised/103/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "test" + } }, "name": "test" }, @@ -127,7 +125,6 @@ "id": null, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -185,8 +182,7 @@ "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 c06f76fd9b..953225b56f 100644 --- a/test/fixtures/es2015/uncategorised/104/expected.json +++ b/test/fixtures/es2015/uncategorised/104/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "foo" + } }, "name": "foo" }, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -132,8 +130,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "console" + } }, "name": "console" }, @@ -149,8 +146,7 @@ "end": { "line": 1, "column": 29 - }, - "identifierName": "log" + } }, "name": "log" }, @@ -177,11 +173,9 @@ ] } } - ], - "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 a9aed1c3aa..cf48cd61b8 100644 --- a/test/fixtures/es2015/uncategorised/105/expected.json +++ b/test/fixtures/es2015/uncategorised/105/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "t" + } }, "name": "t" }, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -77,11 +75,10 @@ "column": 16 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 d31bc5cfdb..375a738193 100644 --- a/test/fixtures/es2015/uncategorised/106/expected.json +++ b/test/fixtures/es2015/uncategorised/106/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -147,8 +146,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/es2015/uncategorised/107/expected.json b/test/fixtures/es2015/uncategorised/107/expected.json index 80d2b3dc47..0b5fab146f 100644 --- a/test/fixtures/es2015/uncategorised/107/expected.json +++ b/test/fixtures/es2015/uncategorised/107/expected.json @@ -42,7 +42,6 @@ "column": 26 } }, - "await": false, "left": { "type": "Identifier", "start": 4, @@ -55,8 +54,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -72,8 +70,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "list" + } }, "name": "list" }, @@ -117,8 +114,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "process" + } }, "name": "process" }, @@ -135,8 +131,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "x" + } }, "name": "x" } @@ -144,7 +139,7 @@ } } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/107/options.lightscript.json b/test/fixtures/es2015/uncategorised/107/options.lightscript.json new file mode 100644 index 0000000000..a3eda20231 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/107/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "for-of requires a variable qualifier: `now` to reassign an existing variable, or `const`, `let`, `var` to declare a new one. (1:4)" +} diff --git a/test/fixtures/es2015/uncategorised/108/expected.json b/test/fixtures/es2015/uncategorised/108/expected.json index b14f0cd72e..135f7e34c7 100644 --- a/test/fixtures/es2015/uncategorised/108/expected.json +++ b/test/fixtures/es2015/uncategorised/108/expected.json @@ -42,7 +42,6 @@ "column": 31 } }, - "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -84,8 +83,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -106,8 +104,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "list" + } }, "name": "list" }, @@ -151,8 +148,7 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "process" + } }, "name": "process" }, @@ -169,8 +165,7 @@ "end": { "line": 1, "column": 29 - }, - "identifierName": "x" + } }, "name": "x" } @@ -178,7 +173,7 @@ } } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 cbcba6f392..121d7f9753 100644 --- a/test/fixtures/es2015/uncategorised/110/expected.json +++ b/test/fixtures/es2015/uncategorised/110/expected.json @@ -42,7 +42,6 @@ "column": 31 } }, - "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -84,8 +83,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -106,8 +104,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "list" + } }, "name": "list" }, @@ -151,8 +148,7 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "process" + } }, "name": "process" }, @@ -169,8 +165,7 @@ "end": { "line": 1, "column": 29 - }, - "identifierName": "x" + } }, "name": "x" } @@ -178,7 +173,7 @@ } } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 d9d53207f6..4f7aa5c5a4 100644 --- a/test/fixtures/es2015/uncategorised/111/expected.json +++ b/test/fixtures/es2015/uncategorised/111/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -101,8 +100,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "B" + } }, "name": "B" }, @@ -127,7 +125,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 8a601083eb..0a8f8339c4 100644 --- a/test/fixtures/es2015/uncategorised/112/expected.json +++ b/test/fixtures/es2015/uncategorised/112/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -85,8 +84,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "B" + } }, "name": "B" }, @@ -102,8 +100,7 @@ "end": { "line": 1, "column": 33 - }, - "identifierName": "C" + } }, "name": "C" }, @@ -141,7 +138,7 @@ "body": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 cad16d40f7..d5b033e029 100644 --- a/test/fixtures/es2015/uncategorised/113/expected.json +++ b/test/fixtures/es2015/uncategorised/113/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 17 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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 8af6dc0f92..6601d59d6d 100644 --- a/test/fixtures/es2015/uncategorised/114/expected.json +++ b/test/fixtures/es2015/uncategorised/114/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 25 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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 17580d67f8..75c400a2a7 100644 --- a/test/fixtures/es2015/uncategorised/115/expected.json +++ b/test/fixtures/es2015/uncategorised/115/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -71,8 +70,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "B" + } }, "name": "B" }, @@ -105,7 +103,6 @@ "column": 31 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -119,16 +116,15 @@ "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 1296990414..c3fa277a2f 100644 --- a/test/fixtures/es2015/uncategorised/116/expected.json +++ b/test/fixtures/es2015/uncategorised/116/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -71,8 +70,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "B" + } }, "name": "B" }, @@ -105,7 +103,6 @@ "column": 39 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -119,16 +116,15 @@ "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 f00e0c107d..d607a58aad 100644 --- a/test/fixtures/es2015/uncategorised/117/expected.json +++ b/test/fixtures/es2015/uncategorised/117/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 20 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "a" + } }, "name": "a" }, + "static": false, "kind": "set", "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -126,8 +123,7 @@ "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 312d1c4e77..54e7adf346 100644 --- a/test/fixtures/es2015/uncategorised/118/expected.json +++ b/test/fixtures/es2015/uncategorised/118/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 28 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "a" + } }, "name": "a" }, + "static": true, "kind": "set", "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -126,8 +123,7 @@ "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 622579925b..e47c5c6942 100644 --- a/test/fixtures/es2015/uncategorised/119/expected.json +++ b/test/fixtures/es2015/uncategorised/119/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 18 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "set" + } }, "name": "set" }, + "static": false, "kind": "method", "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -126,8 +123,7 @@ "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 6159a166d3..873df88c9f 100644 --- a/test/fixtures/es2015/uncategorised/120/expected.json +++ b/test/fixtures/es2015/uncategorised/120/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 26 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "set" + } }, "name": "set" }, + "static": true, "kind": "method", "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -126,8 +123,7 @@ "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 9dbb7f0244..f1e8a83082 100644 --- a/test/fixtures/es2015/uncategorised/121/expected.json +++ b/test/fixtures/es2015/uncategorised/121/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,8 +88,6 @@ "column": 29 } }, - "static": false, - "kind": "method", "computed": false, "key": { "type": "Identifier", @@ -104,15 +101,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", @@ -126,8 +123,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "v" + } }, "name": "v" } @@ -188,8 +184,7 @@ "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 df6337f1f3..0c6728f1b8 100644 --- a/test/fixtures/es2015/uncategorised/122/expected.json +++ b/test/fixtures/es2015/uncategorised/122/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,8 +88,6 @@ "column": 37 } }, - "static": true, - "kind": "method", "computed": false, "key": { "type": "Identifier", @@ -104,15 +101,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", @@ -126,8 +123,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "v" + } }, "name": "v" } @@ -188,8 +184,7 @@ "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 1685cc9b6e..2b8ddddaf7 100644 --- a/test/fixtures/es2015/uncategorised/123/expected.json +++ b/test/fixtures/es2015/uncategorised/123/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -103,7 +102,6 @@ "column": 49 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -117,16 +115,15 @@ "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", @@ -196,8 +193,7 @@ ] }, "extra": { - "parenthesized": true, - "parenStart": 14 + "parenthesized": true } } } diff --git a/test/fixtures/es2015/uncategorised/124/expected.json b/test/fixtures/es2015/uncategorised/124/expected.json index 264271977f..7c01cad6f1 100644 --- a/test/fixtures/es2015/uncategorised/124/expected.json +++ b/test/fixtures/es2015/uncategorised/124/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 27 } }, - "static": false, "computed": false, "key": { "type": "StringLiteral", @@ -111,11 +109,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 fc2058a420..937272b468 100644 --- a/test/fixtures/es2015/uncategorised/128/expected.json +++ b/test/fixtures/es2015/uncategorised/128/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 24 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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 5454ccebf1..bb30c8aa84 100644 --- a/test/fixtures/es2015/uncategorised/129/expected.json +++ b/test/fixtures/es2015/uncategorised/129/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 17 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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", @@ -146,7 +143,6 @@ "column": 33 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -160,16 +156,15 @@ "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 ec906dfe00..8c38e200c5 100644 --- a/test/fixtures/es2015/uncategorised/131/expected.json +++ b/test/fixtures/es2015/uncategorised/131/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 18 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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", @@ -146,7 +143,6 @@ "column": 27 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -160,16 +156,15 @@ "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 2dd984cc0f..7468edee54 100644 --- a/test/fixtures/es2015/uncategorised/132/expected.json +++ b/test/fixtures/es2015/uncategorised/132/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 22 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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", @@ -146,7 +143,6 @@ "column": 36 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -160,16 +156,15 @@ "end": { "line": 1, "column": 30 - }, - "identifierName": "foo" + } }, "name": "foo" }, + "static": false, "kind": "set", "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -183,8 +178,7 @@ "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 199a299f92..7e8a2075c5 100644 --- a/test/fixtures/es2015/uncategorised/133/expected.json +++ b/test/fixtures/es2015/uncategorised/133/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 29 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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", @@ -146,7 +143,6 @@ "column": 42 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -160,16 +156,15 @@ "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 b9dd2520bd..d81ed33228 100644 --- a/test/fixtures/es2015/uncategorised/134/expected.json +++ b/test/fixtures/es2015/uncategorised/134/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 29 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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", @@ -146,7 +143,6 @@ "column": 49 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -160,16 +156,15 @@ "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 903738ff2c..834c4dccf7 100644 --- a/test/fixtures/es2015/uncategorised/135/expected.json +++ b/test/fixtures/es2015/uncategorised/135/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 29 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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", @@ -146,7 +143,6 @@ "column": 50 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -160,16 +156,15 @@ "end": { "line": 1, "column": 44 - }, - "identifierName": "foo" + } }, "name": "foo" }, + "static": true, "kind": "set", "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -183,8 +178,7 @@ "end": { "line": 1, "column": 46 - }, - "identifierName": "v" + } }, "name": "v" } @@ -221,7 +215,6 @@ "column": 63 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -235,16 +228,15 @@ "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", @@ -278,7 +270,6 @@ "column": 77 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -292,16 +283,15 @@ "end": { "line": 1, "column": 71 - }, - "identifierName": "foo" + } }, "name": "foo" }, + "static": false, "kind": "set", "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -315,8 +305,7 @@ "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 c01494b7de..22216e8a4d 100644 --- a/test/fixtures/es2015/uncategorised/136/expected.json +++ b/test/fixtures/es2015/uncategorised/136/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 27 } }, - "static": true, "computed": true, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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 0864f451f7..379914b948 100644 --- a/test/fixtures/es2015/uncategorised/137/expected.json +++ b/test/fixtures/es2015/uncategorised/137/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 31 } }, - "static": true, "computed": true, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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 e8baafdc74..36e95c1207 100644 --- a/test/fixtures/es2015/uncategorised/138/expected.json +++ b/test/fixtures/es2015/uncategorised/138/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 23 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "foo" + } }, "name": "foo" }, + "static": false, "kind": "set", "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -126,8 +123,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "v" + } }, "name": "v" } @@ -164,7 +160,6 @@ "column": 36 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -178,16 +173,15 @@ "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 b61e6d560f..ada61eb661 100644 --- a/test/fixtures/es2015/uncategorised/139/expected.json +++ b/test/fixtures/es2015/uncategorised/139/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 18 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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", @@ -146,7 +143,6 @@ "column": 31 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -160,16 +156,15 @@ "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 54d6adf996..bb91764245 100644 --- a/test/fixtures/es2015/uncategorised/140/expected.json +++ b/test/fixtures/es2015/uncategorised/140/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "Semicolon" + } }, "name": "Semicolon" }, @@ -77,7 +76,7 @@ "body": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 eddaee3cad..d5c3f29651 100644 --- a/test/fixtures/es2015/uncategorised/141/expected.json +++ b/test/fixtures/es2015/uncategorised/141/expected.json @@ -86,8 +86,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -114,8 +113,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/es2015/uncategorised/142/expected.json b/test/fixtures/es2015/uncategorised/142/expected.json index 15b8f684ff..f32ac33468 100644 --- a/test/fixtures/es2015/uncategorised/142/expected.json +++ b/test/fixtures/es2015/uncategorised/142/expected.json @@ -153,8 +153,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/es2015/uncategorised/143/expected.json b/test/fixtures/es2015/uncategorised/143/expected.json index aaa1c78fe5..cc0ab8afc8 100644 --- a/test/fixtures/es2015/uncategorised/143/expected.json +++ b/test/fixtures/es2015/uncategorised/143/expected.json @@ -86,8 +86,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -108,7 +107,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -131,8 +129,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/es2015/uncategorised/144/expected.json b/test/fixtures/es2015/uncategorised/144/expected.json index 3e8c0bd2cf..50af14c530 100644 --- a/test/fixtures/es2015/uncategorised/144/expected.json +++ b/test/fixtures/es2015/uncategorised/144/expected.json @@ -86,8 +86,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -141,8 +140,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -169,8 +167,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/es2015/uncategorised/145/expected.json b/test/fixtures/es2015/uncategorised/145/expected.json index 39d0f02fc4..c87f359ecb 100644 --- a/test/fixtures/es2015/uncategorised/145/expected.json +++ b/test/fixtures/es2015/uncategorised/145/expected.json @@ -86,8 +86,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -95,7 +94,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -144,8 +142,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -153,7 +150,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -167,8 +163,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "v" + } }, "name": "v" } @@ -193,8 +188,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/es2015/uncategorised/146/expected.json b/test/fixtures/es2015/uncategorised/146/expected.json index 7c8df52528..8ab9dd27fd 100644 --- a/test/fixtures/es2015/uncategorised/146/expected.json +++ b/test/fixtures/es2015/uncategorised/146/expected.json @@ -86,8 +86,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -95,7 +94,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -117,8 +115,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/es2015/uncategorised/147/expected.json b/test/fixtures/es2015/uncategorised/147/expected.json index 3605b59b78..e9263cf600 100644 --- a/test/fixtures/es2015/uncategorised/147/expected.json +++ b/test/fixtures/es2015/uncategorised/147/expected.json @@ -101,8 +101,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "y" + } }, "name": "y" } @@ -170,8 +168,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -187,13 +184,9 @@ "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 dfea488504..c2c6fcf107 100644 --- a/test/fixtures/es2015/uncategorised/148/expected.json +++ b/test/fixtures/es2015/uncategorised/148/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "f" + } }, "name": "f" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "ObjectPattern", @@ -107,8 +105,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -124,8 +121,7 @@ "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 531feae88a..2b533c4b95 100644 --- a/test/fixtures/es2015/uncategorised/149/expected.json +++ b/test/fixtures/es2015/uncategorised/149/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "test" + } }, "name": "test" }, @@ -127,7 +125,6 @@ "id": null, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -185,8 +182,7 @@ "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 2e9d46b456..77889bf067 100644 --- a/test/fixtures/es2015/uncategorised/150/expected.json +++ b/test/fixtures/es2015/uncategorised/150/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 17 } }, - "static": false, "computed": true, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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 4577cf0204..19aeb74f7d 100644 --- a/test/fixtures/es2015/uncategorised/152/expected.json +++ b/test/fixtures/es2015/uncategorised/152/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "f" + } }, "name": "f" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "AssignmentPattern", @@ -104,8 +102,7 @@ "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 2876aa00ee..2d01d0b275 100644 --- a/test/fixtures/es2015/uncategorised/153/expected.json +++ b/test/fixtures/es2015/uncategorised/153/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "f" + } }, "name": "f" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "AssignmentPattern", @@ -121,8 +119,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -138,13 +135,9 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "x" + } }, "name": "x" - }, - "extra": { - "shorthand": true } } ] @@ -193,8 +186,7 @@ "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 47be23ad0b..371e5cb174 100644 --- a/test/fixtures/es2015/uncategorised/154/expected.json +++ b/test/fixtures/es2015/uncategorised/154/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -91,7 +90,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "AssignmentPattern", @@ -151,8 +149,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -168,13 +165,9 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "x" + } }, "name": "x" - }, - "extra": { - "shorthand": true } } ] @@ -223,8 +216,7 @@ "end": { "line": 1, "column": 21 - }, - "identifierName": "x" + } }, "name": "x" }, diff --git a/test/fixtures/es2015/uncategorised/154/expected.lightscript.json b/test/fixtures/es2015/uncategorised/154/expected.lightscript.json new file mode 100644 index 0000000000..7740b76bda --- /dev/null +++ b/test/fixtures/es2015/uncategorised/154/expected.lightscript.json @@ -0,0 +1,284 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "f" + }, + "name": "f" + }, + "init": { + "type": "FunctionExpression", + "start": 4, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "left": { + "type": "ObjectPattern", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + }, + "value": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "right": { + "type": "ObjectExpression", + "start": 19, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "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": "x" + }, + "name": "x" + }, + "value": { + "type": "NumericLiteral", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/155/expected.json b/test/fixtures/es2015/uncategorised/155/expected.json index 40fd9771cf..8ba65a825d 100644 --- a/test/fixtures/es2015/uncategorised/155/expected.json +++ b/test/fixtures/es2015/uncategorised/155/expected.json @@ -86,8 +86,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -108,7 +107,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "AssignmentPattern", @@ -168,8 +166,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -185,13 +182,9 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "x" + } }, "name": "x" - }, - "extra": { - "shorthand": true } } ] @@ -240,8 +233,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -291,8 +283,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/es2015/uncategorised/156/expected.json b/test/fixtures/es2015/uncategorised/156/expected.json index 287d7e8771..44938263b8 100644 --- a/test/fixtures/es2015/uncategorised/156/expected.json +++ b/test/fixtures/es2015/uncategorised/156/expected.json @@ -86,8 +86,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -95,7 +94,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "AssignmentPattern", @@ -155,8 +153,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -172,13 +169,9 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "x" + } }, "name": "x" - }, - "extra": { - "shorthand": true } } ] @@ -227,8 +220,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -277,8 +269,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/es2015/uncategorised/157/expected.json b/test/fixtures/es2015/uncategorised/157/expected.json index 6075b1827f..247de16217 100644 --- a/test/fixtures/es2015/uncategorised/157/expected.json +++ b/test/fixtures/es2015/uncategorised/157/expected.json @@ -87,7 +87,6 @@ "column": 27 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,16 +100,15 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "f" + } }, "name": "f" }, + "static": false, "kind": "method", "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "AssignmentPattern", @@ -170,8 +168,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -187,13 +184,9 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "x" + } }, "name": "x" - }, - "extra": { - "shorthand": true } } ] @@ -242,8 +235,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -293,8 +285,7 @@ ] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/es2015/uncategorised/158/expected.json b/test/fixtures/es2015/uncategorised/158/expected.json index 88d65a30fb..f5d344c43a 100644 --- a/test/fixtures/es2015/uncategorised/158/expected.json +++ b/test/fixtures/es2015/uncategorised/158/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "AssignmentPattern", @@ -119,8 +118,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -136,13 +134,9 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "x" + } }, "name": "x" - }, - "extra": { - "shorthand": true } } ] @@ -191,8 +185,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -239,8 +232,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/es2015/uncategorised/159/expected.json b/test/fixtures/es2015/uncategorised/159/expected.json index e1465d0c7d..62a790d784 100644 --- a/test/fixtures/es2015/uncategorised/159/expected.json +++ b/test/fixtures/es2015/uncategorised/159/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -91,7 +90,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "AssignmentPattern", @@ -119,8 +117,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "y" + } }, "name": "y" }, diff --git a/test/fixtures/es2015/uncategorised/159/expected.lightscript.json b/test/fixtures/es2015/uncategorised/159/expected.lightscript.json new file mode 100644 index 0000000000..843dcdd7dc --- /dev/null +++ b/test/fixtures/es2015/uncategorised/159/expected.lightscript.json @@ -0,0 +1,177 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "FunctionExpression", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "left": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "y" + }, + "name": "y" + }, + "right": { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/160/expected.json b/test/fixtures/es2015/uncategorised/160/expected.json index a0c1096c6f..b6a422f551 100644 --- a/test/fixtures/es2015/uncategorised/160/expected.json +++ b/test/fixtures/es2015/uncategorised/160/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "f" + } }, "name": "f" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "AssignmentPattern", @@ -89,8 +87,7 @@ "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 9d6157c40e..71590f27e6 100644 --- a/test/fixtures/es2015/uncategorised/161/expected.json +++ b/test/fixtures/es2015/uncategorised/161/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -140,7 +138,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "AssignmentPattern", @@ -168,8 +165,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "a" + } }, "name": "a" }, diff --git a/test/fixtures/es2015/uncategorised/161/expected.lightscript.json b/test/fixtures/es2015/uncategorised/161/expected.lightscript.json new file mode 100644 index 0000000000..5910b14f48 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/161/expected.lightscript.json @@ -0,0 +1,229 @@ +{ + "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", + "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": "ObjectProperty", + "start": 6, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "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": 25, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "left": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "a" + }, + "name": "a" + }, + "right": { + "type": "NumericLiteral", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/162/expected.json b/test/fixtures/es2015/uncategorised/162/expected.json index 7d167b78cf..a1ce797365 100644 --- a/test/fixtures/es2015/uncategorised/162/expected.json +++ b/test/fixtures/es2015/uncategorised/162/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -127,7 +125,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "AssignmentPattern", @@ -155,8 +152,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "a" + } }, "name": "a" }, diff --git a/test/fixtures/es2015/uncategorised/162/expected.lightscript.json b/test/fixtures/es2015/uncategorised/162/expected.lightscript.json new file mode 100644 index 0000000000..0ddef7ea2b --- /dev/null +++ b/test/fixtures/es2015/uncategorised/162/expected.lightscript.json @@ -0,0 +1,215 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "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": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "method": true, + "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" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "a" + }, + "name": "a" + }, + "right": { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/163/expected.json b/test/fixtures/es2015/uncategorised/163/expected.json index 07716be5ae..ec815ca77b 100644 --- a/test/fixtures/es2015/uncategorised/163/expected.json +++ b/test/fixtures/es2015/uncategorised/163/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "f" + } }, "name": "f" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -106,8 +103,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "b" + } }, "name": "b" } @@ -127,11 +123,10 @@ "column": 22 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 a42e8c8b1d..6cf3d81740 100644 --- a/test/fixtures/es2015/uncategorised/164/expected.json +++ b/test/fixtures/es2015/uncategorised/164/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "x" + } }, "name": "x" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "ArrayPattern", @@ -90,8 +88,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -107,8 +104,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "b" + } }, "name": "b" } @@ -129,11 +125,10 @@ "column": 22 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 f6be853aa4..08cb8d6662 100644 --- a/test/fixtures/es2015/uncategorised/165/expected.json +++ b/test/fixtures/es2015/uncategorised/165/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "x" + } }, "name": "x" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "ObjectPattern", @@ -107,8 +105,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -124,13 +121,9 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "a" + } }, "name": "a" - }, - "extra": { - "shorthand": true } }, { @@ -162,8 +155,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "b" + } }, "name": "b" }, @@ -179,13 +171,9 @@ "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 4d1f380f71..fecc14e44a 100644 --- a/test/fixtures/es2015/uncategorised/166/expected.json +++ b/test/fixtures/es2015/uncategorised/166/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "x" + } }, "name": "x" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -124,8 +121,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -141,13 +137,9 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "a" + } }, "name": "a" - }, - "extra": { - "shorthand": true } } ] diff --git a/test/fixtures/es2015/uncategorised/167/expected.json b/test/fixtures/es2015/uncategorised/167/expected.json deleted file mode 100644 index 83e3c57d2c..0000000000 --- a/test/fixtures/es2015/uncategorised/167/expected.json +++ /dev/null @@ -1,154 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "sourceType": "script", - "body": [ - { - "type": "FunctionDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "id": { - "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, - "name": "x" - }, - "generator": false, - "expression": false, - "async": false, - "params": [ - { - "type": "RestElement", - "start": 11, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "argument": { - "type": "ArrayPattern", - "start": 14, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "elements": [ - { - "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "a" - }, - "name": "a" - }, - { - "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "b" - }, - "name": "b" - } - ] - } - } - ], - "body": { - "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "body": [], - "directives": [] - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/167/options.json b/test/fixtures/es2015/uncategorised/167/options.json new file mode 100644 index 0000000000..d50e8469b8 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/167/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:14)" +} diff --git a/test/fixtures/es2015/uncategorised/168/expected.json b/test/fixtures/es2015/uncategorised/168/expected.json deleted file mode 100644 index 009f02d6c5..0000000000 --- a/test/fixtures/es2015/uncategorised/168/expected.json +++ /dev/null @@ -1,436 +0,0 @@ -{ - "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 new file mode 100644 index 0000000000..9ac2c7432d --- /dev/null +++ b/test/fixtures/es2015/uncategorised/168/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:42)" +} diff --git a/test/fixtures/es2015/uncategorised/169/expected.json b/test/fixtures/es2015/uncategorised/169/expected.json index 349715bcfa..7aa4a008d7 100644 --- a/test/fixtures/es2015/uncategorised/169/expected.json +++ b/test/fixtures/es2015/uncategorised/169/expected.json @@ -68,14 +68,12 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "x" + } }, "name": "x" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "ArrayPattern", @@ -104,8 +102,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -121,8 +118,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "b" + } }, "name": "b" } @@ -147,8 +143,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/es2015/uncategorised/170/expected.json b/test/fixtures/es2015/uncategorised/170/expected.json index 4053df70fa..50b9811fd9 100644 --- a/test/fixtures/es2015/uncategorised/170/expected.json +++ b/test/fixtures/es2015/uncategorised/170/expected.json @@ -68,14 +68,12 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "x" + } }, "name": "x" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "ObjectPattern", @@ -121,8 +119,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -138,13 +135,9 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "a" + } }, "name": "a" - }, - "extra": { - "shorthand": true } }, { @@ -176,8 +169,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "b" + } }, "name": "b" }, @@ -193,13 +185,9 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "b" + } }, "name": "b" - }, - "extra": { - "shorthand": true } } ] @@ -223,8 +211,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/es2015/uncategorised/171/expected.json b/test/fixtures/es2015/uncategorised/171/expected.json deleted file mode 100644 index ec25a3ef37..0000000000 --- a/test/fixtures/es2015/uncategorised/171/expected.json +++ /dev/null @@ -1,173 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "expression": { - "type": "FunctionExpression", - "start": 1, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "id": { - "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/flow/declare-export/invalid-export-arrow/options.json b/test/fixtures/es2015/uncategorised/171/options.json similarity index 100% rename from test/fixtures/flow/declare-export/invalid-export-arrow/options.json rename to test/fixtures/es2015/uncategorised/171/options.json diff --git a/test/fixtures/es2015/uncategorised/172/expected.json b/test/fixtures/es2015/uncategorised/172/expected.json deleted file mode 100644 index 3f75c7c880..0000000000 --- a/test/fixtures/es2015/uncategorised/172/expected.json +++ /dev/null @@ -1,455 +0,0 @@ -{ - "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 new file mode 100644 index 0000000000..ceee1cc2ef --- /dev/null +++ b/test/fixtures/es2015/uncategorised/172/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:43)" +} diff --git a/test/fixtures/es2015/uncategorised/173/expected.json b/test/fixtures/es2015/uncategorised/173/expected.json index 8cbad3c24a..35b8ef2474 100644 --- a/test/fixtures/es2015/uncategorised/173/expected.json +++ b/test/fixtures/es2015/uncategorised/173/expected.json @@ -86,8 +86,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -95,7 +94,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "ArrayPattern", @@ -124,8 +122,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -141,8 +138,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "b" + } }, "name": "b" } @@ -169,8 +165,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/es2015/uncategorised/174/expected.json b/test/fixtures/es2015/uncategorised/174/expected.json deleted file mode 100644 index f430150fa0..0000000000 --- a/test/fixtures/es2015/uncategorised/174/expected.json +++ /dev/null @@ -1,195 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "sourceType": "script", - "body": [ - { - "type": "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 new file mode 100644 index 0000000000..9ce9658f7d --- /dev/null +++ b/test/fixtures/es2015/uncategorised/174/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:8)" +} diff --git a/test/fixtures/es2015/uncategorised/175/expected.json b/test/fixtures/es2015/uncategorised/175/expected.json deleted file mode 100644 index 04aba9b49f..0000000000 --- a/test/fixtures/es2015/uncategorised/175/expected.json +++ /dev/null @@ -1,477 +0,0 @@ -{ - "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 new file mode 100644 index 0000000000..4914c41568 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/175/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:36)" +} diff --git a/test/fixtures/es2015/uncategorised/176/expected.json b/test/fixtures/es2015/uncategorised/176/expected.json index a8af6c1f54..00ea0f3c2a 100644 --- a/test/fixtures/es2015/uncategorised/176/expected.json +++ b/test/fixtures/es2015/uncategorised/176/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "RestElement", @@ -87,8 +86,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "a" + } }, "name": "a" } @@ -108,12 +106,11 @@ "column": 12 } }, - "body": [], - "directives": [] + "body": [] } } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 b6621bcdef..4051c8ff14 100644 --- a/test/fixtures/es2015/uncategorised/177/expected.json +++ b/test/fixtures/es2015/uncategorised/177/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -104,8 +102,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "b" + } }, "name": "b" } @@ -125,12 +122,11 @@ "column": 15 } }, - "body": [], - "directives": [] + "body": [] } } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 1019f36221..15f1e7078a 100644 --- a/test/fixtures/es2015/uncategorised/178/expected.json +++ b/test/fixtures/es2015/uncategorised/178/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "ObjectPattern", @@ -105,8 +104,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -122,13 +120,9 @@ "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 1483adeab3..ce3a65a9ee 100644 --- a/test/fixtures/es2015/uncategorised/179/expected.json +++ b/test/fixtures/es2015/uncategorised/179/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "ObjectPattern", @@ -105,8 +104,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -122,13 +120,9 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "a" + } }, "name": "a" - }, - "extra": { - "shorthand": true } } ] @@ -159,8 +153,7 @@ "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 ad16fe02ef..066751d992 100644 --- a/test/fixtures/es2015/uncategorised/18/expected.json +++ b/test/fixtures/es2015/uncategorised/18/expected.json @@ -81,7 +81,7 @@ ] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/180/expected.json b/test/fixtures/es2015/uncategorised/180/expected.json deleted file mode 100644 index 60ac7f04f6..0000000000 --- a/test/fixtures/es2015/uncategorised/180/expected.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "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 new file mode 100644 index 0000000000..27a7b64d71 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/180/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:4)" +} diff --git a/test/fixtures/es2015/uncategorised/181/expected.json b/test/fixtures/es2015/uncategorised/181/expected.json deleted file mode 100644 index abd0b99c56..0000000000 --- a/test/fixtures/es2015/uncategorised/181/expected.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "expression": { - "type": "ArrowFunctionExpression", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "id": null, - "generator": false, - "expression": false, - "async": false, - "params": [ - { - "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, - "name": "a" - }, - { - "type": "RestElement", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "argument": { - "type": "ArrayPattern", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "elements": [ - { - "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "b" - }, - "name": "b" - } - ] - } - } - ], - "body": { - "type": "BlockStatement", - "start": 15, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "body": [], - "directives": [] - } - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/181/options.json b/test/fixtures/es2015/uncategorised/181/options.json new file mode 100644 index 0000000000..c958665c03 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/181/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:7)" +} diff --git a/test/fixtures/es2015/uncategorised/182/expected.json b/test/fixtures/es2015/uncategorised/182/expected.json index 403a007d36..35cdf77789 100644 --- a/test/fixtures/es2015/uncategorised/182/expected.json +++ b/test/fixtures/es2015/uncategorised/182/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "ObjectPattern", @@ -105,8 +104,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -137,8 +135,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -154,8 +151,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "b" + } }, "name": "b" } @@ -190,8 +186,7 @@ "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 e6a04cd66b..79bc67b569 100644 --- a/test/fixtures/es2015/uncategorised/183/expected.json +++ b/test/fixtures/es2015/uncategorised/183/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "ObjectPattern", @@ -105,8 +104,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -122,8 +120,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "b" + } }, "name": "b" } @@ -157,8 +154,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "c" + } }, "name": "c" }, @@ -174,13 +170,9 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "c" + } }, "name": "c" - }, - "extra": { - "shorthand": true } } ] @@ -212,8 +204,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "d" + } }, "name": "d" }, @@ -229,8 +220,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "e" + } }, "name": "e" } @@ -262,8 +252,7 @@ "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 ba02725ad0..ce8b5406ef 100644 --- a/test/fixtures/es2015/uncategorised/184/expected.json +++ b/test/fixtures/es2015/uncategorised/184/expected.json @@ -98,8 +98,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "a" + } }, "name": "a" } @@ -118,14 +117,13 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "b" + } }, "name": "b" } } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/184/expected.lightscript.json b/test/fixtures/es2015/uncategorised/184/expected.lightscript.json new file mode 100644 index 0000000000..67da9fdecd --- /dev/null +++ b/test/fixtures/es2015/uncategorised/184/expected.lightscript.json @@ -0,0 +1,133 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "ArrayPattern", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "elements": [ + { + "type": "RestElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "argument": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "b" + }, + "name": "b" + } + } + ] + } + ], + "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 ed0b4ee13d..7876d116e8 100644 --- a/test/fixtures/es2015/uncategorised/185/expected.json +++ b/test/fixtures/es2015/uncategorised/185/expected.json @@ -84,8 +84,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -115,8 +114,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "b" + } }, "name": "b" } @@ -135,14 +133,13 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "c" + } }, "name": "c" } } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/185/expected.lightscript.json b/test/fixtures/es2015/uncategorised/185/expected.lightscript.json new file mode 100644 index 0000000000..8e1ee6f8e4 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/185/expected.lightscript.json @@ -0,0 +1,150 @@ +{ + "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 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "ArrayPattern", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "elements": [ + { + "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": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "argument": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "b" + }, + "name": "b" + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "c" + }, + "name": "c" + } + } + ] + } + ], + "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 6164999ca8..16d0a3f561 100644 --- a/test/fixtures/es2015/uncategorised/186/expected.json +++ b/test/fixtures/es2015/uncategorised/186/expected.json @@ -116,8 +116,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -133,13 +132,9 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "a" + } }, "name": "a" - }, - "extra": { - "shorthand": true } }, { @@ -171,8 +166,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "b" + } }, "name": "b" }, @@ -188,13 +182,9 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "b" + } }, "name": "b" - }, - "extra": { - "shorthand": true } } ] @@ -225,8 +215,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "c" + } }, "name": "c" } @@ -245,8 +234,7 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "d" + } }, "name": "d" } diff --git a/test/fixtures/es2015/uncategorised/186/expected.lightscript.json b/test/fixtures/es2015/uncategorised/186/expected.lightscript.json new file mode 100644 index 0000000000..4bd908fda3 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/186/expected.lightscript.json @@ -0,0 +1,260 @@ +{ + "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 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "ArrayPattern", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "elements": [ + { + "type": "ObjectPattern", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "a" + }, + "name": "a" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "b" + }, + "name": "b" + }, + "value": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "b" + }, + "name": "b" + }, + "extra": { + "shorthand": true + } + } + ] + }, + { + "type": "RestElement", + "start": 11, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "argument": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "c" + }, + "name": "c" + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "d" + }, + "name": "d" + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/187/expected.json b/test/fixtures/es2015/uncategorised/187/expected.json index 6c7430e634..89c48e2bde 100644 --- a/test/fixtures/es2015/uncategorised/187/expected.json +++ b/test/fixtures/es2015/uncategorised/187/expected.json @@ -84,8 +84,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -130,8 +129,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "b" + } }, "name": "b" }, @@ -147,8 +145,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "c" + } }, "name": "c" } @@ -169,14 +166,13 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "d" + } }, "name": "d" } } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/187/expected.lightscript.json b/test/fixtures/es2015/uncategorised/187/expected.lightscript.json new file mode 100644 index 0000000000..927573309c --- /dev/null +++ b/test/fixtures/es2015/uncategorised/187/expected.lightscript.json @@ -0,0 +1,184 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "ArrayPattern", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "elements": [ + { + "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": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "b" + }, + "name": "b" + }, + { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "c" + }, + "name": "c" + } + ] + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "d" + }, + "name": "d" + } + } + ] + } + ], + "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 3e27df2792..ae113e8e2d 100644 --- a/test/fixtures/es2015/uncategorised/188/expected.json +++ b/test/fixtures/es2015/uncategorised/188/expected.json @@ -98,8 +98,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "a" + } }, "name": "a" } @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "b" + } }, "name": "b" } @@ -127,7 +125,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 11ca896f80..abe4eaeff9 100644 --- a/test/fixtures/es2015/uncategorised/189/expected.json +++ b/test/fixtures/es2015/uncategorised/189/expected.json @@ -84,8 +84,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -115,8 +114,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "b" + } }, "name": "b" } @@ -135,8 +133,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "c" + } }, "name": "c" } @@ -144,7 +141,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 6b4305de3b..dcf190a44c 100644 --- a/test/fixtures/es2015/uncategorised/19/expected.json +++ b/test/fixtures/es2015/uncategorised/19/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "raw" + } }, "name": "raw" }, @@ -113,7 +112,7 @@ } } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 2968812946..dc0dd1b374 100644 --- a/test/fixtures/es2015/uncategorised/190/expected.json +++ b/test/fixtures/es2015/uncategorised/190/expected.json @@ -116,8 +116,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -133,13 +132,9 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "a" + } }, "name": "a" - }, - "extra": { - "shorthand": true } }, { @@ -171,8 +166,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "b" + } }, "name": "b" }, @@ -188,13 +182,9 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "b" + } }, "name": "b" - }, - "extra": { - "shorthand": true } } ] @@ -225,8 +215,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "c" + } }, "name": "c" } @@ -245,8 +234,7 @@ "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 c644dc8e95..0b70371d47 100644 --- a/test/fixtures/es2015/uncategorised/192/expected.json +++ b/test/fixtures/es2015/uncategorised/192/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "func" + } }, "name": "func" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "a" + } }, "name": "a" } @@ -109,7 +107,7 @@ ] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 80d1838cd2..98f7082d88 100644 --- a/test/fixtures/es2015/uncategorised/193/expected.json +++ b/test/fixtures/es2015/uncategorised/193/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "func" + } }, "name": "func" }, @@ -86,8 +85,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -117,8 +115,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "b" + } }, "name": "b" } @@ -126,7 +123,7 @@ ] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 1339fd84db..8c0a47724f 100644 --- a/test/fixtures/es2015/uncategorised/194/expected.json +++ b/test/fixtures/es2015/uncategorised/194/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "func" + } }, "name": "func" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "a" + } }, "name": "a" } @@ -118,15 +116,14 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "b" + } }, "name": "b" } ] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 7d10bbaad4..ca35fe564c 100644 --- a/test/fixtures/es2015/uncategorised/197/expected.json +++ b/test/fixtures/es2015/uncategorised/197/expected.json @@ -116,8 +116,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "foo" + } }, "name": "foo" }, diff --git a/test/fixtures/es2015/uncategorised/197/options.lightscript.json b/test/fixtures/es2015/uncategorised/197/options.lightscript.json new file mode 100644 index 0000000000..fa7318f54c --- /dev/null +++ b/test/fixtures/es2015/uncategorised/197/options.lightscript.json @@ -0,0 +1,4 @@ +{ + "ecmaVersion": 6, + "throws": "Unexpected token, expected ; (1:20)" +} diff --git a/test/fixtures/es2015/uncategorised/20/expected.json b/test/fixtures/es2015/uncategorised/20/expected.json index 9b083f0902..245e390fe6 100644 --- a/test/fixtures/es2015/uncategorised/20/expected.json +++ b/test/fixtures/es2015/uncategorised/20/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "raw" + } }, "name": "raw" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "name" + } }, "name": "name" } @@ -151,7 +149,7 @@ } } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 8b41104a7b..6f192feca1 100644 --- a/test/fixtures/es2015/uncategorised/21/expected.json +++ b/test/fixtures/es2015/uncategorised/21/expected.json @@ -81,7 +81,7 @@ ] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 9946fcaf1d..a0a63138db 100644 --- a/test/fixtures/es2015/uncategorised/22/expected.json +++ b/test/fixtures/es2015/uncategorised/22/expected.json @@ -81,7 +81,7 @@ ] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 61a17dec4f..f02b70e9aa 100644 --- a/test/fixtures/es2015/uncategorised/23/expected.json +++ b/test/fixtures/es2015/uncategorised/23/expected.json @@ -81,7 +81,7 @@ ] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 6c38d1e510..fb84640ac8 100644 --- a/test/fixtures/es2015/uncategorised/24/expected.json +++ b/test/fixtures/es2015/uncategorised/24/expected.json @@ -81,7 +81,7 @@ ] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 76377676ec..483c9211ab 100644 --- a/test/fixtures/es2015/uncategorised/25/expected.json +++ b/test/fixtures/es2015/uncategorised/25/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "raw" + } }, "name": "raw" }, @@ -129,7 +128,7 @@ "arguments": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 f9d81e9d99..2420931359 100644 --- a/test/fixtures/es2015/uncategorised/256/expected.json +++ b/test/fixtures/es2015/uncategorised/256/expected.json @@ -68,8 +68,7 @@ "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 177e044e8d..86d0362c7a 100644 --- a/test/fixtures/es2015/uncategorised/257/expected.json +++ b/test/fixtures/es2015/uncategorised/257/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "e" + } }, "name": "e" } @@ -105,8 +103,7 @@ "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 98b14d48e2..4984077118 100644 --- a/test/fixtures/es2015/uncategorised/259/expected.json +++ b/test/fixtures/es2015/uncategorised/259/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -116,8 +115,7 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "yield" + } }, "name": "yield" }, @@ -148,8 +146,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/es2015/uncategorised/26/expected.json b/test/fixtures/es2015/uncategorised/26/expected.json index b4c0e8bc2d..bf79d99f09 100644 --- a/test/fixtures/es2015/uncategorised/26/expected.json +++ b/test/fixtures/es2015/uncategorised/26/expected.json @@ -101,8 +101,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -150,8 +149,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -213,7 +211,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/263/options.json b/test/fixtures/es2015/uncategorised/263/options.json index 515b971673..2b34d4c1e1 100644 --- a/test/fixtures/es2015/uncategorised/263/options.json +++ b/test/fixtures/es2015/uncategorised/263/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token (1:6)" -} \ No newline at end of file + "throws": "A class name is required (1:6)" +} diff --git a/test/fixtures/es2015/uncategorised/265/options.lightscript.json b/test/fixtures/es2015/uncategorised/265/options.lightscript.json new file mode 100644 index 0000000000..26c20de8cb --- /dev/null +++ b/test/fixtures/es2015/uncategorised/265/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Paren-free test expressions must be followed by braces or a colon. (1:13)" +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/27/expected.json b/test/fixtures/es2015/uncategorised/27/expected.json index 5841ab30aa..929eaa9eab 100644 --- a/test/fixtures/es2015/uncategorised/27/expected.json +++ b/test/fixtures/es2015/uncategorised/27/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "answer" + } }, "name": "answer" }, @@ -116,8 +115,7 @@ "end": { "line": 1, "column": 32 - }, - "identifierName": "t" + } }, "name": "t" }, diff --git a/test/fixtures/es2015/uncategorised/273/expected.lightscript.json b/test/fixtures/es2015/uncategorised/273/expected.lightscript.json new file mode 100644 index 0000000000..5b3d936c7d --- /dev/null +++ b/test/fixtures/es2015/uncategorised/273/expected.lightscript.json @@ -0,0 +1,151 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "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 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "ArrayExpression", + "start": 8, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "elements": [ + { + "type": "IfExpression", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "test": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "x" + }, + "name": "x" + }, + "consequent": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "x" + }, + "name": "x" + }, + "alternate": null + } + ] + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/279/expected.json b/test/fixtures/es2015/uncategorised/279/expected.json deleted file mode 100644 index e2a39dc8b2..0000000000 --- a/test/fixtures/es2015/uncategorised/279/expected.json +++ /dev/null @@ -1,175 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "sourceType": "script", - "body": [ - { - "type": "FunctionDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "id": { - "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, - "name": "x" - }, - "generator": false, - "expression": false, - "async": false, - "params": [ - { - "type": "RestElement", - "start": 11, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "argument": { - "type": "ObjectPattern", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "properties": [ - { - "type": "ObjectProperty", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "a" - }, - "name": "a" - }, - "value": { - "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "a" - }, - "name": "a" - }, - "extra": { - "shorthand": true - } - } - ] - } - } - ], - "body": { - "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "body": [], - "directives": [] - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/279/options.json b/test/fixtures/es2015/uncategorised/279/options.json new file mode 100644 index 0000000000..51c483f3d3 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/279/options.json @@ -0,0 +1,3 @@ +{ + "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 9910aa18c4..6b22652418 100644 --- a/test/fixtures/es2015/uncategorised/28/expected.json +++ b/test/fixtures/es2015/uncategorised/28/expected.json @@ -59,7 +59,6 @@ "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 158f0af7b4..27a7b64d71 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:6)" + "throws": "Unexpected token (1:4)" } diff --git a/test/fixtures/es2015/array-rest-spread/invalid-location/actual.js b/test/fixtures/es2015/uncategorised/288/actual.js similarity index 100% rename from test/fixtures/es2015/array-rest-spread/invalid-location/actual.js rename to test/fixtures/es2015/uncategorised/288/actual.js diff --git a/test/fixtures/es2015/uncategorised/288/options.json b/test/fixtures/es2015/uncategorised/288/options.json new file mode 100644 index 0000000000..d8b91465e5 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/288/options.json @@ -0,0 +1,3 @@ +{ + "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 b6a6ef550a..070478ffa3 100644 --- a/test/fixtures/es2015/uncategorised/29/expected.json +++ b/test/fixtures/es2015/uncategorised/29/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "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 8513ff0bed..890fce8204 100644 --- a/test/fixtures/es2015/uncategorised/290/options.json +++ b/test/fixtures/es2015/uncategorised/290/options.json @@ -1,3 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:23)" + "throws": "Octal literal in strict mode (1:22)" } \ 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 d0b363d523..c53f6a5581 100644 --- a/test/fixtures/es2015/uncategorised/292/expected.json +++ b/test/fixtures/es2015/uncategorised/292/expected.json @@ -98,8 +98,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "a" + } }, "name": "a" } @@ -118,14 +117,13 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "b" + } }, "name": "b" } } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/292/expected.lightscript.json b/test/fixtures/es2015/uncategorised/292/expected.lightscript.json new file mode 100644 index 0000000000..09aca82bc2 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/292/expected.lightscript.json @@ -0,0 +1,133 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "ArrayPattern", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "elements": [ + { + "type": "RestElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "argument": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "b" + }, + "name": "b" + } + } + ] + } + ], + "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 1ba2b86107..67a0f6223a 100644 --- a/test/fixtures/es2015/uncategorised/299/expected.json +++ b/test/fixtures/es2015/uncategorised/299/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "doSmth" + } }, "name": "doSmth" }, @@ -101,8 +100,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +116,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -149,8 +146,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -167,8 +163,7 @@ "end": { "line": 1, "column": 29 - }, - "identifierName": "y" + } }, "name": "y" } @@ -260,7 +255,6 @@ ] } } - ], - "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 0d66821115..71885e218e 100644 --- a/test/fixtures/es2015/uncategorised/30/expected.json +++ b/test/fixtures/es2015/uncategorised/30/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "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 ac195d7470..928d53b6a0 100644 --- a/test/fixtures/es2015/uncategorised/300/expected.json +++ b/test/fixtures/es2015/uncategorised/300/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "normal" + } }, "name": "normal" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -106,8 +103,7 @@ "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 f061eeb9cd..2e575ba5c1 100644 --- a/test/fixtures/es2015/uncategorised/301/expected.json +++ b/test/fixtures/es2015/uncategorised/301/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "foo" + } }, "name": "foo" } @@ -101,8 +100,7 @@ "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 ed08a21975..835ebf5398 100644 --- a/test/fixtures/es2015/uncategorised/302/expected.json +++ b/test/fixtures/es2015/uncategorised/302/expected.json @@ -84,8 +84,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" } @@ -174,7 +173,6 @@ ] } } - ], - "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 935f87201b..64493bca6c 100644 --- a/test/fixtures/es2015/uncategorised/303/expected.json +++ b/test/fixtures/es2015/uncategorised/303/expected.json @@ -101,8 +101,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "get" + } }, "name": "get" }, @@ -118,13 +117,9 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "get" + } }, "name": "get" - }, - "extra": { - "shorthand": true } } ] @@ -141,8 +136,7 @@ "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 28602311f9..b66e1b6640 100644 --- a/test/fixtures/es2015/uncategorised/304/expected.json +++ b/test/fixtures/es2015/uncategorised/304/expected.json @@ -101,8 +101,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "propName" + } }, "name": "propName" }, @@ -132,8 +131,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "localVar" + } }, "name": "localVar" }, @@ -149,8 +147,7 @@ "end": { "line": 1, "column": 38 - }, - "identifierName": "defaultValue" + } }, "name": "defaultValue" } @@ -170,8 +167,7 @@ "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 2da5b72f13..07fa4a6986 100644 --- a/test/fixtures/es2015/uncategorised/305/expected.json +++ b/test/fixtures/es2015/uncategorised/305/expected.json @@ -101,8 +101,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "propName" + } }, "name": "propName" }, @@ -132,8 +131,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "propName" + } }, "name": "propName" }, @@ -149,14 +147,10 @@ "end": { "line": 1, "column": 28 - }, - "identifierName": "defaultValue" + } }, "name": "defaultValue" } - }, - "extra": { - "shorthand": true } } ] @@ -173,8 +167,7 @@ "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 6e86c3f9b4..7a38265d31 100644 --- a/test/fixtures/es2015/uncategorised/306/expected.json +++ b/test/fixtures/es2015/uncategorised/306/expected.json @@ -98,8 +98,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "localVar" + } }, "name": "localVar" }, @@ -115,8 +114,7 @@ "end": { "line": 1, "column": 28 - }, - "identifierName": "defaultValue" + } }, "name": "defaultValue" } @@ -135,8 +133,7 @@ "end": { "line": 1, "column": 35 - }, - "identifierName": "obj" + } }, "name": "obj" } @@ -144,7 +141,7 @@ ], "kind": "var" } - ], - "directives": [] - } -} \ No newline at end of file + ] + }, + "comments": [] +} diff --git a/test/fixtures/es2015/uncategorised/307/expected.json b/test/fixtures/es2015/uncategorised/307/expected.json index b4df0a2a30..17da2fe775 100644 --- a/test/fixtures/es2015/uncategorised/307/expected.json +++ b/test/fixtures/es2015/uncategorised/307/expected.json @@ -101,8 +101,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -132,8 +131,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -157,9 +155,6 @@ }, "value": 0 } - }, - "extra": { - "shorthand": true } } ] @@ -176,14 +171,12 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "obj" + } }, "name": "obj" }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/es2015/uncategorised/307/expected.lightscript.json b/test/fixtures/es2015/uncategorised/307/expected.lightscript.json new file mode 100644 index 0000000000..f333f20522 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/307/expected.lightscript.json @@ -0,0 +1,195 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 1, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, + "id": { + "type": "ObjectPattern", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 2, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + }, + "value": { + "type": "AssignmentPattern", + "start": 2, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "left": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "NumericLiteral", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "obj" + }, + "name": "obj" + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/308/expected.json b/test/fixtures/es2015/uncategorised/308/expected.json index a983e9498e..1b90586b94 100644 --- a/test/fixtures/es2015/uncategorised/308/expected.json +++ b/test/fixtures/es2015/uncategorised/308/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "ObjectPattern", @@ -105,8 +104,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -136,8 +134,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -161,9 +158,6 @@ }, "value": 0 } - }, - "extra": { - "shorthand": true } } ] @@ -181,8 +175,7 @@ "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 adf09ef4d3..fa310c051a 100644 --- a/test/fixtures/es2015/uncategorised/309/expected.json +++ b/test/fixtures/es2015/uncategorised/309/expected.json @@ -84,8 +84,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -133,8 +132,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "b" + } }, "name": "b" }, @@ -182,8 +180,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "c" + } }, "name": "c" }, @@ -213,8 +210,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "c" + } }, "name": "c" }, @@ -238,9 +234,6 @@ }, "value": 1 } - }, - "extra": { - "shorthand": true } } ] @@ -262,8 +255,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "arr" + } }, "name": "arr" } diff --git a/test/fixtures/es2015/uncategorised/309/expected.lightscript.json b/test/fixtures/es2015/uncategorised/309/expected.lightscript.json new file mode 100644 index 0000000000..8591642aaa --- /dev/null +++ b/test/fixtures/es2015/uncategorised/309/expected.lightscript.json @@ -0,0 +1,277 @@ +{ + "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 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": { + "type": "ArrayPattern", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "ObjectPattern", + "start": 4, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 5, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "b" + }, + "name": "b" + }, + "value": { + "type": "ObjectPattern", + "start": 8, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "c" + }, + "name": "c" + }, + "value": { + "type": "AssignmentPattern", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "left": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "c" + }, + "name": "c" + }, + "right": { + "type": "NumericLiteral", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + "extra": { + "shorthand": true + } + } + ] + } + } + ] + } + ] + }, + "init": { + "type": "Identifier", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "arr" + }, + "name": "arr" + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/31/expected.json b/test/fixtures/es2015/uncategorised/31/expected.json index 36e04398ee..57366e881f 100644 --- a/test/fixtures/es2015/uncategorised/31/expected.json +++ b/test/fixtures/es2015/uncategorised/31/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -90,8 +88,7 @@ "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 facb5febd6..3c759ccbfc 100644 --- a/test/fixtures/es2015/uncategorised/310/expected.json +++ b/test/fixtures/es2015/uncategorised/310/expected.json @@ -42,7 +42,6 @@ "column": 21 } }, - "await": false, "left": { "type": "ObjectPattern", "start": 5, @@ -87,8 +86,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +116,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -143,9 +140,6 @@ }, "value": 0 } - }, - "extra": { - "shorthand": true } } ] @@ -162,8 +156,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "arr" + } }, "name": "arr" }, diff --git a/test/fixtures/es2015/uncategorised/310/options.lightscript.json b/test/fixtures/es2015/uncategorised/310/options.lightscript.json new file mode 100644 index 0000000000..71c1fa3cec --- /dev/null +++ b/test/fixtures/es2015/uncategorised/310/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "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. (1:11)" +} diff --git a/test/fixtures/es2015/uncategorised/313/expected.json b/test/fixtures/es2015/uncategorised/313/expected.json index 67a25aed7f..9a9139b799 100644 --- a/test/fixtures/es2015/uncategorised/313/expected.json +++ b/test/fixtures/es2015/uncategorised/313/expected.json @@ -117,8 +117,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "message" + } }, "name": "message" }, @@ -134,13 +133,9 @@ "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 fbe0b1f788..859c4a7b48 100644 --- a/test/fixtures/es2015/uncategorised/314/expected.json +++ b/test/fixtures/es2015/uncategorised/314/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,8 +88,6 @@ "column": 21 } }, - "static": false, - "kind": "method", "computed": false, "key": { "type": "Identifier", @@ -104,15 +101,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 643da678b1..a379342239 100644 --- a/test/fixtures/es2015/uncategorised/315/expected.json +++ b/test/fixtures/es2015/uncategorised/315/expected.json @@ -42,7 +42,6 @@ "column": 33 } }, - "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -84,8 +83,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -106,8 +104,7 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "list" + } }, "name": "list" }, @@ -151,8 +148,7 @@ "end": { "line": 1, "column": 29 - }, - "identifierName": "process" + } }, "name": "process" }, @@ -169,8 +165,7 @@ "end": { "line": 1, "column": 31 - }, - "identifierName": "x" + } }, "name": "x" } @@ -178,7 +173,7 @@ } } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 a80e13719d..ec67c88b06 100644 --- a/test/fixtures/es2015/uncategorised/316/expected.json +++ b/test/fixtures/es2015/uncategorised/316/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,8 +88,6 @@ "column": 22 } }, - "static": false, - "kind": "method", "computed": false, "key": { "type": "Identifier", @@ -104,15 +101,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 d6851714da..96d4c0c179 100644 --- a/test/fixtures/es2015/uncategorised/317/expected.json +++ b/test/fixtures/es2015/uncategorised/317/expected.json @@ -131,8 +131,7 @@ "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 7359f5f6ed..7120ba7201 100644 --- a/test/fixtures/es2015/uncategorised/318/expected.json +++ b/test/fixtures/es2015/uncategorised/318/expected.json @@ -69,8 +69,7 @@ "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 5fbbef420e..8c74c8dbfb 100644 --- a/test/fixtures/es2015/uncategorised/319/expected.json +++ b/test/fixtures/es2015/uncategorised/319/expected.json @@ -69,8 +69,7 @@ "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 54989111af..5644e19a05 100644 --- a/test/fixtures/es2015/uncategorised/32/expected.json +++ b/test/fixtures/es2015/uncategorised/32/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "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 e543312c78..e314fc139a 100644 --- a/test/fixtures/es2015/uncategorised/320/expected.json +++ b/test/fixtures/es2015/uncategorised/320/expected.json @@ -84,8 +84,7 @@ "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 0aed7ab433..304fea8a0d 100644 --- a/test/fixtures/es2015/uncategorised/321/expected.json +++ b/test/fixtures/es2015/uncategorised/321/expected.json @@ -101,8 +101,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,13 +117,9 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "x" + } }, "name": "x" - }, - "extra": { - "shorthand": true } } ] @@ -141,8 +136,7 @@ "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 5b0a800f93..c8d11ad5e5 100644 --- a/test/fixtures/es2015/uncategorised/322/expected.json +++ b/test/fixtures/es2015/uncategorised/322/expected.json @@ -84,8 +84,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "x" + } }, "name": "x" }, diff --git a/test/fixtures/es2015/uncategorised/322/expected.lightscript.json b/test/fixtures/es2015/uncategorised/322/expected.lightscript.json new file mode 100644 index 0000000000..379fc0bfbc --- /dev/null +++ b/test/fixtures/es2015/uncategorised/322/expected.lightscript.json @@ -0,0 +1,122 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "ArrayPattern", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "x" + }, + "name": "x" + }, + null + ] + }, + "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 + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/323/expected.json b/test/fixtures/es2015/uncategorised/323/expected.json index 158a4615bd..6473ce385e 100644 --- a/test/fixtures/es2015/uncategorised/323/expected.json +++ b/test/fixtures/es2015/uncategorised/323/expected.json @@ -42,7 +42,6 @@ "column": 33 } }, - "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -99,8 +98,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "name" + } }, "name": "name" }, @@ -116,8 +114,7 @@ "end": { "line": 1, "column": 21 - }, - "identifierName": "value" + } }, "name": "value" } @@ -140,8 +137,7 @@ "end": { "line": 1, "column": 29 - }, - "identifierName": "obj" + } }, "name": "obj" }, @@ -159,11 +155,9 @@ "column": 33 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "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 0931f56cf1..d79ff6492c 100644 --- a/test/fixtures/es2015/uncategorised/33/expected.json +++ b/test/fixtures/es2015/uncategorised/33/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "e" + } }, "name": "e" } @@ -123,8 +121,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "property" + } }, "name": "property" }, @@ -151,8 +148,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 5 + "parenthesized": true } } } diff --git a/test/fixtures/es2015/uncategorised/336/expected.json b/test/fixtures/es2015/uncategorised/336/expected.json new file mode 100644 index 0000000000..9822daf8c2 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/336/expected.json @@ -0,0 +1,95 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "MetaProperty", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "meta": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "new" + }, + "property": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "target" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/336/options.json b/test/fixtures/es2015/uncategorised/336/options.json deleted file mode 100644 index abb78cbdb2..0000000000 --- a/test/fixtures/es2015/uncategorised/336/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 ff0188633a..909735dfe5 100644 --- a/test/fixtures/es2015/uncategorised/338/expected.json +++ b/test/fixtures/es2015/uncategorised/338/expected.json @@ -68,14 +68,12 @@ "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 3ae5cb6c96..857b44ba21 100644 --- a/test/fixtures/es2015/uncategorised/339/options.json +++ b/test/fixtures/es2015/uncategorised/339/options.json @@ -1,3 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)" + "throws": "Octal literal in strict mode (1:1)" } \ 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 93d45404a4..a7d846ffb6 100644 --- a/test/fixtures/es2015/uncategorised/34/expected.json +++ b/test/fixtures/es2015/uncategorised/34/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "e" + } }, "name": "e" } @@ -155,8 +153,7 @@ "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 78728a0062..8eea5108a9 100644 --- a/test/fixtures/es2015/uncategorised/35/expected.json +++ b/test/fixtures/es2015/uncategorised/35/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -90,8 +88,7 @@ "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 e0f955220c..9e26dfeeb6 100644 --- a/test/fixtures/es2015/uncategorised/350/expected.json +++ b/test/fixtures/es2015/uncategorised/350/expected.json @@ -1,183 +1 @@ -{ - "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 +{} \ 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 2c0aacecab..9e26dfeeb6 100644 --- a/test/fixtures/es2015/uncategorised/351/expected.json +++ b/test/fixtures/es2015/uncategorised/351/expected.json @@ -1,219 +1 @@ -{ - "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 +{} \ 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 8fc9a7d3a2..9e26dfeeb6 100644 --- a/test/fixtures/es2015/uncategorised/352/expected.json +++ b/test/fixtures/es2015/uncategorised/352/expected.json @@ -1,219 +1 @@ -{ - "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 +{} \ 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 74e2c8a1e4..9e26dfeeb6 100644 --- a/test/fixtures/es2015/uncategorised/354/expected.json +++ b/test/fixtures/es2015/uncategorised/354/expected.json @@ -1,69 +1 @@ -{ - "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 +{} \ 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 f916983e29..f77b5a851a 100644 --- a/test/fixtures/es2015/uncategorised/355/expected.json +++ b/test/fixtures/es2015/uncategorised/355/expected.json @@ -1,190 +1,503 @@ { - "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "program": { - "type": "Program", + "type": "File", "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": { + "start": { "line": 1, "column": 0 - }, - "end": { + }, + "end": { "line": 1, "column": 29 - } - }, - "id": { - "type": "Identifier", - "start": 9, - "end": 10, - "loc": { + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { "start": { - "line": 1, - "column": 9 + "line": 1, + "column": 0 }, "end": { - "line": 1, - "column": 10 + "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 }, - "identifierName": "x" - }, - "name": "x" + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + } }, - "generator": false, - "expression": false, - "async": false, - "params": [ - { - "type": "ObjectPattern", + { + "type": { + "label": "{", + "beforeExpr": true, + "startsExpr": true, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null + }, "start": 11, - "end": 25, + "end": 12, "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 25 - } + "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 }, - "properties": [ - { - "type": "ObjectProperty", - "start": 13, - "end": 23, - "loc": { - "start": { + "value": "set", + "start": 13, + "end": 16, + "loc": { + "start": { "line": 1, "column": 13 - }, - "end": { + }, + "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": { "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 }, - "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": 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 }, - "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": 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 }, - "extra": { - "shorthand": true + "end": { + "line": 1, + "column": 28 } - } - ] - } - ], - "body": { - "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 + } + }, + { + "type": { + "label": "}", + "beforeExpr": false, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null }, - "end": { - "line": 1, - "column": 29 + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + } + }, + { + "type": { + "label": "eof", + "beforeExpr": false, + "startsExpr": false, + "rightAssociative": false, + "isLoop": false, + "isAssign": false, + "prefix": false, + "postfix": false, + "binop": null, + "updateContext": null + }, + "start": 29, + "end": 29, + "loc": { + "start": { + "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/356/expected.lightscript.json b/test/fixtures/es2015/uncategorised/356/expected.lightscript.json new file mode 100644 index 0000000000..ea8e6d61f3 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/356/expected.lightscript.json @@ -0,0 +1,117 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "await" + }, + "name": "await" + }, + "init": { + "type": "CallExpression", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "callee": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "arguments": [] + } + } + ] + } + ], + "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 cdb2f5c52e..af79a9f970 100644 --- a/test/fixtures/es2015/uncategorised/36/expected.json +++ b/test/fixtures/es2015/uncategorised/36/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "ArrayPattern", @@ -88,8 +87,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -106,8 +104,7 @@ "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 e47019cdb6..d3ed02a634 100644 --- a/test/fixtures/es2015/uncategorised/39/expected.json +++ b/test/fixtures/es2015/uncategorised/39/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "AssignmentPattern", @@ -87,8 +86,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -140,8 +138,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -158,8 +155,7 @@ "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 deleted file mode 100644 index a83d19f0f8..0000000000 --- a/test/fixtures/es2015/uncategorised/394/actual.js +++ /dev/null @@ -1 +0,0 @@ -function foo() { new.target } diff --git a/test/fixtures/es2015/uncategorised/394/expected.json b/test/fixtures/es2015/uncategorised/394/expected.json deleted file mode 100644 index 30b0e8ac73..0000000000 --- a/test/fixtures/es2015/uncategorised/394/expected.json +++ /dev/null @@ -1,152 +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": "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 b7e7b61001..6e5b95dce8 100644 --- a/test/fixtures/es2015/uncategorised/40/expected.json +++ b/test/fixtures/es2015/uncategorised/40/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "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 1f49c57e2d..556e95a3ac 100644 --- a/test/fixtures/es2015/uncategorised/41/expected.json +++ b/test/fixtures/es2015/uncategorised/41/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "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 a2bf196ca0..6ba8419a8b 100644 --- a/test/fixtures/es2015/uncategorised/42/expected.json +++ b/test/fixtures/es2015/uncategorised/42/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "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 d912fa2794..6e06ca49e2 100644 --- a/test/fixtures/es2015/uncategorised/43/expected.json +++ b/test/fixtures/es2015/uncategorised/43/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "eval" + } }, "name": "eval" }, @@ -90,8 +88,7 @@ "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 84f8889f2f..f280cb57bf 100644 --- a/test/fixtures/es2015/uncategorised/44/expected.json +++ b/test/fixtures/es2015/uncategorised/44/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "AssignmentPattern", @@ -87,8 +86,7 @@ "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 31928b1851..43ee9f5e11 100644 --- a/test/fixtures/es2015/uncategorised/45/expected.json +++ b/test/fixtures/es2015/uncategorised/45/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "eval" + } }, "name": "eval" }, @@ -104,8 +102,7 @@ "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 cab6510eaf..b565e367ee 100644 --- a/test/fixtures/es2015/uncategorised/46/expected.json +++ b/test/fixtures/es2015/uncategorised/46/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "x" + } }, "name": "x" } @@ -91,14 +89,12 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "x" + } }, "name": "x" }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/es2015/uncategorised/47/expected.json b/test/fixtures/es2015/uncategorised/47/expected.json index 5b9f51fa62..03125c85dd 100644 --- a/test/fixtures/es2015/uncategorised/47/expected.json +++ b/test/fixtures/es2015/uncategorised/47/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" } @@ -96,7 +94,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -110,8 +107,7 @@ "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 864245ed88..7d5558cdaf 100644 --- a/test/fixtures/es2015/uncategorised/48/expected.json +++ b/test/fixtures/es2015/uncategorised/48/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "x" + } }, "name": "x" } @@ -96,7 +94,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -110,8 +107,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -127,8 +123,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "z" + } }, "name": "z" } @@ -160,8 +155,7 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -177,8 +171,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -194,20 +187,17 @@ "end": { "line": 1, "column": 26 - }, - "identifierName": "z" + } }, "name": "z" } ], "extra": { - "parenthesized": true, - "parenStart": 18 + "parenthesized": true } }, "extra": { - "parenthesized": true, - "parenStart": 7 + "parenthesized": true } } } diff --git a/test/fixtures/es2015/uncategorised/49/expected.json b/test/fixtures/es2015/uncategorised/49/expected.json index d6a7efe40f..5722472386 100644 --- a/test/fixtures/es2015/uncategorised/49/expected.json +++ b/test/fixtures/es2015/uncategorised/49/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -91,7 +90,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -107,14 +105,13 @@ "column": 12 } }, - "body": [], - "directives": [] + "body": [] } } ] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 8a3dd5608b..f95c3acfdb 100644 --- a/test/fixtures/es2015/uncategorised/5/expected.json +++ b/test/fixtures/es2015/uncategorised/5/expected.json @@ -54,14 +54,12 @@ "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 e5022056df..a27dc04bfa 100644 --- a/test/fixtures/es2015/uncategorised/50/expected.json +++ b/test/fixtures/es2015/uncategorised/50/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -91,7 +90,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -105,8 +103,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -122,8 +119,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "y" + } }, "name": "y" } @@ -142,14 +138,13 @@ "column": 16 } }, - "body": [], - "directives": [] + "body": [] } } ] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 ce0016fdc3..880dce74c2 100644 --- a/test/fixtures/es2015/uncategorised/52/expected.json +++ b/test/fixtures/es2015/uncategorised/52/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "method" + } }, "name": "method" }, @@ -127,7 +125,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/52/expected.lightscript.json b/test/fixtures/es2015/uncategorised/52/expected.lightscript.json new file mode 100644 index 0000000000..c9a1ae0314 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/52/expected.lightscript.json @@ -0,0 +1,162 @@ +{ + "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 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "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": 20, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "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": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/53/expected.json b/test/fixtures/es2015/uncategorised/53/expected.json index 403f65e101..7d5dce4954 100644 --- a/test/fixtures/es2015/uncategorised/53/expected.json +++ b/test/fixtures/es2015/uncategorised/53/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "method" + } }, "name": "method" }, @@ -127,7 +125,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -141,8 +138,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "test" + } }, "name": "test" } diff --git a/test/fixtures/es2015/uncategorised/53/expected.lightscript.json b/test/fixtures/es2015/uncategorised/53/expected.lightscript.json new file mode 100644 index 0000000000..c14d215cfe --- /dev/null +++ b/test/fixtures/es2015/uncategorised/53/expected.lightscript.json @@ -0,0 +1,180 @@ +{ + "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 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "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": 24, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "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": "Identifier", + "start": 13, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "test" + }, + "name": "test" + } + ], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/54/expected.json b/test/fixtures/es2015/uncategorised/54/expected.json index cc11812169..1030bf0af2 100644 --- a/test/fixtures/es2015/uncategorised/54/expected.json +++ b/test/fixtures/es2015/uncategorised/54/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -130,7 +129,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/54/expected.lightscript.json b/test/fixtures/es2015/uncategorised/54/expected.lightscript.json new file mode 100644 index 0000000000..2d277632b2 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/54/expected.lightscript.json @@ -0,0 +1,165 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "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": 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": true, + "shorthand": false, + "computed": false, + "key": { + "type": "StringLiteral", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": "method", + "raw": "'method'" + }, + "value": "method" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/55/expected.json b/test/fixtures/es2015/uncategorised/55/expected.json index a8769bfc25..0b0d3f1c10 100644 --- a/test/fixtures/es2015/uncategorised/55/expected.json +++ b/test/fixtures/es2015/uncategorised/55/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "get" + } }, "name": "get" }, @@ -127,7 +125,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/55/expected.lightscript.json b/test/fixtures/es2015/uncategorised/55/expected.lightscript.json new file mode 100644 index 0000000000..c5045994d9 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/55/expected.lightscript.json @@ -0,0 +1,162 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "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": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "get" + }, + "name": "get" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/56/expected.json b/test/fixtures/es2015/uncategorised/56/expected.json index 98450690a7..b118b76443 100644 --- a/test/fixtures/es2015/uncategorised/56/expected.json +++ b/test/fixtures/es2015/uncategorised/56/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "set" + } }, "name": "set" }, @@ -127,7 +125,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/56/expected.lightscript.json b/test/fixtures/es2015/uncategorised/56/expected.lightscript.json new file mode 100644 index 0000000000..7c0df33365 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/56/expected.lightscript.json @@ -0,0 +1,162 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "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": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "set" + }, + "name": "set" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/61/expected.json b/test/fixtures/es2015/uncategorised/61/expected.json index 17d1d997d4..660265dd75 100644 --- a/test/fixtures/es2015/uncategorised/61/expected.json +++ b/test/fixtures/es2015/uncategorised/61/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -135,13 +133,9 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "y" + } }, "name": "y" - }, - "extra": { - "shorthand": true } }, { @@ -173,8 +167,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "z" + } }, "name": "z" }, @@ -190,13 +183,9 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "z" + } }, "name": "z" - }, - "extra": { - "shorthand": true } } ] diff --git a/test/fixtures/es2015/uncategorised/61/expected.lightscript.json b/test/fixtures/es2015/uncategorised/61/expected.lightscript.json new file mode 100644 index 0000000000..40b220ac22 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/61/expected.lightscript.json @@ -0,0 +1,211 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "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": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "y" + }, + "name": "y" + }, + "value": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "y" + }, + "name": "y" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "z" + }, + "name": "z" + }, + "value": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "z" + }, + "name": "z" + }, + "extra": { + "shorthand": true + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/62/expected.json b/test/fixtures/es2015/uncategorised/62/expected.json index 65027d5460..6e74cfdbcb 100644 --- a/test/fixtures/es2015/uncategorised/62/expected.json +++ b/test/fixtures/es2015/uncategorised/62/expected.json @@ -84,8 +84,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -101,8 +100,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "b" + } }, "name": "b" } @@ -135,8 +133,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "b" + } }, "name": "b" }, @@ -152,8 +149,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "a" + } }, "name": "a" } @@ -161,7 +157,7 @@ } } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/62/expected.lightscript.json b/test/fixtures/es2015/uncategorised/62/expected.lightscript.json new file mode 100644 index 0000000000..eef9c6cfc4 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/62/expected.lightscript.json @@ -0,0 +1,169 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": { + "type": "ArrayPattern", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + } + ] + }, + "init": { + "type": "ArrayExpression", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "b" + }, + "name": "b" + }, + { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "a" + }, + "name": "a" + } + ] + } + } + ] + } + ], + "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 b52b7efed4..f17d4e7f50 100644 --- a/test/fixtures/es2015/uncategorised/63/expected.json +++ b/test/fixtures/es2015/uncategorised/63/expected.json @@ -101,8 +101,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -118,13 +117,9 @@ "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 56160d2041..d970cbce76 100644 --- a/test/fixtures/es2015/uncategorised/64/expected.json +++ b/test/fixtures/es2015/uncategorised/64/expected.json @@ -84,8 +84,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "a" + } }, "name": "a" } @@ -111,7 +110,7 @@ ], "kind": "const" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 8f76a24663..d449479dc0 100644 --- a/test/fixtures/es2015/uncategorised/65/expected.json +++ b/test/fixtures/es2015/uncategorised/65/expected.json @@ -101,8 +101,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -118,13 +117,9 @@ "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 104284ae40..58be00e51c 100644 --- a/test/fixtures/es2015/uncategorised/66/expected.json +++ b/test/fixtures/es2015/uncategorised/66/expected.json @@ -84,8 +84,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "a" + } }, "name": "a" } @@ -111,7 +110,7 @@ ], "kind": "let" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 f166d30898..5847b666e3 100644 --- a/test/fixtures/es2015/uncategorised/67/expected.json +++ b/test/fixtures/es2015/uncategorised/67/expected.json @@ -101,8 +101,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -118,13 +117,9 @@ "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 19bdfa758b..aabef1030c 100644 --- a/test/fixtures/es2015/uncategorised/68/expected.json +++ b/test/fixtures/es2015/uncategorised/68/expected.json @@ -84,8 +84,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "a" + } }, "name": "a" } @@ -111,7 +110,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 d4b8dda2a4..f2577d66d0 100644 --- a/test/fixtures/es2015/uncategorised/69/expected.json +++ b/test/fixtures/es2015/uncategorised/69/expected.json @@ -101,8 +101,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -118,8 +117,7 @@ "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 6ae7f4bf7f..a9efc0fea7 100644 --- a/test/fixtures/es2015/uncategorised/70/expected.json +++ b/test/fixtures/es2015/uncategorised/70/expected.json @@ -101,8 +101,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -118,8 +117,7 @@ "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 2175291efc..0615d247ab 100644 --- a/test/fixtures/es2015/uncategorised/71/expected.json +++ b/test/fixtures/es2015/uncategorised/71/expected.json @@ -101,8 +101,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -118,8 +117,7 @@ "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 2a45478e63..1bd46b7ac0 100644 --- a/test/fixtures/es2015/uncategorised/72/expected.json +++ b/test/fixtures/es2015/uncategorised/72/expected.json @@ -42,8 +42,6 @@ "column": 19 } }, - "specifiers": [], - "source": null, "declaration": { "type": "VariableDeclaration", "start": 7, @@ -85,8 +83,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "document" + } }, "name": "document" }, @@ -94,9 +91,11 @@ } ], "kind": "var" - } + }, + "specifiers": [], + "source": null } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 df0ab00a10..3bfdd45a05 100644 --- a/test/fixtures/es2015/uncategorised/73/expected.json +++ b/test/fixtures/es2015/uncategorised/73/expected.json @@ -42,8 +42,6 @@ "column": 25 } }, - "specifiers": [], - "source": null, "declaration": { "type": "VariableDeclaration", "start": 7, @@ -85,8 +83,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "document" + } }, "name": "document" }, @@ -109,9 +106,11 @@ } ], "kind": "var" - } + }, + "specifiers": [], + "source": null } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 02defa9c2f..83501be44d 100644 --- a/test/fixtures/es2015/uncategorised/74/expected.json +++ b/test/fixtures/es2015/uncategorised/74/expected.json @@ -42,8 +42,6 @@ "column": 19 } }, - "specifiers": [], - "source": null, "declaration": { "type": "VariableDeclaration", "start": 7, @@ -85,8 +83,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "document" + } }, "name": "document" }, @@ -94,9 +91,11 @@ } ], "kind": "let" - } + }, + "specifiers": [], + "source": null } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 080ac3a873..fe06e4b03e 100644 --- a/test/fixtures/es2015/uncategorised/75/expected.json +++ b/test/fixtures/es2015/uncategorised/75/expected.json @@ -42,8 +42,6 @@ "column": 25 } }, - "specifiers": [], - "source": null, "declaration": { "type": "VariableDeclaration", "start": 7, @@ -85,8 +83,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "document" + } }, "name": "document" }, @@ -109,9 +106,11 @@ } ], "kind": "let" - } + }, + "specifiers": [], + "source": null } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 7047c35c8e..ff09e9c318 100644 --- a/test/fixtures/es2015/uncategorised/76/expected.json +++ b/test/fixtures/es2015/uncategorised/76/expected.json @@ -42,8 +42,6 @@ "column": 27 } }, - "specifiers": [], - "source": null, "declaration": { "type": "VariableDeclaration", "start": 7, @@ -85,8 +83,7 @@ "end": { "line": 1, "column": 21 - }, - "identifierName": "document" + } }, "name": "document" }, @@ -109,9 +106,11 @@ } ], "kind": "const" - } + }, + "specifiers": [], + "source": null } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 43573a5711..9eada77464 100644 --- a/test/fixtures/es2015/uncategorised/77/expected.json +++ b/test/fixtures/es2015/uncategorised/77/expected.json @@ -42,8 +42,6 @@ "column": 27 } }, - "specifiers": [], - "source": null, "declaration": { "type": "FunctionDeclaration", "start": 7, @@ -70,14 +68,12 @@ "end": { "line": 1, "column": 21 - }, - "identifierName": "parse" + } }, "name": "parse" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -93,12 +89,13 @@ "column": 27 } }, - "body": [], - "directives": [] + "body": [] } - } + }, + "specifiers": [], + "source": null } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 8dd1cb816a..013eb146ba 100644 --- a/test/fixtures/es2015/uncategorised/78/expected.json +++ b/test/fixtures/es2015/uncategorised/78/expected.json @@ -42,8 +42,6 @@ "column": 21 } }, - "specifiers": [], - "source": null, "declaration": { "type": "ClassDeclaration", "start": 7, @@ -70,8 +68,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "Class" + } }, "name": "Class" }, @@ -92,9 +89,11 @@ }, "body": [] } - } + }, + "specifiers": [], + "source": null } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 3c9a9fc01d..364e85431c 100644 --- a/test/fixtures/es2015/uncategorised/80/expected.json +++ b/test/fixtures/es2015/uncategorised/80/expected.json @@ -59,7 +59,6 @@ "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 2296dba4c1..2bcb3a0d57 100644 --- a/test/fixtures/es2015/uncategorised/81/expected.json +++ b/test/fixtures/es2015/uncategorised/81/expected.json @@ -68,14 +68,12 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "f" + } }, "name": "f" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -91,12 +89,11 @@ "column": 30 } }, - "body": [], - "directives": [] + "body": [] } } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 6e81e442fa..fe765d760c 100644 --- a/test/fixtures/es2015/uncategorised/83/expected.json +++ b/test/fixtures/es2015/uncategorised/83/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -92,7 +91,7 @@ } } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 ec59c9ee3d..ae2d126022 100644 --- a/test/fixtures/es2015/uncategorised/86/expected.json +++ b/test/fixtures/es2015/uncategorised/86/expected.json @@ -70,8 +70,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "encrypt" + } }, "name": "encrypt" }, @@ -87,8 +86,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "encrypt" + } }, "name": "encrypt" } @@ -96,7 +94,7 @@ ], "source": null } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 e702916375..7b44c44875 100644 --- a/test/fixtures/es2015/uncategorised/87/expected.json +++ b/test/fixtures/es2015/uncategorised/87/expected.json @@ -70,8 +70,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "encrypt" + } }, "name": "encrypt" }, @@ -87,8 +86,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "encrypt" + } }, "name": "encrypt" } @@ -119,8 +117,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "decrypt" + } }, "name": "decrypt" }, @@ -136,8 +133,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "decrypt" + } }, "name": "decrypt" } @@ -145,7 +141,7 @@ ], "source": null } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 69f3a20244..afbd89b3af 100644 --- a/test/fixtures/es2015/uncategorised/88/expected.json +++ b/test/fixtures/es2015/uncategorised/88/expected.json @@ -70,8 +70,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "encrypt" + } }, "name": "encrypt" }, @@ -87,8 +86,7 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "default" + } }, "name": "default" } @@ -96,7 +94,7 @@ ], "source": null } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 a7fbc886d2..a0329fee1e 100644 --- a/test/fixtures/es2015/uncategorised/89/expected.json +++ b/test/fixtures/es2015/uncategorised/89/expected.json @@ -70,8 +70,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "encrypt" + } }, "name": "encrypt" }, @@ -87,8 +86,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "encrypt" + } }, "name": "encrypt" } @@ -119,8 +117,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "decrypt" + } }, "name": "decrypt" }, @@ -136,8 +133,7 @@ "end": { "line": 1, "column": 32 - }, - "identifierName": "dec" + } }, "name": "dec" } @@ -145,7 +141,7 @@ ], "source": null } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 95b01a403f..8fe8a8579a 100644 --- a/test/fixtures/es2015/uncategorised/9/expected.json +++ b/test/fixtures/es2015/uncategorised/9/expected.json @@ -54,14 +54,12 @@ "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 a00392fd81..2ca5064302 100644 --- a/test/fixtures/es2015/uncategorised/90/expected.json +++ b/test/fixtures/es2015/uncategorised/90/expected.json @@ -70,8 +70,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "default" + } }, "name": "default" }, @@ -87,8 +86,7 @@ "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 cf96958292..d1465085b3 100644 --- a/test/fixtures/es2015/uncategorised/92/expected.json +++ b/test/fixtures/es2015/uncategorised/92/expected.json @@ -69,8 +69,7 @@ "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 b411707a75..a6757e53fe 100644 --- a/test/fixtures/es2015/uncategorised/93/expected.json +++ b/test/fixtures/es2015/uncategorised/93/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "encrypt" + } }, "name": "encrypt" }, @@ -86,8 +85,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "encrypt" + } }, "name": "encrypt" } @@ -118,8 +116,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "decrypt" + } }, "name": "decrypt" }, @@ -135,8 +132,7 @@ "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 9de2ba1112..2ab3fc92e8 100644 --- a/test/fixtures/es2015/uncategorised/94/expected.json +++ b/test/fixtures/es2015/uncategorised/94/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "encrypt" + } }, "name": "encrypt" }, @@ -86,8 +85,7 @@ "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 0ae46ee594..9b9cd83bc5 100644 --- a/test/fixtures/es2015/uncategorised/95/expected.json +++ b/test/fixtures/es2015/uncategorised/95/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "crypto" + } }, "name": "crypto" } @@ -101,8 +100,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "decrypt" + } }, "name": "decrypt" }, @@ -118,8 +116,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "decrypt" + } }, "name": "decrypt" } @@ -150,8 +147,7 @@ "end": { "line": 1, "column": 33 - }, - "identifierName": "encrypt" + } }, "name": "encrypt" }, @@ -167,8 +163,7 @@ "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 518aaeb40a..378e45b83b 100644 --- a/test/fixtures/es2015/uncategorised/97/expected.json +++ b/test/fixtures/es2015/uncategorised/97/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "null" + } }, "name": "null" }, @@ -86,8 +85,7 @@ "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 24bc22c1fb..d29972d512 100644 --- a/test/fixtures/es2015/uncategorised/98/expected.json +++ b/test/fixtures/es2015/uncategorised/98/expected.json @@ -69,8 +69,7 @@ "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 6370008347..0e1df863cc 100644 --- a/test/fixtures/es2015/uncategorised/99/expected.json +++ b/test/fixtures/es2015/uncategorised/99/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -117,8 +116,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "v" + } }, "name": "v" } @@ -128,8 +126,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/es2016/exponentiation-operator/2/expected.json b/test/fixtures/es2016/exponentiation-operator/2/expected.json index a1034e6eab..7908853db6 100644 --- a/test/fixtures/es2016/exponentiation-operator/2/expected.json +++ b/test/fixtures/es2016/exponentiation-operator/2/expected.json @@ -117,13 +117,10 @@ "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 9f2b2bf906..b5656e2456 100644 --- a/test/fixtures/es2016/exponentiation-operator/3/expected.json +++ b/test/fixtures/es2016/exponentiation-operator/3/expected.json @@ -69,8 +69,7 @@ "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 80baa26315..0df9404a78 100644 --- a/test/fixtures/es2016/exponentiation-operator/4/expected.json +++ b/test/fixtures/es2016/exponentiation-operator/4/expected.json @@ -69,8 +69,7 @@ "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 22286c57b0..e8ad51d1b7 100644 --- a/test/fixtures/es2016/exponentiation-operator/5/expected.json +++ b/test/fixtures/es2016/exponentiation-operator/5/expected.json @@ -133,8 +133,7 @@ "value": 2 }, "extra": { - "parenthesized": true, - "parenStart": 5 + "parenthesized": true } } } diff --git a/test/fixtures/es2016/exponentiation-operator/7/expected.json b/test/fixtures/es2016/exponentiation-operator/7/expected.json index c8dbba2bbd..f61979779e 100644 --- a/test/fixtures/es2016/exponentiation-operator/7/expected.json +++ b/test/fixtures/es2016/exponentiation-operator/7/expected.json @@ -126,14 +126,10 @@ "raw": "1" }, "value": 1 - }, - "extra": { - "parenthesizedArgument": false } }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } }, "operator": "*", diff --git a/test/fixtures/es2016/exponentiation-operator/8/expected.json b/test/fixtures/es2016/exponentiation-operator/8/expected.json index 11a204dbe5..154543b04b 100644 --- a/test/fixtures/es2016/exponentiation-operator/8/expected.json +++ b/test/fixtures/es2016/exponentiation-operator/8/expected.json @@ -126,9 +126,6 @@ "raw": "1" }, "value": 1 - }, - "extra": { - "parenthesizedArgument": false } } }, diff --git a/test/fixtures/es2017/async-functions/10/expected.lightscript.json b/test/fixtures/es2017/async-functions/10/expected.lightscript.json new file mode 100644 index 0000000000..e2a009496b --- /dev/null +++ b/test/fixtures/es2017/async-functions/10/expected.lightscript.json @@ -0,0 +1,208 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "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 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "Identifier", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "async" + }, + "name": "async" + } + } + ], + "kind": "var" + }, + { + "type": "ExpressionStatement", + "start": 14, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 14, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 2 + }, + "identifierName": "x" + }, + "name": "x" + } + ], + "skinny": false, + "body": { + "type": "BinaryExpression", + "start": 21, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "left": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2017/async-functions/11/expected.json b/test/fixtures/es2017/async-functions/11/expected.json index 3d14dde860..519910a604 100644 --- a/test/fixtures/es2017/async-functions/11/expected.json +++ b/test/fixtures/es2017/async-functions/11/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "async" + } }, "name": "async" } @@ -86,14 +85,12 @@ "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 8398464169..1624ec0050 100644 --- a/test/fixtures/es2017/async-functions/12/expected.json +++ b/test/fixtures/es2017/async-functions/12/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -75,8 +74,7 @@ "end": { "line": 1, "column": 26 - }, - "identifierName": "promise" + } }, "name": "promise" } @@ -136,18 +134,15 @@ "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 02dbad929b..7656d8bdf0 100644 --- a/test/fixtures/es2017/async-functions/13/expected.json +++ b/test/fixtures/es2017/async-functions/13/expected.json @@ -73,8 +73,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "x" + } }, "name": "x" } @@ -120,8 +119,7 @@ "end": { "line": 1, "column": 35 - }, - "identifierName": "inner" + } }, "name": "inner" }, @@ -184,8 +182,7 @@ "end": { "line": 1, "column": 47 - }, - "identifierName": "x" + } }, "name": "x" } @@ -199,12 +196,11 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } ], "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 f02a870e41..236d7969c2 100644 --- a/test/fixtures/es2017/async-functions/14/expected.json +++ b/test/fixtures/es2017/async-functions/14/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -105,8 +104,7 @@ "end": { "line": 1, "column": 32 - }, - "identifierName": "promise" + } }, "name": "promise" } @@ -166,22 +164,19 @@ "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 fe07c7f6de..3e9c3b4608 100644 --- a/test/fixtures/es2017/async-functions/15/expected.json +++ b/test/fixtures/es2017/async-functions/15/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "o" + } }, "name": "o" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -173,8 +171,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -196,8 +193,7 @@ "end": { "line": 1, "column": 33 - }, - "identifierName": "promise" + } }, "name": "promise" } @@ -257,8 +253,7 @@ "end": { "line": 1, "column": 50 - }, - "identifierName": "promise" + } }, "name": "promise" } @@ -277,4 +272,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 186ab6f31f..b845c0fb22 100644 --- a/test/fixtures/es2017/async-functions/16/expected.json +++ b/test/fixtures/es2017/async-functions/16/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -89,7 +88,6 @@ "column": 48 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,11 +101,11 @@ "end": { "line": 1, "column": 21 - }, - "identifierName": "bar" + } }, "name": "bar" }, + "static": false, "kind": "method", "id": null, "generator": false, @@ -126,8 +124,7 @@ "end": { "line": 1, "column": 29 - }, - "identifierName": "promise" + } }, "name": "promise" } @@ -187,8 +184,7 @@ "end": { "line": 1, "column": 46 - }, - "identifierName": "promise" + } }, "name": "promise" } @@ -204,4 +200,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 a5afb02270..e84017c870 100644 --- a/test/fixtures/es2017/async-functions/17/expected.json +++ b/test/fixtures/es2017/async-functions/17/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -86,8 +85,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -122,8 +120,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "promise" + } }, "name": "promise" } @@ -154,8 +151,7 @@ "end": { "line": 1, "column": 35 - }, - "identifierName": "promise" + } }, "name": "promise" } @@ -164,7 +160,6 @@ ] } } - ], - "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 2b5f4bdab0..44b482a1e8 100644 --- a/test/fixtures/es2017/async-functions/18/expected.json +++ b/test/fixtures/es2017/async-functions/18/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -105,8 +104,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "promise" + } }, "name": "promise" } @@ -166,21 +164,18 @@ "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 d10cdb5808..f427340e7c 100644 --- a/test/fixtures/es2017/async-functions/19/expected.json +++ b/test/fixtures/es2017/async-functions/19/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -86,8 +85,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -117,8 +115,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "async" + } }, "name": "async" }, @@ -177,8 +174,7 @@ "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 da3b22f11f..235acc93f8 100644 --- a/test/fixtures/es2017/async-functions/20/expected.json +++ b/test/fixtures/es2017/async-functions/20/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "ok" + } }, "name": "ok" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "async" + } }, "name": "async" }, @@ -118,8 +116,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "x" + } }, "name": "x" } @@ -129,7 +126,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 e881d2604b..8c6bec9861 100644 --- a/test/fixtures/es2017/async-functions/21/expected.json +++ b/test/fixtures/es2017/async-functions/21/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -117,8 +116,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "async" + } }, "name": "async" }, @@ -168,8 +166,7 @@ "end": { "line": 1, "column": 30 - }, - "identifierName": "async" + } }, "name": "async" }, @@ -199,8 +196,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/es2017/async-functions/21/expected.lightscript.json b/test/fixtures/es2017/async-functions/21/expected.lightscript.json new file mode 100644 index 0000000000..71232fb541 --- /dev/null +++ b/test/fixtures/es2017/async-functions/21/expected.lightscript.json @@ -0,0 +1,215 @@ +{ + "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": "FunctionExpression", + "start": 1, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 14, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": { + "type": "Identifier", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "async" + }, + "name": "async" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "start": 25, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 25, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "async" + }, + "name": "async" + }, + "init": { + "type": "NumericLiteral", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + } + ] + } + ], + "directives": [], + "extra": { + "curly": true + } + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2017/async-functions/22/expected.json b/test/fixtures/es2017/async-functions/22/expected.json index 6975fdfe3b..0c05743d58 100644 --- a/test/fixtures/es2017/async-functions/22/expected.json +++ b/test/fixtures/es2017/async-functions/22/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "Test" + } }, "name": "Test" }, @@ -89,7 +88,6 @@ "column": 23 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,11 +101,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 3890646e01..a5e072a934 100644 --- a/test/fixtures/es2017/async-functions/23/expected.json +++ b/test/fixtures/es2017/async-functions/23/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "obj" + } }, "name": "obj" }, @@ -117,12 +116,10 @@ "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 bdd29cecde..1078686a77 100644 --- a/test/fixtures/es2017/async-functions/24/expected.json +++ b/test/fixtures/es2017/async-functions/24/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "obj" + } }, "name": "obj" }, @@ -117,12 +116,10 @@ "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 a3bcbae858..9b136c3ea4 100644 --- a/test/fixtures/es2017/async-functions/25/expected.json +++ b/test/fixtures/es2017/async-functions/25/expected.json @@ -42,8 +42,6 @@ "column": 30 } }, - "specifiers": [], - "source": null, "declaration": { "type": "FunctionDeclaration", "start": 7, @@ -70,8 +68,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -93,12 +90,12 @@ "column": 30 } }, - "body": [], - "directives": [] + "body": [] } - } + }, + "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 1e70bd9615..ccacb5ffa3 100644 --- a/test/fixtures/es2017/async-functions/27/expected.json +++ b/test/fixtures/es2017/async-functions/27/expected.json @@ -141,7 +141,6 @@ }, "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 d90f600a88..bde4093e1f 100644 --- a/test/fixtures/es2017/async-functions/28/expected.json +++ b/test/fixtures/es2017/async-functions/28/expected.json @@ -141,7 +141,6 @@ }, "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 b4f0aea8b8..92d6c16d7a 100644 --- a/test/fixtures/es2017/async-functions/31/expected.json +++ b/test/fixtures/es2017/async-functions/31/expected.json @@ -141,7 +141,6 @@ }, "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 7cdfabffe3..8c778ed135 100644 --- a/test/fixtures/es2017/async-functions/32/expected.json +++ b/test/fixtures/es2017/async-functions/32/expected.json @@ -141,7 +141,6 @@ }, "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 a896663d5d..bd3c1e7695 100644 --- a/test/fixtures/es2017/async-functions/7/expected.json +++ b/test/fixtures/es2017/async-functions/7/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -117,12 +116,10 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "async" + } }, "name": "async" }, - "computed": false, "value": { "type": "Identifier", "start": 6, @@ -135,13 +132,9 @@ "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 b1aba60ea4..339a3925ef 100644 --- a/test/fixtures/es2017/async-functions/8/expected.json +++ b/test/fixtures/es2017/async-functions/8/expected.json @@ -101,8 +101,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "async" + } }, "name": "async" }, @@ -118,13 +117,9 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "async" + } }, "name": "async" - }, - "extra": { - "shorthand": true } } ] @@ -155,8 +150,7 @@ "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 deleted file mode 100644 index b5d8066db5..0000000000 --- a/test/fixtures/es2017/async-functions/export-arrow/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index dd7fe7275a..0000000000 --- a/test/fixtures/es2017/async-functions/export-arrow/expected.json +++ /dev/null @@ -1,117 +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": "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/actual.js b/test/fixtures/es2017/async-functions/export/actual.js deleted file mode 100644 index 3f043e6176..0000000000 --- a/test/fixtures/es2017/async-functions/export/actual.js +++ /dev/null @@ -1,2 +0,0 @@ -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 deleted file mode 100644 index 68a60db703..0000000000 --- a/test/fixtures/es2017/async-functions/export/expected.json +++ /dev/null @@ -1,172 +0,0 @@ -{ - "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/no-method-asi/actual.js b/test/fixtures/es2017/async-functions/no-method-asi/actual.js deleted file mode 100644 index 3ed61ad65f..0000000000 --- a/test/fixtures/es2017/async-functions/no-method-asi/actual.js +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index af38bd1530..0000000000 --- a/test/fixtures/es2017/async-functions/no-method-asi/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 af9edda08a..e4e327f6b7 100644 --- a/test/fixtures/es2017/trailing-function-commas/1/expected.json +++ b/test/fixtures/es2017/trailing-function-commas/1/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "log" + } }, "name": "log" }, @@ -86,8 +85,7 @@ "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 99e64d2352..31ecdf84a7 100644 --- a/test/fixtures/es2017/trailing-function-commas/2/expected.json +++ b/test/fixtures/es2017/trailing-function-commas/2/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "log" + } }, "name": "log" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "n" + } }, "name": "n" }, @@ -92,8 +89,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "op" + } }, "name": "op" }, @@ -109,8 +105,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "val" + } }, "name": "val" } @@ -129,11 +124,9 @@ "column": 29 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "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 333b273272..84ddd9f145 100644 --- a/test/fixtures/es2017/trailing-function-commas/3/expected.json +++ b/test/fixtures/es2017/trailing-function-commas/3/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -89,7 +88,6 @@ "column": 23 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "bar" + } }, "name": "bar" }, + "static": false, "kind": "method", "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -126,8 +123,7 @@ "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 53f94b690d..74c2247c3f 100644 --- a/test/fixtures/es2017/trailing-function-commas/4/expected.json +++ b/test/fixtures/es2017/trailing-function-commas/4/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -90,8 +88,7 @@ "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 855b9666cc..bab8079535 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0000/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0000/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "x" + } }, "name": "x" } @@ -117,20 +116,14 @@ "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_0000/options.lightscript.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0000/options.lightscript.json new file mode 100644 index 0000000000..0361d7c7d2 --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0000/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (2:0)" +} \ 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 f531eb96b4..e7aa5f92ff 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0001/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0001/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "x" + } }, "name": "x" } @@ -117,20 +116,14 @@ "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/options.lightscript.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0001/options.lightscript.json new file mode 100644 index 0000000000..0361d7c7d2 --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0001/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (2:0)" +} \ 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 3840e25325..b80d317427 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0002/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0002/expected.json @@ -69,8 +69,7 @@ "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 3881fa499d..0c955c4730 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0003/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0003/expected.json @@ -84,8 +84,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -136,8 +135,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -191,8 +189,7 @@ "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 new file mode 100644 index 0000000000..5a91ab8f84 --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0003/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected , (1:6)" +} \ 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 84e28f3bd9..1c02f6ef66 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0004/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0004/expected.json @@ -115,8 +115,7 @@ "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 fd7f41293b..675fe056a3 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0005/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0005/expected.json @@ -134,8 +134,7 @@ "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 820264c6d1..dfef6b5c50 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0006/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0006/expected.json @@ -134,8 +134,7 @@ "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 560762d177..2b8d9fef9f 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0007/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0007/expected.json @@ -115,8 +115,7 @@ "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 b5794cac3a..21c911cbbc 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0008/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0008/expected.json @@ -134,8 +134,7 @@ "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 62b72404df..55ac6a29a8 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0009/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0009/expected.json @@ -134,8 +134,7 @@ "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 e5fa9ec260..7d4c8d5bb6 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0010/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0010/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -118,8 +117,7 @@ "end": { "line": 2, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" } @@ -128,8 +126,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 3b50dd8b73..f0cf8a4b53 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0011/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0011/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -137,8 +136,7 @@ "end": { "line": 2, "column": 1 - }, - "identifierName": "x" + } }, "name": "x", "leadingComments": null @@ -166,8 +164,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 6ae21e8aa6..975bfdf605 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0012/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0012/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -137,8 +136,7 @@ "end": { "line": 2, "column": 11 - }, - "identifierName": "x" + } }, "name": "x", "leadingComments": null @@ -166,8 +164,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 d1fb3ac429..d55af430c7 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0013/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0013/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "error" + } }, "name": "error" } @@ -101,16 +100,13 @@ "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 new file mode 100644 index 0000000000..930a14478b --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0013/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected , (1:8)" +} \ 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 55562ff024..1340d70360 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0014/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0014/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "error" + } }, "name": "error", "leadingComments": null, @@ -121,8 +120,7 @@ "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 new file mode 100644 index 0000000000..930a14478b --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0014/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected , (1:8)" +} \ 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 acb5183a09..fcf481f414 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0015/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0015/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "error" + } }, "name": "error", "leadingComments": null, @@ -121,8 +120,7 @@ "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 new file mode 100644 index 0000000000..930a14478b --- /dev/null +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0015/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected , (1:8)" +} \ 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 5b8946932d..e194cd4fc2 100644 --- a/test/fixtures/esprima/declaration-const/migrated_0000/expected.json +++ b/test/fixtures/esprima/declaration-const/migrated_0000/expected.json @@ -69,8 +69,7 @@ "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 72f1b62331..a68a9f9594 100644 --- a/test/fixtures/esprima/declaration-const/migrated_0001/expected.json +++ b/test/fixtures/esprima/declaration-const/migrated_0001/expected.json @@ -84,8 +84,7 @@ "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 new file mode 100644 index 0000000000..930a14478b --- /dev/null +++ b/test/fixtures/esprima/declaration-const/migrated_0001/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected , (1:8)" +} \ 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 3a4b88e0fc..3df4bb7dd4 100644 --- a/test/fixtures/esprima/declaration-const/migrated_0002/expected.json +++ b/test/fixtures/esprima/declaration-const/migrated_0002/expected.json @@ -84,8 +84,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -136,8 +135,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -188,8 +186,7 @@ "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 new file mode 100644 index 0000000000..930a14478b --- /dev/null +++ b/test/fixtures/esprima/declaration-const/migrated_0002/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected , (1:8)" +} \ 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 89d8911652..8de460e887 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0000/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0000/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "hello" + } }, "name": "hello" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -118,19 +116,16 @@ "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 01acb188ed..d8bcde0844 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0001/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0001/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "eval" + } }, "name": "eval" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -77,11 +75,9 @@ "column": 19 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "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 93d4d923bf..086e1ef65b 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0002/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0002/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "arguments" + } }, "name": "arguments" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -77,11 +75,9 @@ "column": 24 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "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 05cce3b8f3..c081c978ea 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0003/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0003/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "test" + } }, "name": "test" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "t" + } }, "name": "t" }, @@ -92,8 +89,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "t" + } }, "name": "t" } @@ -112,11 +108,9 @@ "column": 23 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "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 4b79120694..a9c517251e 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0004/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0004/expected.json @@ -68,14 +68,12 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "test" + } }, "name": "test" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -89,8 +87,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "t" + } }, "name": "t" }, @@ -106,8 +103,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "t" + } }, "name": "t" } @@ -130,8 +126,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/esprima/declaration-function/migrated_0005/expected.json b/test/fixtures/esprima/declaration-function/migrated_0005/expected.json index 1b08145eb9..5924cefb02 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0005/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0005/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "eval" + } }, "name": "eval" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -104,14 +102,12 @@ "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 a5373f5a79..3d1b214f48 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0006/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0006/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "hello" + } }, "name": "hello" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "a" + } }, "name": "a" } @@ -136,19 +133,16 @@ "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 cdfeb7b019..8bc6714852 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0007/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0007/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "hello" + } }, "name": "hello" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -92,8 +89,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "b" + } }, "name": "b" } @@ -153,19 +149,16 @@ "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 7df304a88a..6483debdcd 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0008/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0008/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "hi" + } }, "name": "hi" }, @@ -91,7 +90,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -148,23 +146,20 @@ "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 ce5cb42288..b4b770ef03 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0009/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0009/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "hi" + } }, "name": "hi" }, @@ -100,14 +99,12 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "eval" + } }, "name": "eval" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -123,15 +120,13 @@ "column": 28 } }, - "body": [], - "directives": [] + "body": [] } } } ], "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 2b88f0d953..75abd7b81c 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0010/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0010/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "hi" + } }, "name": "hi" }, @@ -100,14 +99,12 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "arguments" + } }, "name": "arguments" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -123,15 +120,13 @@ "column": 33 } }, - "body": [], - "directives": [] + "body": [] } } } ], "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 f3e529622f..71c7365c51 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0011/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0011/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "hello" + } }, "name": "hello" }, @@ -100,14 +99,12 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "hi" + } }, "name": "hi" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -164,23 +161,20 @@ "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 f79af90cc1..fac0f4b32c 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0012/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0012/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -79,8 +78,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/esprima/declaration-function/migrated_0013/expected.json b/test/fixtures/esprima/declaration-function/migrated_0013/expected.json index 511cc1461a..e9af076d07 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0013/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0013/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "universe" + } }, "name": "universe" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "__proto__" + } }, "name": "__proto__" } @@ -95,11 +92,9 @@ "column": 32 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "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 9b336de80e..cc976d4819 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0014/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0014/expected.json @@ -54,14 +54,12 @@ "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 76753120a1..9e7caa0016 100644 --- a/test/fixtures/esprima/declaration-let/migrated_0000/expected.json +++ b/test/fixtures/esprima/declaration-let/migrated_0000/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -79,7 +78,6 @@ ], "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 25e1548716..1e0f4d8fa5 100644 --- a/test/fixtures/esprima/declaration-let/migrated_0001/expected.json +++ b/test/fixtures/esprima/declaration-let/migrated_0001/expected.json @@ -84,8 +84,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -94,10 +93,8 @@ ], "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 new file mode 100644 index 0000000000..5a91ab8f84 --- /dev/null +++ b/test/fixtures/esprima/declaration-let/migrated_0001/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected , (1:6)" +} \ 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 1e45a1303f..e34ed2023b 100644 --- a/test/fixtures/esprima/declaration-let/migrated_0002/expected.json +++ b/test/fixtures/esprima/declaration-let/migrated_0002/expected.json @@ -84,8 +84,7 @@ "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 new file mode 100644 index 0000000000..5a91ab8f84 --- /dev/null +++ b/test/fixtures/esprima/declaration-let/migrated_0002/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected , (1:6)" +} \ 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 75f9f04288..6cf98a59bd 100644 --- a/test/fixtures/esprima/declaration-let/migrated_0003/expected.json +++ b/test/fixtures/esprima/declaration-let/migrated_0003/expected.json @@ -84,8 +84,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -136,8 +135,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -188,8 +186,7 @@ "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 new file mode 100644 index 0000000000..5a91ab8f84 --- /dev/null +++ b/test/fixtures/esprima/declaration-let/migrated_0003/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected , (1:6)" +} \ 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 e7c92d32b5..c6d4b5de2b 100644 --- a/test/fixtures/esprima/directive-prolog/migrated_0000/expected.json +++ b/test/fixtures/esprima/directive-prolog/migrated_0000/expected.json @@ -73,7 +73,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -116,8 +115,7 @@ "end": { "line": 1, "column": 39 - }, - "identifierName": "i" + } }, "name": "i" }, @@ -179,8 +177,7 @@ }, "arguments": [], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/esprima/directive-prolog/migrated_0001/expected.json b/test/fixtures/esprima/directive-prolog/migrated_0001/expected.json index 4530bdb97f..1acd32f8f8 100644 --- a/test/fixtures/esprima/directive-prolog/migrated_0001/expected.json +++ b/test/fixtures/esprima/directive-prolog/migrated_0001/expected.json @@ -73,7 +73,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -116,8 +115,7 @@ "end": { "line": 1, "column": 37 - }, - "identifierName": "i" + } }, "name": "i" }, @@ -179,8 +177,7 @@ }, "arguments": [], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/esprima/es2015-array-binding-pattern/.invalid-elision-after-rest/expected.json b/test/fixtures/esprima/es2015-array-binding-pattern/.invalid-elision-after-rest/expected.json new file mode 100644 index 0000000000..aa98014263 --- /dev/null +++ b/test/fixtures/esprima/es2015-array-binding-pattern/.invalid-elision-after-rest/expected.json @@ -0,0 +1,150 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "ArrayPattern", + "start": 1, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "a" + }, + { + "type": "RestElement", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "argument": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "b" + } + } + ] + } + ], + "body": { + "type": "Literal", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-01/expected.json b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-01/expected.json index 592f6f4c3a..24fe25f6c7 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,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "ArrayPattern", @@ -88,8 +87,7 @@ "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 40992a4383..38ef2920e8 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,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "ArrayPattern", @@ -88,8 +87,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -105,8 +103,7 @@ "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 99f74f62d8..74654fe30a 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,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "ArrayPattern", @@ -88,8 +87,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -119,8 +117,7 @@ "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 bf9322b67a..fe13d83e4a 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,7 +59,6 @@ "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 cf5275647d..293ba53fee 100644 --- a/test/fixtures/esprima/es2015-array-binding-pattern/elision/expected.json +++ b/test/fixtures/esprima/es2015-array-binding-pattern/elision/expected.json @@ -59,7 +59,6 @@ "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 c87cb31e23..33b9e60b18 100644 --- a/test/fixtures/esprima/es2015-array-pattern/elision/expected.json +++ b/test/fixtures/esprima/es2015-array-pattern/elision/expected.json @@ -84,8 +84,7 @@ "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 fcf997f128..85e1ffb837 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,8 +56,7 @@ "column": 7 } }, - "body": [], - "directives": [] + "body": [] }, "handler": { "type": "CatchClause", @@ -103,14 +102,12 @@ "column": 21 } }, - "body": [], - "directives": [] + "body": [] } }, "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 eba23577ef..495f1eefe4 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,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "a" + } }, "name": "a" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "ArrayPattern", @@ -94,11 +92,9 @@ "column": 17 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "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 abda652078..969c550a6a 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,7 +93,6 @@ ], "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 1c73e74ba2..af02d62272 100644 --- a/test/fixtures/esprima/es2015-array-pattern/hole/expected.json +++ b/test/fixtures/esprima/es2015-array-pattern/hole/expected.json @@ -84,8 +84,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -102,8 +101,7 @@ "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 c9f2745187..aa2233a73e 100644 --- a/test/fixtures/esprima/es2015-array-pattern/patterned-catch/expected.json +++ b/test/fixtures/esprima/es2015-array-pattern/patterned-catch/expected.json @@ -100,8 +100,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -117,8 +116,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "b" + } }, "name": "b" }, @@ -166,8 +164,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "c" + } }, "name": "c" }, @@ -183,13 +180,9 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "c" + } }, "name": "c" - }, - "extra": { - "shorthand": true } }, { @@ -221,8 +214,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "d" + } }, "name": "d" }, @@ -252,8 +244,7 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "e" + } }, "name": "e" }, @@ -308,8 +299,7 @@ "end": { "line": 1, "column": 33 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -339,8 +329,7 @@ "end": { "line": 1, "column": 36 - }, - "identifierName": "g" + } }, "name": "g" }, @@ -395,8 +384,7 @@ "end": { "line": 1, "column": 41 - }, - "identifierName": "h" + } }, "name": "h" }, @@ -426,8 +414,7 @@ "end": { "line": 1, "column": 41 - }, - "identifierName": "h" + } }, "name": "h" }, @@ -443,14 +430,10 @@ "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 89324548bf..2c0a36d06f 100644 --- a/test/fixtures/esprima/es2015-array-pattern/rest/expected.json +++ b/test/fixtures/esprima/es2015-array-pattern/rest/expected.json @@ -98,8 +98,7 @@ "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 cfeb0c0e53..6cd7a04e5a 100644 --- a/test/fixtures/esprima/es2015-array-pattern/tailing-hold/expected.json +++ b/test/fixtures/esprima/es2015-array-pattern/tailing-hold/expected.json @@ -84,8 +84,7 @@ "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 1d7d31be70..8d669b0c72 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,8 +114,7 @@ "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 187faa482d..0e0ab6da3b 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,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "a" + } }, "name": "a" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "ArrayPattern", @@ -104,8 +102,7 @@ "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 7b5862ff98..5e393f5bf2 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,8 +116,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -133,13 +132,9 @@ "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 937d51b638..8a16817fc6 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,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -90,8 +88,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "b" + } }, "name": "b" }, @@ -121,8 +118,7 @@ "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 1ab3f26f36..30aa46f59e 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,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "RestElement", @@ -87,8 +86,7 @@ "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 4ebe77e8fc..158f0af7b4 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": "Argument name clash in strict mode (1:7)" + "throws": "Unexpected token (1:6)" } 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 9910aa18c4..6b22652418 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0000/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0000/expected.json @@ -59,7 +59,6 @@ "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 b6a6ef550a..070478ffa3 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0001/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0001/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "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 0d66821115..71885e218e 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0002/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0002/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "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 36e04398ee..57366e881f 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0003/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0003/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -90,8 +88,7 @@ "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 54989111af..5644e19a05 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0004/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0004/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "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 0931f56cf1..d79ff6492c 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0005/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0005/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "e" + } }, "name": "e" } @@ -123,8 +121,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "property" + } }, "name": "property" }, @@ -151,8 +148,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 5 + "parenthesized": true } } } 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 93d45404a4..a7d846ffb6 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0006/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0006/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "e" + } }, "name": "e" } @@ -155,8 +153,7 @@ "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 78728a0062..8eea5108a9 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0007/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0007/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -90,8 +88,7 @@ "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 e47019cdb6..d3ed02a634 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0008/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0008/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "AssignmentPattern", @@ -87,8 +86,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -140,8 +138,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -158,8 +155,7 @@ "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 b7e7b61001..6e5b95dce8 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0009/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0009/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "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 1f49c57e2d..556e95a3ac 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0010/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0010/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "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 a2bf196ca0..6ba8419a8b 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0011/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0011/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "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 d912fa2794..6e06ca49e2 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0012/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0012/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "eval" + } }, "name": "eval" }, @@ -90,8 +88,7 @@ "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 84f8889f2f..f280cb57bf 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0013/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0013/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "AssignmentPattern", @@ -87,8 +86,7 @@ "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 31928b1851..43ee9f5e11 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0014/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0014/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "eval" + } }, "name": "eval" }, @@ -104,8 +102,7 @@ "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 cab6510eaf..b565e367ee 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0015/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0015/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "x" + } }, "name": "x" } @@ -91,14 +89,12 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "x" + } }, "name": "x" }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 5b9f51fa62..03125c85dd 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0016/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0016/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" } @@ -96,7 +94,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -110,8 +107,7 @@ "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 864245ed88..7d5558cdaf 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0017/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0017/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "x" + } }, "name": "x" } @@ -96,7 +94,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -110,8 +107,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -127,8 +123,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "z" + } }, "name": "z" } @@ -160,8 +155,7 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -177,8 +171,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -194,20 +187,17 @@ "end": { "line": 1, "column": 26 - }, - "identifierName": "z" + } }, "name": "z" } ], "extra": { - "parenthesized": true, - "parenStart": 18 + "parenthesized": true } }, "extra": { - "parenthesized": true, - "parenStart": 7 + "parenthesized": true } } } 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 d6a7efe40f..001ee4b78f 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0018/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0018/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -91,7 +90,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -107,14 +105,12 @@ "column": 12 } }, - "body": [], - "directives": [] + "body": [] } } ] } } - ], - "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 e5022056df..6abd542b88 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0019/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0019/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -91,7 +90,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -105,8 +103,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -122,8 +119,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "y" + } }, "name": "y" } @@ -142,14 +138,12 @@ "column": 16 } }, - "body": [], - "directives": [] + "body": [] } } ] } } - ], - "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 b8563aeaae..c0edf43c28 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0020/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0020/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "sun" + } }, "name": "sun" } @@ -91,14 +89,12 @@ "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 1df1b8a0fb..10130f3578 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,7 +27,6 @@ } }, "sourceType": "script", - "body": [], - "directives": [] + "body": [] } } \ 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 new file mode 100644 index 0000000000..c69f6a312a --- /dev/null +++ b/test/fixtures/esprima/es2015-class/.migrated_0026/expected.json @@ -0,0 +1,168 @@ +{ + "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 79c113a526..9be73d0dda 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0000/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0000/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -77,7 +76,6 @@ "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 e97e6d4957..0884478b03 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0001/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0001/expected.json @@ -54,8 +54,7 @@ "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 4827f6ca09..13ae4c94f1 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0002/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0002/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -77,7 +76,6 @@ "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 e6f951248c..dbd2563e9f 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0003/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0003/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -77,7 +76,6 @@ "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 1998fa25fd..3e510efdc1 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0004/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0004/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 14 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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 899e4f89fc..1ec03c3f48 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0005/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0005/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 14 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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", @@ -146,7 +143,6 @@ "column": 19 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -160,16 +156,15 @@ "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 aee3a382dc..c883c50114 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0006/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0006/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 14 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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", @@ -146,7 +143,6 @@ "column": 20 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -160,16 +156,15 @@ "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 30c3a5f4e6..57df44f925 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0007/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0007/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 14 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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", @@ -146,7 +143,6 @@ "column": 20 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -160,16 +156,15 @@ "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 fc5dd03053..129657a7fc 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0008/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0008/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 15 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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", @@ -146,7 +143,6 @@ "column": 21 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -160,16 +156,15 @@ "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 163cde64f1..aa0a5f9344 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0009/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0009/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,8 +88,6 @@ "column": 19 } }, - "static": false, - "kind": "method", "computed": false, "key": { "type": "Identifier", @@ -104,15 +101,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 123b5826fe..92e8ef8e43 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0010/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0010/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 18 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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", @@ -146,7 +143,6 @@ "column": 29 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -160,16 +156,15 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "b" + } }, "name": "b" }, + "static": false, "kind": "set", "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -183,8 +178,7 @@ "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 08bf6cfa7a..c6498e9b27 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0011/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0011/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 21 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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", @@ -146,7 +143,6 @@ "column": 38 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -160,16 +156,15 @@ "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", @@ -203,7 +198,6 @@ "column": 56 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -217,16 +211,15 @@ "end": { "line": 1, "column": 51 - }, - "identifierName": "a" + } }, "name": "a" }, + "static": true, "kind": "set", "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -240,8 +233,7 @@ "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 cf546974f2..fa54d94267 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0012/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0012/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 21 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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 f0fd394ac8..c7ff2d5228 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0013/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0013/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 23 } }, - "static": true, "computed": true, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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 1ff1dcca26..3a78f1bd7d 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0014/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0014/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 22 } }, - "static": true, "computed": true, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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", @@ -146,7 +143,6 @@ "column": 37 } }, - "static": true, "computed": true, "key": { "type": "Identifier", @@ -160,16 +156,15 @@ "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 fffddf1e76..ade3ae124b 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0015/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0015/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 26 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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 f382b98ada..376ca238f8 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0016/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0016/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "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 ae929ebe00..2a2d1f81f9 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0017/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0017/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 22 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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 ef96011b27..8a0d50c2c6 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0018/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0018/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 24 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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 9fc80e5ba4..72bb521716 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0019/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0019/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 26 } }, - "static": false, "computed": false, "key": { "type": "StringLiteral", @@ -111,11 +109,11 @@ }, "value": "constructor" }, + "static": false, "kind": "constructor", "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -149,7 +147,6 @@ "column": 46 } }, - "static": false, "computed": true, "key": { "type": "StringLiteral", @@ -171,11 +168,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 ae2168a01e..8ee060397d 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0020/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0020/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 31 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "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", @@ -146,7 +143,6 @@ "column": 54 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -160,16 +156,15 @@ "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 3b05492ff7..05b3f0a4ac 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0021/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0021/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ "column": 33 } }, - "static": true, "computed": true, "key": { "type": "StringLiteral", @@ -111,11 +109,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 1fd506aabc..0df98d2cb5 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0022/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0022/expected.json @@ -75,8 +75,7 @@ "body": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/esprima/es2015-class/migrated_0023/expected.json b/test/fixtures/esprima/es2015-class/migrated_0023/expected.json index 10c2f74536..f639d9d497 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0023/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0023/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -91,8 +90,7 @@ "body": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/esprima/es2015-class/migrated_0024/expected.json b/test/fixtures/esprima/es2015-class/migrated_0024/expected.json index a7903dab31..79fb874e63 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0024/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0024/expected.json @@ -94,8 +94,7 @@ "body": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/esprima/es2015-class/migrated_0025/expected.json b/test/fixtures/esprima/es2015-class/migrated_0025/expected.json index fd18daa3e9..0e93246761 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0025/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0025/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -110,8 +109,7 @@ "body": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 e1465d0c7d..62a790d784 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,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -91,7 +90,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "AssignmentPattern", @@ -119,8 +117,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "y" + } }, "name": "y" }, diff --git a/test/fixtures/esprima/es2015-default-parameter-value/migrated_0000/expected.lightscript.json b/test/fixtures/esprima/es2015-default-parameter-value/migrated_0000/expected.lightscript.json new file mode 100644 index 0000000000..843dcdd7dc --- /dev/null +++ b/test/fixtures/esprima/es2015-default-parameter-value/migrated_0000/expected.lightscript.json @@ -0,0 +1,177 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "FunctionExpression", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "left": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "y" + }, + "name": "y" + }, + "right": { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file 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 a0c1096c6f..b6a422f551 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,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "f" + } }, "name": "f" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "AssignmentPattern", @@ -89,8 +87,7 @@ "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 9d6157c40e..71590f27e6 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,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -140,7 +138,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "AssignmentPattern", @@ -168,8 +165,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "a" + } }, "name": "a" }, diff --git a/test/fixtures/esprima/es2015-default-parameter-value/migrated_0002/expected.lightscript.json b/test/fixtures/esprima/es2015-default-parameter-value/migrated_0002/expected.lightscript.json new file mode 100644 index 0000000000..5910b14f48 --- /dev/null +++ b/test/fixtures/esprima/es2015-default-parameter-value/migrated_0002/expected.lightscript.json @@ -0,0 +1,229 @@ +{ + "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", + "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": "ObjectProperty", + "start": 6, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "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": 25, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "left": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "a" + }, + "name": "a" + }, + "right": { + "type": "NumericLiteral", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file 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 0821544b30..21bd961454 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,8 +84,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -101,8 +100,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -133,8 +131,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "a" + } }, "name": "a" } diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/dup-assignment/expected.lightscript.json b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/dup-assignment/expected.lightscript.json new file mode 100644 index 0000000000..c653bcb609 --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/dup-assignment/expected.lightscript.json @@ -0,0 +1,171 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "ArrayPattern", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "a" + }, + "name": "a" + }, + null, + { + "type": "RestElement", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "argument": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + } + } + ] + }, + "init": { + "type": "NumericLiteral", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/elision/expected.lightscript.json b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/elision/expected.lightscript.json new file mode 100644 index 0000000000..d94f5c399c --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/elision/expected.lightscript.json @@ -0,0 +1,106 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "id": { + "type": "ArrayPattern", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "elements": [ + null, + null + ] + }, + "init": { + "type": "NumericLiteral", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file 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 759556e093..bdac56e368 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,8 +112,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "a" + } }, "name": "a" }, diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/member-expr-in-rest/expected.lightscript.json b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/member-expr-in-rest/expected.lightscript.json new file mode 100644 index 0000000000..a9d31aefa8 --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/member-expr-in-rest/expected.lightscript.json @@ -0,0 +1,172 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "ArrayPattern", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "elements": [ + { + "type": "RestElement", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "argument": { + "type": "MemberExpression", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "object": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "property": { + "type": "NumericLiteral", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + "computed": true + } + } + ] + }, + "init": { + "type": "NumericLiteral", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file 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 226440f306..c7ff8b5b5c 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,8 +84,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -115,8 +114,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "b" + } }, "name": "b" }, @@ -182,8 +180,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "c" + } }, "name": "c" }, @@ -227,8 +224,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "a" + } }, "name": "a" }, diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-assignment/expected.lightscript.json b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-assignment/expected.lightscript.json new file mode 100644 index 0000000000..29807df4f3 --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-assignment/expected.lightscript.json @@ -0,0 +1,308 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": { + "type": "ArrayPattern", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "AssignmentPattern", + "start": 3, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "b" + }, + "name": "b" + }, + "right": { + "type": "NumericLiteral", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + "isNowAssign": false + }, + { + "type": "AssignmentPattern", + "start": 7, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "left": { + "type": "ArrayPattern", + "start": 7, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "c" + }, + "name": "c" + }, + { + "type": "RestElement", + "start": 10, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "argument": { + "type": "MemberExpression", + "start": 13, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "object": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "a" + }, + "name": "a" + }, + "property": { + "type": "NumericLiteral", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + "computed": true + } + } + ] + }, + "right": { + "type": "ObjectExpression", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "properties": [] + }, + "isNowAssign": false + } + ] + }, + "init": { + "type": "NumericLiteral", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file 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 fc37f6abce..8420dbe0e7 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,8 +116,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -147,8 +146,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -164,14 +162,10 @@ "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 7da592c59d..a27719de05 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,8 +84,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "a" + } }, "name": "a" } diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/simple-assignment/expected.lightscript.json b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/simple-assignment/expected.lightscript.json new file mode 100644 index 0000000000..f894f4803a --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/simple-assignment/expected.lightscript.json @@ -0,0 +1,121 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": { + "type": "ArrayPattern", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "a" + }, + "name": "a" + } + ] + }, + "init": { + "type": "NumericLiteral", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file 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 fc3579f72d..96aef38f6b 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,8 +94,7 @@ "value": 0 }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/empty-object-pattern-assignment/expected.lightscript.json b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/empty-object-pattern-assignment/expected.lightscript.json new file mode 100644 index 0000000000..08839db4c1 --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/empty-object-pattern-assignment/expected.lightscript.json @@ -0,0 +1,107 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, + "id": { + "type": "ObjectPattern", + "start": 1, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "properties": [] + }, + "init": { + "type": "NumericLiteral", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file 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 327467fdf6..4bc7411940 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,8 +401,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -432,8 +431,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -463,8 +461,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "b" + } }, "name": "b" }, @@ -490,9 +487,6 @@ }, "computed": true } - }, - "extra": { - "shorthand": true } } ] diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/nested-cover-grammar/expected.lightscript.json b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/nested-cover-grammar/expected.lightscript.json new file mode 100644 index 0000000000..981da2823e --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/nested-cover-grammar/expected.lightscript.json @@ -0,0 +1,567 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "id": { + "type": "ArrayPattern", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 1, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 2, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 3, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 4, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 5, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 6, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 7, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 8, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 9, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 10, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 11, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 12, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 13, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 14, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 15, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 16, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 17, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 18, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 19, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "elements": [ + { + "type": "ObjectPattern", + "start": 20, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "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": "a" + }, + "name": "a" + }, + "value": { + "type": "AssignmentPattern", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "left": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "a" + }, + "name": "a" + }, + "right": { + "type": "MemberExpression", + "start": 23, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "object": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "b" + }, + "name": "b" + }, + "property": { + "type": "NumericLiteral", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + "computed": true + } + }, + "extra": { + "shorthand": true + } + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + "init": { + "type": "NumericLiteral", + "start": 49, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file 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 7bd635bfb1..8e0054a6b2 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,8 +101,7 @@ "end": { "line": 2, "column": 5 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -118,13 +117,9 @@ "end": { "line": 2, "column": 5 - }, - "identifierName": "a" + } }, "name": "a" - }, - "extra": { - "shorthand": true } }, { @@ -156,8 +151,7 @@ "end": { "line": 3, "column": 5 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -173,8 +167,7 @@ "end": { "line": 3, "column": 7 - }, - "identifierName": "a" + } }, "name": "a" } @@ -208,8 +201,7 @@ "end": { "line": 4, "column": 5 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -239,8 +231,7 @@ "end": { "line": 4, "column": 7 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -256,8 +247,7 @@ "end": { "line": 4, "column": 9 - }, - "identifierName": "a" + } }, "name": "a" } @@ -292,8 +282,7 @@ "end": { "line": 5, "column": 6 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -341,8 +330,7 @@ "end": { "line": 5, "column": 10 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -358,13 +346,9 @@ "end": { "line": 5, "column": 10 - }, - "identifierName": "a" + } }, "name": "a" - }, - "extra": { - "shorthand": true } } ] @@ -399,8 +383,7 @@ "end": { "line": 6, "column": 5 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -444,8 +427,7 @@ "end": { "line": 6, "column": 15 - }, - "identifierName": "some_call" + } }, "name": "some_call" }, @@ -463,8 +445,7 @@ "end": { "line": 6, "column": 19 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -500,8 +481,7 @@ "end": { "line": 7, "column": 5 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -546,8 +526,7 @@ "end": { "line": 7, "column": 12 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -577,8 +556,7 @@ "value": 0 }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/object-pattern-assignment/expected.lightscript.json b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/object-pattern-assignment/expected.lightscript.json new file mode 100644 index 0000000000..0e7f087bb7 --- /dev/null +++ b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/object-pattern-assignment/expected.lightscript.json @@ -0,0 +1,591 @@ +{ + "type": "File", + "start": 0, + "end": 85, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 85, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 85, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 1, + "end": 83, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, + "id": { + "type": "ObjectPattern", + "start": 1, + "end": 79, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + { + "type": "ObjectProperty", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "AssignmentPattern", + "start": 25, + "end": 28, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + }, + "identifierName": "a" + }, + "name": "a" + }, + "right": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + }, + "identifierName": "a" + }, + "name": "a" + }, + "isNowAssign": false + } + }, + { + "type": "ObjectProperty", + "start": 34, + "end": 41, + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 11 + } + }, + "method": false, + "shorthand": false, + "computed": true, + "key": { + "type": "Identifier", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 6 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "ObjectPattern", + "start": 38, + "end": 41, + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 5, + "column": 11 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "extra": { + "shorthand": true + } + } + ] + } + }, + { + "type": "ObjectProperty", + "start": 47, + "end": 63, + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 20 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 47, + "end": 48, + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "MemberExpression", + "start": 49, + "end": 63, + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 20 + } + }, + "object": { + "type": "CallExpression", + "start": 49, + "end": 60, + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "callee": { + "type": "Identifier", + "start": 49, + "end": 58, + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 15 + }, + "identifierName": "some_call" + }, + "name": "some_call" + }, + "arguments": [] + }, + "property": { + "type": "Identifier", + "start": 61, + "end": 62, + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 19 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": true + } + }, + { + "type": "ObjectProperty", + "start": 69, + "end": 77, + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 12 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 69, + "end": 70, + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "MemberExpression", + "start": 71, + "end": 77, + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 12 + } + }, + "object": { + "type": "ThisExpression", + "start": 71, + "end": 75, + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 10 + } + } + }, + "property": { + "type": "Identifier", + "start": 76, + "end": 77, + "loc": { + "start": { + "line": 7, + "column": 11 + }, + "end": { + "line": 7, + "column": 12 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false + } + } + ] + }, + "init": { + "type": "NumericLiteral", + "start": 82, + "end": 83, + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file 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 db5aee3169..388b1fb864 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,8 +85,7 @@ "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 b811865d67..50cc489ebb 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,7 +59,6 @@ "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 faff2790a2..abeb127a32 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,8 +98,7 @@ "value": 2 }, "extra": { - "parenthesized": true, - "parenStart": 15 + "parenthesized": true } } } 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 3c9a9fc01d..364e85431c 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,7 +59,6 @@ "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 73c18e7a0a..904f0ed8d9 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,14 +68,12 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "foo" + } }, "name": "foo" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -91,12 +89,10 @@ "column": 32 } }, - "body": [], - "directives": [] + "body": [] } } } - ], - "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 f9028639b0..dc93997faf 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,8 +86,7 @@ "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 67d273649e..7425436e1f 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,13 +54,11 @@ "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 4ff2253518..0a6a723e7b 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,8 +70,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "default" + } }, "name": "default" }, @@ -87,8 +86,7 @@ "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 f5e6ca5f81..466e385f0b 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,8 +70,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -87,8 +86,7 @@ "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 e7ef95b227..7ae9c17b81 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,8 +70,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -87,8 +86,7 @@ "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 a9e74dbdaa..65c0fa29ea 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,8 +70,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -87,8 +86,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "default" + } }, "name": "default" } @@ -119,8 +117,7 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -136,8 +133,7 @@ "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 afc8737489..396665ef21 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,8 +70,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -87,8 +86,7 @@ "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 565c75960d..09fc23f85e 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,8 +70,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -87,8 +86,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "foo" + } }, "name": "foo" } @@ -119,8 +117,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -136,8 +133,7 @@ "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 a83b57f9d5..d9b4d3f5a5 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,14 +70,12 @@ "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 8a4161daa4..88b3e7b5b3 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-function/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-function/expected.json @@ -70,14 +70,12 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "foo" + } }, "name": "foo" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -93,12 +91,10 @@ "column": 25 } }, - "body": [], - "directives": [] + "body": [] } } } - ], - "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 b263cee065..a70b2d4788 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,8 +85,7 @@ "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 31cb80c31f..9c84a45187 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,8 +70,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -87,8 +86,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "default" + } }, "name": "default" } @@ -96,7 +94,6 @@ ], "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 1ed1c02a52..0b4b274d42 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,8 +70,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -87,8 +86,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "bar" + } }, "name": "bar" } @@ -96,7 +94,6 @@ ], "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 d23e39b3e5..35d224c0d9 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,8 +70,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -87,8 +86,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "default" + } }, "name": "default" } @@ -119,8 +117,7 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -136,8 +133,7 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "bar" + } }, "name": "bar" } @@ -145,7 +141,6 @@ ], "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 393a47ca6e..7c7d2cfb8b 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,7 +46,6 @@ "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 b2d26747cb..923c934a26 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,8 +70,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -87,8 +86,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "foo" + } }, "name": "foo" } @@ -96,7 +94,6 @@ ], "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 7344150952..0694002dce 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,8 +70,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -87,8 +86,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "foo" + } }, "name": "foo" } @@ -119,8 +117,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -136,8 +133,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "bar" + } }, "name": "bar" } @@ -145,7 +141,6 @@ ], "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 96213b5828..745d2e9d0b 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,8 +70,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -87,8 +86,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "foo" + } }, "name": "foo" } @@ -119,8 +117,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -136,8 +133,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "bar" + } }, "name": "bar" } @@ -145,7 +141,6 @@ ], "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 22cb4bf78a..130b99c96e 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,8 +85,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -107,7 +106,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -123,8 +121,7 @@ "column": 31 } }, - "body": [], - "directives": [] + "body": [] } } } @@ -132,7 +129,6 @@ "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 ce76b426cc..7290654ceb 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,8 +85,7 @@ "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 2ef2274598..22ba6ec97b 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-var/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-var/expected.json @@ -85,8 +85,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -96,7 +95,6 @@ "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 22a362cc56..f81b113841 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,7 +42,6 @@ "column": 22 } }, - "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -99,8 +98,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "p" + } }, "name": "p" }, @@ -116,8 +114,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "q" + } }, "name": "q" } @@ -140,8 +137,7 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "r" + } }, "name": "r" }, @@ -161,7 +157,6 @@ } } } - ], - "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 f3e791fa62..c174207c6b 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,7 +42,6 @@ "column": 18 } }, - "await": false, "left": { "type": "ArrayPattern", "start": 5, @@ -70,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "p" + } }, "name": "p" }, @@ -87,8 +85,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "q" + } }, "name": "q" } @@ -106,8 +103,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "r" + } }, "name": "r" }, @@ -127,7 +123,6 @@ } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/for-of-array-pattern/options.lightscript.json b/test/fixtures/esprima/es2015-for-of/for-of-array-pattern/options.lightscript.json new file mode 100644 index 0000000000..5a0b5df88e --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/for-of-array-pattern/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "for-of requires a variable qualifier: `now` to reassign an existing variable, or `const`, `let`, `var` to declare a new one. (1:10)" +} 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 2f0291d7fa..bf3b9e73b7 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,7 +42,6 @@ "column": 24 } }, - "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -116,8 +115,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -133,13 +131,9 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "x" + } }, "name": "x" - }, - "extra": { - "shorthand": true } }, { @@ -171,8 +165,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -188,13 +181,9 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "y" + } }, "name": "y" - }, - "extra": { - "shorthand": true } } ] @@ -216,8 +205,7 @@ "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 a9ec1dc8a2..025d0acd2b 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,7 +42,6 @@ "column": 18 } }, - "await": false, "left": { "type": "ObjectPattern", "start": 5, @@ -87,8 +86,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -104,13 +102,9 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "x" + } }, "name": "x" - }, - "extra": { - "shorthand": true } }, { @@ -142,8 +136,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -159,13 +152,9 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "y" + } }, "name": "y" - }, - "extra": { - "shorthand": true } } ] @@ -182,8 +171,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "z" + } }, "name": "z" }, diff --git a/test/fixtures/esprima/es2015-for-of/for-of-object-pattern/options.lightscript.json b/test/fixtures/esprima/es2015-for-of/for-of-object-pattern/options.lightscript.json new file mode 100644 index 0000000000..5a0b5df88e --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/for-of-object-pattern/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "for-of requires a variable qualifier: `now` to reassign an existing variable, or `const`, `let`, `var` to declare a new one. (1:10)" +} 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 7633fb27cc..7608d6e366 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,7 +42,6 @@ "column": 22 } }, - "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -84,8 +83,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -106,8 +104,7 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "list" + } }, "name": "list" }, @@ -127,7 +124,6 @@ } } } - ], - "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 640ebe2cbf..f48045b006 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,7 +42,6 @@ "column": 20 } }, - "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -84,8 +83,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "z" + } }, "name": "z" }, @@ -106,8 +104,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "list" + } }, "name": "list" }, @@ -127,7 +124,6 @@ } } } - ], - "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 0333623699..75eaef11cf 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,7 +42,6 @@ "column": 20 } }, - "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -84,8 +83,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -106,8 +104,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "list" + } }, "name": "list" }, @@ -127,7 +124,6 @@ } } } - ], - "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 f068e87b71..32de26d7ac 100644 --- a/test/fixtures/esprima/es2015-for-of/for-of/expected.json +++ b/test/fixtures/esprima/es2015-for-of/for-of/expected.json @@ -42,7 +42,6 @@ "column": 13 } }, - "await": false, "left": { "type": "Identifier", "start": 5, @@ -55,8 +54,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "p" + } }, "name": "p" }, @@ -72,8 +70,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "q" + } }, "name": "q" }, @@ -93,7 +90,6 @@ } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/for-of/options.lightscript.json b/test/fixtures/esprima/es2015-for-of/for-of/options.lightscript.json new file mode 100644 index 0000000000..9a0fe1050a --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/for-of/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "for-of requires a variable qualifier: `now` to reassign an existing variable, or `const`, `let`, `var` to declare a new one. (1:5)" +} diff --git a/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/options.lightscript.json b/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/options.lightscript.json new file mode 100644 index 0000000000..9a0fe1050a --- /dev/null +++ b/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "for-of requires a variable qualifier: `now` to reassign an existing variable, or `const`, `let`, `var` to declare a new one. (1:5)" +} 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 08ac0ccfbd..1af67a2a58 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,7 +42,6 @@ "column": 20 } }, - "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -84,8 +83,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "of" + } }, "name": "of" }, @@ -106,8 +104,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "xyz" + } }, "name": "xyz" }, @@ -127,7 +124,6 @@ } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/.generator-parameter-binding-property-reserved/expected.json b/test/fixtures/esprima/es2015-generator/.generator-parameter-binding-property-reserved/expected.json new file mode 100644 index 0000000000..4b57db559b --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/.generator-parameter-binding-property-reserved/expected.json @@ -0,0 +1,153 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": null, + "generator": true, + "expression": false, + "params": [ + { + "type": "ObjectPattern", + "start": 11, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "properties": [ + { + "type": "Property", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "yield" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "yield" + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-declaration-with-params/expected.json b/test/fixtures/esprima/es2015-generator/generator-declaration-with-params/expected.json index 2423e57fcf..94810ff25f 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,14 +54,12 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "foo" + } }, "name": "foo" }, "generator": true, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -92,8 +89,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -109,8 +105,7 @@ "end": { "line": 1, "column": 21 - }, - "identifierName": "z" + } }, "name": "z" } @@ -129,11 +124,9 @@ "column": 25 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "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 58db0aae3b..12653936f3 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,14 +54,12 @@ "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 be45b3da43..ca953c366a 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,14 +54,12 @@ "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 1218c2a65b..a222c7d25a 100644 --- a/test/fixtures/esprima/es2015-generator/generator-declaration/expected.json +++ b/test/fixtures/esprima/es2015-generator/generator-declaration/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "foo" + } }, "name": "foo" }, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -77,11 +75,9 @@ "column": 18 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "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 db8af8e978..edd55ba2ea 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,7 +59,6 @@ "id": null, "generator": true, "expression": false, - "async": false, "params": [ { "type": "RestElement", @@ -87,8 +86,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "x" + } }, "name": "x" } @@ -112,8 +110,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 f7443b2b26..dcddd48350 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,7 +59,6 @@ "id": null, "generator": true, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -90,8 +88,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -107,8 +104,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "z" + } }, "name": "z" } @@ -131,8 +127,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 68ae729a2b..15d56c524b 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,7 +59,6 @@ "id": null, "generator": true, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -90,8 +88,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -107,8 +104,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "z" + } }, "name": "z" } @@ -169,8 +165,7 @@ "end": { "line": 1, "column": 30 - }, - "identifierName": "x" + } }, "name": "x" } @@ -180,8 +175,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 7ae471dd07..8a6fe27484 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,7 +59,6 @@ "id": null, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -131,8 +130,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/esprima/es2015-generator/generator-expression/expected.json b/test/fixtures/esprima/es2015-generator/generator-expression/expected.json index c5418c003a..9cb0b17ba1 100644 --- a/test/fixtures/esprima/es2015-generator/generator-expression/expected.json +++ b/test/fixtures/esprima/es2015-generator/generator-expression/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -79,8 +78,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-computed-name/expected.lightscript.json b/test/fixtures/esprima/es2015-generator/generator-method-with-computed-name/expected.lightscript.json new file mode 100644 index 0000000000..a47cfa0b48 --- /dev/null +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-computed-name/expected.lightscript.json @@ -0,0 +1,203 @@ +{ + "type": "File", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": null, + "generator": true, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 19, + "end": 48, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 33 + } + }, + "argument": { + "type": "ObjectExpression", + "start": 26, + "end": 48, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 33 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 28, + "end": 46, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "method": true, + "shorthand": false, + "computed": true, + "key": { + "type": "YieldExpression", + "start": 30, + "end": 40, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "delegate": false, + "argument": { + "type": "Identifier", + "start": 36, + "end": 40, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 25 + }, + "identifierName": "iter" + }, + "name": "iter" + } + }, + "kind": "method", + "id": null, + "generator": true, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 44, + "end": 46, + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ], + "directives": [], + "extra": { + "curly": true + } + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file 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 74705225ac..ef567c630d 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,8 +86,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -95,7 +94,6 @@ "id": null, "generator": true, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -109,8 +107,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -126,8 +123,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -143,8 +139,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "z" + } }, "name": "z" } @@ -169,8 +164,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 e002528905..419afbd644 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,8 +86,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -95,7 +94,6 @@ "id": null, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -169,8 +167,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 bbadbbe669..e9df81eaa9 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,8 +86,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -95,7 +94,6 @@ "id": null, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -169,8 +167,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 d700b2546d..2b1db06974 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,8 +86,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -95,7 +94,6 @@ "id": null, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -185,8 +183,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 addc5c802c..9bd0e0fc9b 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,8 +86,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -95,7 +94,6 @@ "id": null, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -150,8 +148,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/esprima/es2015-generator/generator-method/expected.json b/test/fixtures/esprima/es2015-generator/generator-method/expected.json index 9b2aa0b7c9..1edf3cf6b7 100644 --- a/test/fixtures/esprima/es2015-generator/generator-method/expected.json +++ b/test/fixtures/esprima/es2015-generator/generator-method/expected.json @@ -86,8 +86,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -95,7 +94,6 @@ "id": null, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -117,8 +115,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 d6bde8049a..39c163121b 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,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -89,8 +88,6 @@ "column": 30 } }, - "static": true, - "kind": "method", "computed": true, "key": { "type": "Identifier", @@ -104,15 +101,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 14762b81ab..655985c272 100644 --- a/test/fixtures/esprima/es2015-generator/static-generator-method/expected.json +++ b/test/fixtures/esprima/es2015-generator/static-generator-method/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -89,8 +88,6 @@ "column": 28 } }, - "static": true, - "kind": "method", "computed": false, "key": { "type": "Identifier", @@ -104,15 +101,15 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "foo" + } }, "name": "foo" }, + "static": true, + "kind": "method", "id": null, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-identifier/.invalid_function_wait/expected.json b/test/fixtures/esprima/es2015-identifier/.invalid_function_wait/expected.json new file mode 100644 index 0000000000..e1bd544880 --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/.invalid_function_wait/expected.json @@ -0,0 +1,83 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "await" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/.invalid_lone_surrogate/expected.json b/test/fixtures/esprima/es2015-identifier/.invalid_lone_surrogate/expected.json new file mode 100644 index 0000000000..8a8057346c --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/.invalid_lone_surrogate/expected.json @@ -0,0 +1,100 @@ +{ + "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 f7072bac2a..777d6344e3 100644 --- a/test/fixtures/esprima/es2015-identifier/dakuten_handakuten/expected.json +++ b/test/fixtures/esprima/es2015-identifier/dakuten_handakuten/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "゛" + } }, "name": "゛" }, @@ -86,14 +85,12 @@ "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 396895acb2..e71aacfe96 100644 --- a/test/fixtures/esprima/es2015-identifier/escaped_all/expected.json +++ b/test/fixtures/esprima/es2015-identifier/escaped_all/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "ABC" + } }, "name": "ABC" }, @@ -79,7 +78,6 @@ ], "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 3f41b58b16..720e46270b 100644 --- a/test/fixtures/esprima/es2015-identifier/escaped_math_alef/expected.json +++ b/test/fixtures/esprima/es2015-identifier/escaped_math_alef/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "𞸀" + } }, "name": "𞸀" }, @@ -79,7 +78,6 @@ ], "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 07a2586b54..aac895c761 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,8 +69,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "_𞸃" + } }, "name": "_𞸃" }, @@ -79,7 +78,6 @@ ], "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 026501e396..aeab4c908f 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,8 +69,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "𞸊𞸋" + } }, "name": "𞸊𞸋" }, @@ -79,7 +78,6 @@ ], "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 358d88dfa9..f3f71d5dd7 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,8 +69,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "𞸆_$" + } }, "name": "𞸆_$" }, @@ -79,7 +78,6 @@ ], "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 9e722d28de..538f851879 100644 --- a/test/fixtures/esprima/es2015-identifier/escaped_part/expected.json +++ b/test/fixtures/esprima/es2015-identifier/escaped_part/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "ABC" + } }, "name": "ABC" }, @@ -79,7 +78,6 @@ ], "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 9e722d28de..538f851879 100644 --- a/test/fixtures/esprima/es2015-identifier/escaped_start/expected.json +++ b/test/fixtures/esprima/es2015-identifier/escaped_start/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "ABC" + } }, "name": "ABC" }, @@ -79,7 +78,6 @@ ], "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 52be45f00f..52b66afb75 100644 --- a/test/fixtures/esprima/es2015-identifier/estimated/expected.json +++ b/test/fixtures/esprima/es2015-identifier/estimated/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "℮" + } }, "name": "℮" }, @@ -79,7 +78,6 @@ ], "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 9e5692748e..3c1f5449e8 100644 --- a/test/fixtures/esprima/es2015-identifier/ethiopic_digits/expected.json +++ b/test/fixtures/esprima/es2015-identifier/ethiopic_digits/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "_፩፪፫፬፭፮፯፰፱" + } }, "name": "_፩፪፫፬፭፮፯፰፱" }, @@ -79,7 +78,6 @@ ], "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 5f832197cf..95e4a8ea91 100644 --- a/test/fixtures/esprima/es2015-identifier/math_alef/expected.json +++ b/test/fixtures/esprima/es2015-identifier/math_alef/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "𞸀" + } }, "name": "𞸀" }, @@ -79,7 +78,6 @@ ], "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 4b704fd162..177536551c 100644 --- a/test/fixtures/esprima/es2015-identifier/math_dal_part/expected.json +++ b/test/fixtures/esprima/es2015-identifier/math_dal_part/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "_𞸃" + } }, "name": "_𞸃" }, @@ -79,7 +78,6 @@ ], "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 0cebe40a6d..d3db5f5c03 100644 --- a/test/fixtures/esprima/es2015-identifier/math_kaf_lam/expected.json +++ b/test/fixtures/esprima/es2015-identifier/math_kaf_lam/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "𞸊𞸋" + } }, "name": "𞸊𞸋" }, @@ -79,7 +78,6 @@ ], "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 50094cc9b8..5124087f99 100644 --- a/test/fixtures/esprima/es2015-identifier/math_zain_start/expected.json +++ b/test/fixtures/esprima/es2015-identifier/math_zain_start/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "𞸆_$" + } }, "name": "𞸆_$" }, @@ -79,7 +78,6 @@ ], "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 bd12000aa5..33d6f24353 100644 --- a/test/fixtures/esprima/es2015-identifier/module_await/expected.json +++ b/test/fixtures/esprima/es2015-identifier/module_await/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "await" + } }, "name": "await" }, diff --git a/test/fixtures/esprima/es2015-identifier/module_await/expected.lightscript.json b/test/fixtures/esprima/es2015-identifier/module_await/expected.lightscript.json new file mode 100644 index 0000000000..439d412402 --- /dev/null +++ b/test/fixtures/esprima/es2015-identifier/module_await/expected.lightscript.json @@ -0,0 +1,104 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "await" + }, + "name": "await" + }, + "init": { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/valid_await/expected.json b/test/fixtures/esprima/es2015-identifier/valid_await/expected.json index 096230269c..26afe27079 100644 --- a/test/fixtures/esprima/es2015-identifier/valid_await/expected.json +++ b/test/fixtures/esprima/es2015-identifier/valid_await/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "await" + } }, "name": "await" }, @@ -105,13 +104,11 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "await" + } }, "name": "await", "extra": { - "parenthesized": true, - "parenStart": 11 + "parenthesized": true } } } diff --git a/test/fixtures/esprima/es2015-identifier/weierstrass/expected.json b/test/fixtures/esprima/es2015-identifier/weierstrass/expected.json index 574f473102..0fb54a0f5f 100644 --- a/test/fixtures/esprima/es2015-identifier/weierstrass/expected.json +++ b/test/fixtures/esprima/es2015-identifier/weierstrass/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "℘" + } }, "name": "℘" }, @@ -79,7 +78,6 @@ ], "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 73debf7d79..b6bb7d481d 100644 --- a/test/fixtures/esprima/es2015-identifier/weierstrass_weierstrass/expected.json +++ b/test/fixtures/esprima/es2015-identifier/weierstrass_weierstrass/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "℘℘" + } }, "name": "℘℘" }, @@ -79,7 +78,6 @@ ], "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 c66526e4bd..918d5dc76f 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,8 +69,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "foo" + } }, "name": "foo" } @@ -101,8 +100,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -118,8 +116,7 @@ "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 2fba15cd78..1481257a6e 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,8 +69,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "foo" + } }, "name": "foo" } @@ -101,8 +100,7 @@ "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 5e065a6338..90e760b5d0 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,8 +69,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "default" + } }, "name": "default" }, @@ -86,8 +85,7 @@ "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 f7c22db61e..68eab4b614 100644 --- a/test/fixtures/esprima/es2015-import-declaration/import-default/expected.json +++ b/test/fixtures/esprima/es2015-import-declaration/import-default/expected.json @@ -69,8 +69,7 @@ "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 cf96958292..d1465085b3 100644 --- a/test/fixtures/esprima/es2015-import-declaration/import-jquery/expected.json +++ b/test/fixtures/esprima/es2015-import-declaration/import-jquery/expected.json @@ -69,8 +69,7 @@ "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 da89ac26b6..158d42da07 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,8 +69,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -86,8 +85,7 @@ "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 ca548c6d5c..a3c950ab9c 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,8 +69,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -86,8 +85,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "baz" + } }, "name": "baz" } @@ -118,8 +116,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "xyz" + } }, "name": "xyz" }, @@ -135,8 +132,7 @@ "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 26095a68b1..d328366be5 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,8 +69,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -86,8 +85,7 @@ "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 95522ee106..fa924672aa 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,8 +69,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -86,8 +85,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "bar" + } }, "name": "bar" } @@ -118,8 +116,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "baz" + } }, "name": "baz" }, @@ -135,8 +132,7 @@ "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 b4885c5259..4cffe066fd 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,8 +69,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -86,8 +85,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "bar" + } }, "name": "bar" } @@ -118,8 +116,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "baz" + } }, "name": "baz" }, @@ -135,8 +132,7 @@ "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 9cbe3e0b32..cdb990cbdc 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,8 +69,7 @@ "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 518aaeb40a..378e45b83b 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,8 +69,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "null" + } }, "name": "null" }, @@ -86,8 +85,7 @@ "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 5841ab30aa..929eaa9eab 100644 --- a/test/fixtures/esprima/es2015-lexical-declaration/migrated_0000/expected.json +++ b/test/fixtures/esprima/es2015-lexical-declaration/migrated_0000/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "answer" + } }, "name": "answer" }, @@ -116,8 +115,7 @@ "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 new file mode 100644 index 0000000000..c2ab0aba1b --- /dev/null +++ b/test/fixtures/esprima/es2015-meta-property/.invalid-new-target/expected.json @@ -0,0 +1,129 @@ +{ + "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 98424401bd..e909c85c33 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,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "f" + } }, "name": "f" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -119,8 +117,7 @@ "end": { "line": 2, "column": 9 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -150,8 +147,7 @@ "end": { "line": 2, "column": 15 - }, - "identifierName": "new" + } }, "name": "new" }, @@ -167,8 +163,7 @@ "end": { "line": 2, "column": 22 - }, - "identifierName": "target" + } }, "name": "target" } @@ -177,11 +172,9 @@ ], "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 be413af467..545d3f05a9 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,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "f" + } }, "name": "f" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -132,8 +130,7 @@ "end": { "line": 2, "column": 11 - }, - "identifierName": "new" + } }, "name": "new" }, @@ -149,8 +146,7 @@ "end": { "line": 2, "column": 18 - }, - "identifierName": "target" + } }, "name": "target" } @@ -158,11 +154,9 @@ "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 1bac964983..154850a47c 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,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "f" + } }, "name": "f" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -118,8 +116,7 @@ "end": { "line": 2, "column": 7 - }, - "identifierName": "new" + } }, "name": "new" }, @@ -135,18 +132,15 @@ "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 08af3f07a0..fdf1e48cdb 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,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -91,7 +90,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -148,8 +146,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "new" + } }, "name": "new" }, @@ -165,22 +162,19 @@ "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 78ccbda879..4480d5f16b 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,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "f" + } }, "name": "f" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -132,8 +130,7 @@ "end": { "line": 2, "column": 7 - }, - "identifierName": "new" + } }, "name": "new" }, @@ -149,8 +146,7 @@ "end": { "line": 2, "column": 14 - }, - "identifierName": "target" + } }, "name": "target" } @@ -158,11 +154,9 @@ "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 bc3f8206fa..3a85fec1a1 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,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "f" + } }, "name": "f" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -146,8 +144,7 @@ "end": { "line": 2, "column": 11 - }, - "identifierName": "new" + } }, "name": "new" }, @@ -163,8 +160,7 @@ "end": { "line": 2, "column": 18 - }, - "identifierName": "target" + } }, "name": "target" } @@ -174,11 +170,9 @@ "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 ce0016fdc3..880dce74c2 100644 --- a/test/fixtures/esprima/es2015-method-definition/migrated_0000/expected.json +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0000/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "method" + } }, "name": "method" }, @@ -127,7 +125,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0000/expected.lightscript.json b/test/fixtures/esprima/es2015-method-definition/migrated_0000/expected.lightscript.json new file mode 100644 index 0000000000..c9a1ae0314 --- /dev/null +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0000/expected.lightscript.json @@ -0,0 +1,162 @@ +{ + "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 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "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": 20, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "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": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file 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 403f65e101..7d5dce4954 100644 --- a/test/fixtures/esprima/es2015-method-definition/migrated_0001/expected.json +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0001/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "method" + } }, "name": "method" }, @@ -127,7 +125,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -141,8 +138,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "test" + } }, "name": "test" } diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0001/expected.lightscript.json b/test/fixtures/esprima/es2015-method-definition/migrated_0001/expected.lightscript.json new file mode 100644 index 0000000000..c14d215cfe --- /dev/null +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0001/expected.lightscript.json @@ -0,0 +1,180 @@ +{ + "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 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "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": 24, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "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": "Identifier", + "start": 13, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "test" + }, + "name": "test" + } + ], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file 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 cc11812169..1030bf0af2 100644 --- a/test/fixtures/esprima/es2015-method-definition/migrated_0002/expected.json +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0002/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -130,7 +129,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0002/expected.lightscript.json b/test/fixtures/esprima/es2015-method-definition/migrated_0002/expected.lightscript.json new file mode 100644 index 0000000000..2d277632b2 --- /dev/null +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0002/expected.lightscript.json @@ -0,0 +1,165 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "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": 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": true, + "shorthand": false, + "computed": false, + "key": { + "type": "StringLiteral", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": "method", + "raw": "'method'" + }, + "value": "method" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file 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 a8769bfc25..0b0d3f1c10 100644 --- a/test/fixtures/esprima/es2015-method-definition/migrated_0003/expected.json +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0003/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "get" + } }, "name": "get" }, @@ -127,7 +125,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0003/expected.lightscript.json b/test/fixtures/esprima/es2015-method-definition/migrated_0003/expected.lightscript.json new file mode 100644 index 0000000000..c5045994d9 --- /dev/null +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0003/expected.lightscript.json @@ -0,0 +1,162 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "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": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "get" + }, + "name": "get" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file 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 98450690a7..b118b76443 100644 --- a/test/fixtures/esprima/es2015-method-definition/migrated_0004/expected.json +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0004/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "set" + } }, "name": "set" }, @@ -127,7 +125,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0004/expected.lightscript.json b/test/fixtures/esprima/es2015-method-definition/migrated_0004/expected.lightscript.json new file mode 100644 index 0000000000..7c0df33365 --- /dev/null +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0004/expected.lightscript.json @@ -0,0 +1,162 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "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": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "set" + }, + "name": "set" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file 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 194bb1af4a..41fa69789a 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,8 +86,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "__proto__" + } }, "name": "__proto__" }, @@ -136,8 +135,7 @@ "end": { "line": 1, "column": 33 - }, - "identifierName": "__proto__" + } }, "name": "__proto__" }, @@ -145,7 +143,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -194,8 +191,7 @@ "end": { "line": 1, "column": 52 - }, - "identifierName": "__proto__" + } }, "name": "__proto__" }, @@ -203,7 +199,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -217,8 +212,7 @@ "end": { "line": 1, "column": 54 - }, - "identifierName": "x" + } }, "name": "x" } @@ -243,8 +237,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 0cce78e2c4..73ee6c7acf 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,8 +86,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "__proto__" + } }, "name": "__proto__" }, @@ -136,8 +135,7 @@ "end": { "line": 1, "column": 33 - }, - "identifierName": "__proto__" + } }, "name": "__proto__" }, @@ -145,7 +143,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -167,8 +164,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 afab4b37f8..8213ba1bb4 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,8 +86,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "__proto__" + } }, "name": "__proto__" }, @@ -136,8 +135,7 @@ "end": { "line": 1, "column": 29 - }, - "identifierName": "__proto__" + } }, "name": "__proto__" }, @@ -145,7 +143,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -167,8 +164,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 920dce0155..3e06b6b52c 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,8 +86,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "__proto__" + } }, "name": "__proto__" }, @@ -136,8 +135,7 @@ "end": { "line": 1, "column": 33 - }, - "identifierName": "__proto__" + } }, "name": "__proto__" }, @@ -145,7 +143,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -159,8 +156,7 @@ "end": { "line": 1, "column": 35 - }, - "identifierName": "x" + } }, "name": "x" } @@ -185,8 +181,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 82b235c2bb..a1524c4a1f 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,8 +139,7 @@ "end": { "line": 1, "column": 35 - }, - "identifierName": "__proto__" + } }, "name": "__proto__" }, @@ -148,7 +147,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -197,8 +195,7 @@ "end": { "line": 1, "column": 54 - }, - "identifierName": "__proto__" + } }, "name": "__proto__" }, @@ -206,7 +203,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -220,8 +216,7 @@ "end": { "line": 1, "column": 56 - }, - "identifierName": "x" + } }, "name": "x" } @@ -246,8 +241,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 d5af9e236d..5fe032f20e 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,8 +139,7 @@ "end": { "line": 1, "column": 35 - }, - "identifierName": "__proto__" + } }, "name": "__proto__" }, @@ -148,7 +147,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -170,8 +168,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 b77f23777c..2a6d87e4c9 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,8 +139,7 @@ "end": { "line": 1, "column": 31 - }, - "identifierName": "__proto__" + } }, "name": "__proto__" }, @@ -148,7 +147,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -170,8 +168,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 7efe87207c..d0c7453baa 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,8 +139,7 @@ "end": { "line": 1, "column": 35 - }, - "identifierName": "__proto__" + } }, "name": "__proto__" }, @@ -148,7 +147,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -162,8 +160,7 @@ "end": { "line": 1, "column": 37 - }, - "identifierName": "x" + } }, "name": "x" } @@ -188,8 +185,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 17d1d997d4..660265dd75 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,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -135,13 +133,9 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "y" + } }, "name": "y" - }, - "extra": { - "shorthand": true } }, { @@ -173,8 +167,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "z" + } }, "name": "z" }, @@ -190,13 +183,9 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "z" + } }, "name": "z" - }, - "extra": { - "shorthand": true } } ] diff --git a/test/fixtures/esprima/es2015-object-literal-property-value-shorthand/migrated_0000/expected.lightscript.json b/test/fixtures/esprima/es2015-object-literal-property-value-shorthand/migrated_0000/expected.lightscript.json new file mode 100644 index 0000000000..40b220ac22 --- /dev/null +++ b/test/fixtures/esprima/es2015-object-literal-property-value-shorthand/migrated_0000/expected.lightscript.json @@ -0,0 +1,211 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "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": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "y" + }, + "name": "y" + }, + "value": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "y" + }, + "name": "y" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "z" + }, + "name": "z" + }, + "value": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "z" + }, + "name": "z" + }, + "extra": { + "shorthand": true + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-pattern/elision/expected.json b/test/fixtures/esprima/es2015-object-pattern/elision/expected.json index 567e7248c2..5aa022ac3f 100644 --- a/test/fixtures/esprima/es2015-object-pattern/elision/expected.json +++ b/test/fixtures/esprima/es2015-object-pattern/elision/expected.json @@ -101,8 +101,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -118,13 +117,9 @@ "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 33414a4e30..360729bf4f 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,8 +56,7 @@ "column": 7 } }, - "body": [], - "directives": [] + "body": [] }, "handler": { "type": "CatchClause", @@ -103,14 +102,12 @@ "column": 21 } }, - "body": [], - "directives": [] + "body": [] } }, "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 62f2520c8c..fc8aa6cdb9 100644 --- a/test/fixtures/esprima/es2015-object-pattern/empty-fn/expected.json +++ b/test/fixtures/esprima/es2015-object-pattern/empty-fn/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "a" + } }, "name": "a" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "ObjectPattern", @@ -94,11 +92,9 @@ "column": 17 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "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 69927b7511..85430cc73f 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,7 +42,6 @@ "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 e4bc4272b8..2b66d83815 100644 --- a/test/fixtures/esprima/es2015-object-pattern/nested/expected.json +++ b/test/fixtures/esprima/es2015-object-pattern/nested/expected.json @@ -101,8 +101,7 @@ "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 4fff32b6b5..45e9261374 100644 --- a/test/fixtures/esprima/es2015-object-pattern/properties/expected.json +++ b/test/fixtures/esprima/es2015-object-pattern/properties/expected.json @@ -101,8 +101,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -118,13 +117,9 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "a" + } }, "name": "a" - }, - "extra": { - "shorthand": true } }, { @@ -156,8 +151,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "b" + } }, "name": "b" }, @@ -187,8 +181,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "b" + } }, "name": "b" }, @@ -212,9 +205,6 @@ }, "value": 0 } - }, - "extra": { - "shorthand": true } }, { @@ -246,8 +236,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "c" + } }, "name": "c" }, @@ -263,8 +252,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "d" + } }, "name": "d" } @@ -298,8 +286,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "e" + } }, "name": "e" }, @@ -329,8 +316,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -385,8 +371,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "g" + } }, "name": "g" }, @@ -417,8 +402,7 @@ "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 8a3dd5608b..f95c3acfdb 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,14 +54,12 @@ "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 95b01a403f..8fe8a8579a 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,14 +54,12 @@ "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 07716be5ae..4a17d865f7 100644 --- a/test/fixtures/esprima/es2015-rest-parameter/function-declaration/expected.json +++ b/test/fixtures/esprima/es2015-rest-parameter/function-declaration/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "f" + } }, "name": "f" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -106,8 +103,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "b" + } }, "name": "b" } @@ -127,11 +123,9 @@ "column": 22 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "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 8c72a24d81..d524d90df1 100644 --- a/test/fixtures/esprima/es2015-rest-parameter/function-expression/expected.json +++ b/test/fixtures/esprima/es2015-rest-parameter/function-expression/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -91,7 +90,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -105,8 +103,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -136,8 +133,7 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "b" + } }, "name": "b" } @@ -157,13 +153,11 @@ "column": 24 } }, - "body": [], - "directives": [] + "body": [] } } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-rest-parameter/function-expression/expected.lightscript.json b/test/fixtures/esprima/es2015-rest-parameter/function-expression/expected.lightscript.json new file mode 100644 index 0000000000..c63627099d --- /dev/null +++ b/test/fixtures/esprima/es2015-rest-parameter/function-expression/expected.lightscript.json @@ -0,0 +1,174 @@ +{ + "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 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "f" + }, + "name": "f" + }, + "init": { + "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": [], + "extra": { + "curly": true + } + } + } + } + ] + } + ], + "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 44a231cab5..b5c022b8a6 100644 --- a/test/fixtures/esprima/es2015-rest-parameter/object-method/expected.json +++ b/test/fixtures/esprima/es2015-rest-parameter/object-method/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "o" + } }, "name": "o" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -140,7 +138,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -154,8 +151,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -185,8 +181,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "b" + } }, "name": "b" } diff --git a/test/fixtures/esprima/es2015-rest-parameter/object-method/expected.lightscript.json b/test/fixtures/esprima/es2015-rest-parameter/object-method/expected.lightscript.json new file mode 100644 index 0000000000..73cba16783 --- /dev/null +++ b/test/fixtures/esprima/es2015-rest-parameter/object-method/expected.lightscript.json @@ -0,0 +1,226 @@ +{ + "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", + "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/es2015-rest-parameter/object-shorthand-method/expected.json b/test/fixtures/esprima/es2015-rest-parameter/object-shorthand-method/expected.json index 2d6b8d4961..18295991cb 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,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "method" + } }, "name": "method" }, @@ -127,7 +125,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "RestElement", @@ -155,8 +152,7 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "test" + } }, "name": "test" } diff --git a/test/fixtures/esprima/es2015-rest-parameter/object-shorthand-method/expected.lightscript.json b/test/fixtures/esprima/es2015-rest-parameter/object-shorthand-method/expected.lightscript.json new file mode 100644 index 0000000000..f1a23d969d --- /dev/null +++ b/test/fixtures/esprima/es2015-rest-parameter/object-shorthand-method/expected.lightscript.json @@ -0,0 +1,195 @@ +{ + "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", + "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/es2015-spread-element/call-multi-spread/expected.json b/test/fixtures/esprima/es2015-spread-element/call-multi-spread/expected.json index da5f595f34..2610b26d4f 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,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "x" + } }, "name": "x" } @@ -132,8 +130,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "y" + } }, "name": "y" } @@ -164,8 +161,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "z" + } }, "name": "z" } @@ -173,7 +169,6 @@ ] } } - ], - "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 acb386ac7c..dbf33a3d90 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,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -86,8 +85,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "g" + } }, "name": "g" }, @@ -132,8 +130,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "h" + } }, "name": "h" }, @@ -149,8 +146,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "i" + } }, "name": "i" } @@ -159,7 +155,6 @@ ] } } - ], - "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 3f66a557a0..4200d9b278 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,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "x" + } }, "name": "x" } @@ -118,8 +116,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -135,15 +132,13 @@ "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 3d2342021a..bd72b46cfa 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,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "f" + } }, "name": "f" }, diff --git a/test/fixtures/esprima/es2015-spread-element/call-spread-number/options.lightscript.json b/test/fixtures/esprima/es2015-spread-element/call-spread-number/options.lightscript.json new file mode 100644 index 0000000000..467963ea9e --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/call-spread-number/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Decimal numbers must be prefixed with a `0` in LightScript (eg; `0.1`). (1:5)" +} \ No newline at end of file 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 c1106662f9..f85b3967a4 100644 --- a/test/fixtures/esprima/es2015-spread-element/call-spread/expected.json +++ b/test/fixtures/esprima/es2015-spread-element/call-spread/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "g" + } }, "name": "g" } @@ -109,7 +107,6 @@ ] } } - ], - "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 2289f83586..8a3987d6e0 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,8 +68,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "x" + } }, "name": "x" } @@ -132,8 +130,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "y" + } }, "name": "y" } @@ -164,8 +161,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "z" + } }, "name": "z" } @@ -173,7 +169,6 @@ ] } } - ], - "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 2281e8e385..79688da6aa 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,8 +68,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -86,8 +85,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "g" + } }, "name": "g" }, @@ -132,8 +130,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "h" + } }, "name": "h" }, @@ -149,8 +146,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "i" + } }, "name": "i" } @@ -159,7 +155,6 @@ ] } } - ], - "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 c015f67ef3..7075fa833c 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,8 +68,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "x" + } }, "name": "x" } @@ -118,8 +116,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -135,15 +132,13 @@ "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 1fe99acde7..0b6b85b9b7 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,8 +68,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "f" + } }, "name": "f" }, diff --git a/test/fixtures/esprima/es2015-spread-element/new-spread-number/options.lightscript.json b/test/fixtures/esprima/es2015-spread-element/new-spread-number/options.lightscript.json new file mode 100644 index 0000000000..1261978fa3 --- /dev/null +++ b/test/fixtures/esprima/es2015-spread-element/new-spread-number/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Decimal numbers must be prefixed with a `0` in LightScript (eg; `0.1`). (1:9)" +} \ No newline at end of file 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 72ba2c94f2..a5a4974201 100644 --- a/test/fixtures/esprima/es2015-spread-element/new-spread/expected.json +++ b/test/fixtures/esprima/es2015-spread-element/new-spread/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "g" + } }, "name": "g" } @@ -109,7 +107,6 @@ ] } } - ], - "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 new file mode 100644 index 0000000000..051ec3a5b8 --- /dev/null +++ b/test/fixtures/esprima/es2015-super-property/.invalid_super_id/expected.json @@ -0,0 +1,232 @@ +{ + "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 6f97b22f32..76dcbec057 100644 --- a/test/fixtures/esprima/es2015-super-property/arrow_super/expected.json +++ b/test/fixtures/esprima/es2015-super-property/arrow_super/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -71,8 +70,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "B" + } }, "name": "B" }, @@ -105,7 +103,6 @@ "column": 5 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -119,16 +116,15 @@ "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", @@ -176,7 +172,6 @@ "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 1e275d8625..aad408ba61 100644 --- a/test/fixtures/esprima/es2015-super-property/constructor_super/expected.json +++ b/test/fixtures/esprima/es2015-super-property/constructor_super/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -71,8 +70,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "B" + } }, "name": "B" }, @@ -105,7 +103,6 @@ "column": 5 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -119,16 +116,15 @@ "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 270481875a..4bf3b459c2 100644 --- a/test/fixtures/esprima/es2015-super-property/new_super/expected.json +++ b/test/fixtures/esprima/es2015-super-property/new_super/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -71,8 +70,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "B" + } }, "name": "B" }, @@ -105,7 +103,6 @@ "column": 5 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -119,16 +116,15 @@ "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", @@ -214,8 +210,7 @@ "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 0fc729cbe9..5e81ff357e 100644 --- a/test/fixtures/esprima/es2015-super-property/super_computed/expected.json +++ b/test/fixtures/esprima/es2015-super-property/super_computed/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -71,8 +70,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "B" + } }, "name": "B" }, @@ -105,7 +103,6 @@ "column": 5 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -119,16 +116,15 @@ "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 7b48047fec..9b939e582b 100644 --- a/test/fixtures/esprima/es2015-super-property/super_member/expected.json +++ b/test/fixtures/esprima/es2015-super-property/super_member/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -71,8 +70,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "B" + } }, "name": "B" }, @@ -105,7 +103,6 @@ "column": 5 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -119,16 +116,15 @@ "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", @@ -200,8 +196,7 @@ "end": { "line": 3, "column": 22 - }, - "identifierName": "y" + } }, "name": "y" }, diff --git a/test/fixtures/esprima/es2015-template-literals/.octal-literal/expected.json b/test/fixtures/esprima/es2015-template-literals/.octal-literal/expected.json new file mode 100644 index 0000000000..9ebd9cc590 --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/.octal-literal/expected.json @@ -0,0 +1,86 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": { + "raw": "\\00", + "cooked": "\u0000" + }, + "tail": true + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/.strict-octal-literal/expected.json b/test/fixtures/esprima/es2015-template-literals/.strict-octal-literal/expected.json new file mode 100644 index 0000000000..7ffc243c53 --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/.strict-octal-literal/expected.json @@ -0,0 +1,119 @@ +{ + "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/after-switch/options.lightscript.json b/test/fixtures/esprima/es2015-template-literals/after-switch/options.lightscript.json new file mode 100644 index 0000000000..26c20de8cb --- /dev/null +++ b/test/fixtures/esprima/es2015-template-literals/after-switch/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Paren-free test expressions must be followed by braces or a colon. (1:13)" +} \ 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 8b41104a7b..094ec18811 100644 --- a/test/fixtures/esprima/es2015-template-literals/dollar-sign/expected.json +++ b/test/fixtures/esprima/es2015-template-literals/dollar-sign/expected.json @@ -81,7 +81,6 @@ ] } } - ], - "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 3653254bf5..3afaacea6e 100644 --- a/test/fixtures/esprima/es2015-template-literals/escape-sequences/expected.json +++ b/test/fixtures/esprima/es2015-template-literals/escape-sequences/expected.json @@ -69,8 +69,7 @@ "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 3ae5cb6c96..857b44ba21 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": "Invalid escape sequence in template (1:2)" + "throws": "Octal literal in strict mode (1:1)" } \ 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 11aeefbebd..836d521625 100644 --- a/test/fixtures/esprima/es2015-template-literals/line-terminators/expected.json +++ b/test/fixtures/esprima/es2015-template-literals/line-terminators/expected.json @@ -69,8 +69,7 @@ "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 46f2eb813d..1a1ed2bb2a 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,8 +69,7 @@ "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 76377676ec..08da84c059 100644 --- a/test/fixtures/esprima/es2015-template-literals/new-expression/expected.json +++ b/test/fixtures/esprima/es2015-template-literals/new-expression/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "raw" + } }, "name": "raw" }, @@ -129,7 +128,6 @@ "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 9b083f0902..1308a48aaa 100644 --- a/test/fixtures/esprima/es2015-template-literals/tagged-interpolation/expected.json +++ b/test/fixtures/esprima/es2015-template-literals/tagged-interpolation/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "raw" + } }, "name": "raw" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "name" + } }, "name": "name" } @@ -151,7 +149,6 @@ } } } - ], - "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 38d9108763..dd145facf5 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,8 +68,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "raw" + } }, "name": "raw" }, @@ -263,7 +262,6 @@ } } } - ], - "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 6b4305de3b..3eabcd73c8 100644 --- a/test/fixtures/esprima/es2015-template-literals/tagged/expected.json +++ b/test/fixtures/esprima/es2015-template-literals/tagged/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "raw" + } }, "name": "raw" }, @@ -113,7 +112,6 @@ } } } - ], - "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 ad16fe02ef..f0f8b0bf3c 100644 --- a/test/fixtures/esprima/es2015-template-literals/untagged/expected.json +++ b/test/fixtures/esprima/es2015-template-literals/untagged/expected.json @@ -81,7 +81,6 @@ ] } } - ], - "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 8dd034ae3c..c6f9f2ce0e 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,8 +69,7 @@ "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 8f6e279539..5c97440415 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,8 +69,7 @@ "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 b61b0b1bdc..05e4851182 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,8 +69,7 @@ "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 new file mode 100644 index 0000000000..dd6a552b65 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-arrow-default/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": "FunctionDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "g" + }, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 16, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 16, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 17, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "left": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "x" + }, + "right": { + "type": "YieldExpression", + "start": 21, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "delegate": false, + "argument": { + "type": "Literal", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-name/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-name/expected.json new file mode 100644 index 0000000000..608a26d547 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-name/expected.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "yield" + }, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-parameter/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-parameter/expected.json new file mode 100644 index 0000000000..df826e036e --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-parameter/expected.json @@ -0,0 +1,101 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": null, + "generator": true, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "yield" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-rest/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-rest/expected.json new file mode 100644 index 0000000000..e99f09b954 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-rest/expected.json @@ -0,0 +1,132 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": null, + "generator": true, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "x" + }, + { + "type": "RestElement", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "argument": { + "type": "Identifier", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "yield" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "body": [] + }, + "parenthesizedExpression": true + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-parameter/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-parameter/expected.json new file mode 100644 index 0000000000..a5588e4e19 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-parameter/expected.json @@ -0,0 +1,100 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "g" + }, + "generator": true, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "yield" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-rest/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-rest/expected.json new file mode 100644 index 0000000000..eb042938fb --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-rest/expected.json @@ -0,0 +1,163 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "g" + }, + "generator": true, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "b" + }, + { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "c" + }, + { + "type": "RestElement", + "start": 21, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "argument": { + "type": "Identifier", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "name": "yield" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 30, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "body": [] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-array-pattern/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-array-pattern/expected.json new file mode 100644 index 0000000000..9f91e65aeb --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-array-pattern/expected.json @@ -0,0 +1,150 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 15, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 15, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "yield" + } + ] + }, + "right": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "name": "x" + }, + "extra": { + "parenthesized": true + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "type": "DirectiveLiteral", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "raw": "\"use strict\"", + "value": "use strict" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-arrow-parameter-default/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-arrow-parameter-default/expected.json new file mode 100644 index 0000000000..cab8ff9322 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-arrow-parameter-default/expected.json @@ -0,0 +1,164 @@ +{ + "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 new file mode 100644 index 0000000000..ce0cbfa1fb --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-arrow-parameter-name/expected.json @@ -0,0 +1,136 @@ +{ + "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 new file mode 100644 index 0000000000..4887c0fc44 --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/.yield-generator-arrow-concise-body/expected.json @@ -0,0 +1,183 @@ +{ + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "g" + }, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 16, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 16, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "x" + } + ], + "body": { + "type": "BinaryExpression", + "start": 23, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "left": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "x" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "name": "yield" + } + } + } + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/.yield-generator-function-parameter/expected.json b/test/fixtures/esprima/es2015-yield/.yield-generator-function-parameter/expected.json new file mode 100644 index 0000000000..e8b2f8224a --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/.yield-generator-function-parameter/expected.json @@ -0,0 +1,185 @@ +{ + "type": "File", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "g" + }, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 16, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 20, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "id": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "z" + }, + "init": { + "type": "FunctionExpression", + "start": 24, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 33, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "name": "yield" + } + ], + "body": { + "type": "BlockStatement", + "start": 40, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "body": [] + } + } + } + ], + "kind": "var" + } + ] + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/options.json index 5ebcbbe858..7b7329bb7e 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": "yield is a reserved word (1:30)" -} + "throws": "Unexpected token (1:30)" +} \ No newline at end of file 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 ab645bdf60..aca079ee39 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": "yield is a reserved word (1:20)" -} + "throws": "Unexpected token (1:20)" +} \ No newline at end of file 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 f4504039ab..c9ba88af97 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": "yield is a reserved word (1:47)" -} + "throws": "Unexpected token (1:47)" +} \ No newline at end of file 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 ab645bdf60..aca079ee39 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": "yield is a reserved word (1:20)" -} + "throws": "Unexpected token (1:20)" +} \ No newline at end of file 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 b29ca62b42..2ddc9e708f 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": "yield is a reserved word (1:23)" -} + "throws": "Unexpected token (1:23)" +} \ No newline at end of file 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 5d2e075e37..f55830c1c3 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": "yield is a reserved word (1:28)" -} + "throws": "Unexpected token (1:28)" +} \ No newline at end of file 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 4e58c050ba..b242442b4c 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": "yield is a reserved word (1:25)" -} + "throws": "Unexpected token (1:25)" +} \ No newline at end of file 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 a6620a0567..2a73699bc2 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": "yield is a reserved word (1:18)" -} + "throws": "Unexpected token (1:18)" +} \ No newline at end of file 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 a6620a0567..2a73699bc2 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": "yield is a reserved word (1:18)" -} + "throws": "Unexpected token (1:18)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-array-pattern/expected.json b/test/fixtures/esprima/es2015-yield/yield-array-pattern/expected.json index 965e2ec8ef..7a4fbd86f6 100644 --- a/test/fixtures/esprima/es2015-yield/yield-array-pattern/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-array-pattern/expected.json @@ -84,8 +84,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "yield" + } }, "name": "yield" } @@ -103,14 +102,12 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "x" + } }, "name": "x" }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/esprima/es2015-yield/yield-array-pattern/expected.lightscript.json b/test/fixtures/esprima/es2015-yield/yield-array-pattern/expected.lightscript.json new file mode 100644 index 0000000000..7b46fd1acf --- /dev/null +++ b/test/fixtures/esprima/es2015-yield/yield-array-pattern/expected.lightscript.json @@ -0,0 +1,122 @@ +{ + "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 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 1, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, + "id": { + "type": "ArrayPattern", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 2, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "yield" + }, + "name": "yield" + } + ] + }, + "init": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file 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 979a5b2d8f..81505c98aa 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,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "x" + } }, "name": "x" } @@ -105,8 +103,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -123,15 +120,13 @@ "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 f21f16b122..524a90fb9e 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,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "z" + } }, "name": "z" } @@ -134,8 +132,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "yield" + } }, "name": "yield" }, @@ -152,19 +149,16 @@ "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 4e9be7eb6c..2058074918 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,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "AssignmentPattern", @@ -87,8 +86,7 @@ "end": { "line": 1, "column": 2 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -104,8 +102,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "yield" + } }, "name": "yield" } @@ -125,12 +122,10 @@ "column": 17 } }, - "body": [], - "directives": [] + "body": [] } } } - ], - "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 482f30d4af..ac4ee8bf0c 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,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "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 3cf2edca58..09eb1bcbb8 100644 --- a/test/fixtures/esprima/es2015-yield/yield-binding-element/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-binding-element/expected.json @@ -101,8 +101,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "yield" + } }, "name": "yield" } @@ -138,8 +136,7 @@ "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 0799aa00f4..7b85a9fef5 100644 --- a/test/fixtures/esprima/es2015-yield/yield-binding-property/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-binding-property/expected.json @@ -101,8 +101,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "yield" + } }, "name": "yield" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "x" + } }, "name": "x" } @@ -138,8 +136,7 @@ "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 96faaad623..2e11c61b3c 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,14 +54,12 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "g" + } }, "name": "g" }, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -132,8 +130,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "obj" + } }, "name": "obj" }, @@ -149,8 +146,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "yield" + } }, "name": "yield" }, @@ -159,11 +155,9 @@ "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 1aaf0aa249..3cba41671f 100644 --- a/test/fixtures/esprima/es2015-yield/yield-catch-parameter/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-catch-parameter/expected.json @@ -56,8 +56,7 @@ "column": 6 } }, - "body": [], - "directives": [] + "body": [] }, "handler": { "type": "CatchClause", @@ -85,8 +84,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "yield" + } }, "name": "yield" }, @@ -104,14 +102,12 @@ "column": 23 } }, - "body": [], - "directives": [] + "body": [] } }, "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 0af9249a29..8a39ff485d 100644 --- a/test/fixtures/esprima/es2015-yield/yield-expression-precedence/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-expression-precedence/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "g" + } }, "name": "g" }, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -149,8 +147,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -166,8 +163,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "b" + } }, "name": "b" } @@ -215,8 +211,7 @@ "end": { "line": 1, "column": 35 - }, - "identifierName": "c" + } }, "name": "c" }, @@ -232,8 +227,7 @@ "end": { "line": 1, "column": 37 - }, - "identifierName": "d" + } }, "name": "d" } @@ -251,19 +245,16 @@ "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 1bcf0b31b8..f16d4b50a4 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,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "f" + } }, "name": "f" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "yield" + } }, "name": "yield" } @@ -95,11 +92,9 @@ "column": 20 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "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 7a94e29140..18ef7bd43a 100644 --- a/test/fixtures/esprima/es2015-yield/yield-function-declaration/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-function-declaration/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "yield" + } }, "name": "yield" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -77,11 +75,9 @@ "column": 18 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "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 792d4b5170..72a06d9cce 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,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -73,8 +72,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "yield" + } }, "name": "yield" } @@ -97,8 +95,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 69b03706fd..a2138f73ef 100644 --- a/test/fixtures/esprima/es2015-yield/yield-function-expression/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-function-expression/expected.json @@ -68,14 +68,12 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "yield" + } }, "name": "yield" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -95,8 +93,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 92d1ed64ad..f9c4899032 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,14 +54,12 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "g" + } }, "name": "g" }, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -109,7 +107,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "AssignmentPattern", @@ -137,8 +134,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -175,16 +171,13 @@ "column": 33 } }, - "body": [], - "directives": [] + "body": [] } } } - ], - "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 5e171cab8f..8ee47195d3 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,14 +54,12 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "g" + } }, "name": "g" }, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -109,7 +107,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -123,8 +120,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "z" + } }, "name": "z" } @@ -184,8 +180,7 @@ "end": { "line": 1, "column": 30 - }, - "identifierName": "yield" + } }, "name": "yield" }, @@ -202,23 +197,19 @@ "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 b8920d91bb..76d7225d05 100644 --- a/test/fixtures/esprima/es2015-yield/yield-generator-declaration/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-generator-declaration/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "yield" + } }, "name": "yield" }, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -77,11 +75,9 @@ "column": 19 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "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 d9dc1ed5e4..272c0b0c3d 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,14 +54,12 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "g" + } }, "name": "g" }, "generator": true, "expression": false, - "async": false, "params": [ { "type": "AssignmentPattern", @@ -89,8 +87,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -106,8 +103,7 @@ "end": { "line": 1, "column": 21 - }, - "identifierName": "yield" + } }, "name": "yield" } @@ -127,11 +123,9 @@ "column": 24 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "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 9625fd5709..660094298e 100644 --- a/test/fixtures/esprima/es2015-yield/yield-generator-method/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-generator-method/expected.json @@ -86,8 +86,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "yield" + } }, "name": "yield" }, @@ -95,7 +94,6 @@ "id": null, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -117,8 +115,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 ac7d7b8b51..b212d5a14f 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,14 +54,12 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "g" + } }, "name": "g" }, "generator": true, "expression": false, - "async": false, "params": [ { "type": "ObjectPattern", @@ -107,8 +105,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "yield" + } }, "name": "yield" }, @@ -124,8 +121,7 @@ "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 6de43b2eb8..ecbe7ba7c5 100644 --- a/test/fixtures/esprima/es2015-yield/yield-lexical-declaration/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-lexical-declaration/expected.json @@ -69,8 +69,7 @@ "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 fe001abdb5..091dac5d5d 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,14 +54,12 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "g" + } }, "name": "g" }, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -133,8 +131,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "obj" + } }, "name": "obj" }, @@ -150,8 +147,7 @@ "end": { "line": 1, "column": 31 - }, - "identifierName": "yield" + } }, "name": "yield" }, @@ -159,11 +155,9 @@ } } } - ], - "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 b10ddb8590..73a6d2827d 100644 --- a/test/fixtures/esprima/es2015-yield/yield-method/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-method/expected.json @@ -86,8 +86,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "yield" + } }, "name": "yield" }, @@ -95,7 +94,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -117,8 +115,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } 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 b5c586eeee..f0dc7b4f27 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,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "f" + } }, "name": "f" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "ObjectPattern", @@ -107,8 +105,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "yield" + } }, "name": "yield" }, @@ -124,8 +121,7 @@ "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 90d608359f..bfd5f8f9d2 100644 --- a/test/fixtures/esprima/es2015-yield/yield-rest-parameter/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-rest-parameter/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "f" + } }, "name": "f" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "RestElement", @@ -89,8 +87,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "yield" + } }, "name": "yield" } @@ -110,11 +107,9 @@ "column": 23 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "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 d88ed08060..687e8f341a 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,8 +101,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "yield" + } }, "name": "yield" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 28 - }, - "identifierName": "x" + } }, "name": "x" } @@ -138,8 +136,7 @@ "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 bf006185f0..e71a000bbe 100644 --- a/test/fixtures/esprima/es2015-yield/yield-strict-method/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-strict-method/expected.json @@ -86,8 +86,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "yield" + } }, "name": "yield" }, @@ -95,7 +94,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -117,8 +115,7 @@ } ], "extra": { - "parenthesized": true, - "parenStart": 14 + "parenthesized": true } } } 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 0801ae0ade..ef8158ed4e 100644 --- a/test/fixtures/esprima/es2015-yield/yield-super-property/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-super-property/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -71,8 +70,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "B" + } }, "name": "B" }, @@ -105,7 +103,6 @@ "column": 39 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -119,16 +116,15 @@ "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", @@ -200,8 +196,7 @@ "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 48b5015bb8..2c21f2ba38 100644 --- a/test/fixtures/esprima/es2015-yield/yield-variable-declaration/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-variable-declaration/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "yield" + } }, "name": "yield" }, @@ -79,7 +78,6 @@ ], "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 d0d73e72ff..be7cde28c8 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,14 +54,12 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "g" + } }, "name": "g" }, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -126,11 +124,9 @@ } } } - ], - "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 d5adbff2e1..299cd23813 100644 --- a/test/fixtures/esprima/es2015-yield/yield-yield-expression/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-yield-expression/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "g" + } }, "name": "g" }, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -126,11 +124,9 @@ } } } - ], - "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 4f4281d12b..951a2c8573 100644 --- a/test/fixtures/esprima/expression-additive/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-additive/migrated_0000/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 e715c38ccb..4be8cd12bf 100644 --- a/test/fixtures/esprima/expression-additive/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-additive/migrated_0001/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 0f7d218b48..712d4fd6c1 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0000/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, diff --git a/test/fixtures/esprima/expression-assignment/migrated_0000/expected.lightscript.json b/test/fixtures/esprima/expression-assignment/migrated_0000/expected.lightscript.json new file mode 100644 index 0000000000..d9f0b22df8 --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0000/expected.lightscript.json @@ -0,0 +1,104 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "NumericLiteral", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-assignment/migrated_0001/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0001/expected.json index 08e10f09be..01bf6f0d71 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0001/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "eval" + } }, "name": "eval" }, diff --git a/test/fixtures/esprima/expression-assignment/migrated_0001/expected.lightscript.json b/test/fixtures/esprima/expression-assignment/migrated_0001/expected.lightscript.json new file mode 100644 index 0000000000..132f31bfdd --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0001/expected.lightscript.json @@ -0,0 +1,104 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "init": { + "type": "NumericLiteral", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-assignment/migrated_0002/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0002/expected.json index 588a74e579..691796ca2f 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0002/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0002/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "arguments" + } }, "name": "arguments" }, diff --git a/test/fixtures/esprima/expression-assignment/migrated_0002/expected.lightscript.json b/test/fixtures/esprima/expression-assignment/migrated_0002/expected.lightscript.json new file mode 100644 index 0000000000..cbbba15b1c --- /dev/null +++ b/test/fixtures/esprima/expression-assignment/migrated_0002/expected.lightscript.json @@ -0,0 +1,104 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + "init": { + "type": "NumericLiteral", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-assignment/migrated_0003/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0003/expected.json index 3a99ca3eb6..4a01dfd629 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0003/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0003/expected.json @@ -69,8 +69,7 @@ "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 ec473b3207..1382a9b238 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0004/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0004/expected.json @@ -69,8 +69,7 @@ "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 812fb07cc1..e2a6524e00 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0005/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0005/expected.json @@ -69,8 +69,7 @@ "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 4d6b358971..3fb8e6a109 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0006/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0006/expected.json @@ -69,8 +69,7 @@ "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 26b624a7d4..8b681331b0 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0007/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0007/expected.json @@ -69,8 +69,7 @@ "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 441330c54c..827b99dbe0 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0008/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0008/expected.json @@ -69,8 +69,7 @@ "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 1d99f52655..d27aeea8cc 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0009/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0009/expected.json @@ -69,8 +69,7 @@ "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 10665e9e41..ea2c4e00ff 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0010/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0010/expected.json @@ -69,8 +69,7 @@ "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 ffab2697d0..12db3bd78f 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0011/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0011/expected.json @@ -69,8 +69,7 @@ "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 a4a9088d93..2b34e74553 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0012/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0012/expected.json @@ -69,8 +69,7 @@ "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 173d746401..ef886d2c97 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0013/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0013/expected.json @@ -69,8 +69,7 @@ "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 a479164a06..a21f7900f7 100644 --- a/test/fixtures/esprima/expression-binary-bitwise/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-binary-bitwise/migrated_0000/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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_0000/options.lightscript.json b/test/fixtures/esprima/expression-binary-bitwise/migrated_0000/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/esprima/expression-binary-bitwise/migrated_0000/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 e22094073c..9ff129d06b 100644 --- a/test/fixtures/esprima/expression-binary-bitwise/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-binary-bitwise/migrated_0001/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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/options.lightscript.json b/test/fixtures/esprima/expression-binary-bitwise/migrated_0001/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/esprima/expression-binary-bitwise/migrated_0001/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 7cd159ef07..2c6c6a71aa 100644 --- a/test/fixtures/esprima/expression-binary-bitwise/migrated_0002/expected.json +++ b/test/fixtures/esprima/expression-binary-bitwise/migrated_0002/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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/options.lightscript.json b/test/fixtures/esprima/expression-binary-bitwise/migrated_0002/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/esprima/expression-binary-bitwise/migrated_0002/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 3dbff25ba9..43821da431 100644 --- a/test/fixtures/esprima/expression-binary-logical/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0000/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 b4327fea4a..7b3dce0fdb 100644 --- a/test/fixtures/esprima/expression-binary-logical/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0001/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 3e277f2fb0..313205c734 100644 --- a/test/fixtures/esprima/expression-binary-logical/migrated_0002/expected.json +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0002/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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 759ef90eeb..076e9826f5 100644 --- a/test/fixtures/esprima/expression-binary-logical/migrated_0003/expected.json +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0003/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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 51c2a9cc9c..39a92de27e 100644 --- a/test/fixtures/esprima/expression-binary-logical/migrated_0004/expected.json +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0004/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -118,15 +116,13 @@ "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 663534b1b4..27399a9c53 100644 --- a/test/fixtures/esprima/expression-binary-logical/migrated_0005/expected.json +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0005/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -118,15 +116,13 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "z" + } }, "name": "z" } } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary-logical/migrated_0005/options.lightscript.json b/test/fixtures/esprima/expression-binary-logical/migrated_0005/options.lightscript.json new file mode 100644 index 0000000000..bceb20dcb9 --- /dev/null +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0005/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:7)" +} \ 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 8d5866efa2..102f5d3d69 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0000/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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 bcc48922f6..de56597e6a 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0001/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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 d4924593c3..edc0351968 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0002/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0002/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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 3b53c28f8f..74e0ab65b8 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0003/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0003/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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 3eab6d0286..510073e483 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0004/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0004/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -118,15 +116,13 @@ "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 e929279a89..5e5fca2313 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0005/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0005/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -118,15 +116,13 @@ "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 e0124c982f..dc0ac6b9bf 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0006/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0006/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -118,15 +116,13 @@ "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 d891a4741e..4beef8dd3d 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0007/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0007/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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 07dfb3ff15..9d743b0d39 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0008/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0008/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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 a251fd60d7..3e5a22a223 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0009/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0009/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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 63a295482e..2174559e10 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0010/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0010/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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 8384ff1b91..92c65557e6 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0011/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0011/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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_0011/options.lightscript.json b/test/fixtures/esprima/expression-binary/migrated_0011/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0011/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 11335ea1d3..188c481bfc 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0012/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0012/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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_0012/options.lightscript.json b/test/fixtures/esprima/expression-binary/migrated_0012/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0012/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 1cfab365e3..3c6c2f0817 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0013/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0013/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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/options.lightscript.json b/test/fixtures/esprima/expression-binary/migrated_0013/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0013/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 e819fc3506..48e47e4198 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0014/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0014/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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/options.lightscript.json b/test/fixtures/esprima/expression-binary/migrated_0014/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0014/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 f14d54ace0..0fa66acc0b 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0015/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0015/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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/options.lightscript.json b/test/fixtures/esprima/expression-binary/migrated_0015/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0015/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 481b96d976..c8df10d3d8 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0016/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0016/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -118,15 +116,13 @@ "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/options.lightscript.json b/test/fixtures/esprima/expression-binary/migrated_0016/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0016/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 ff26c296d7..c66d330503 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0017/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0017/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -118,15 +116,13 @@ "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/options.lightscript.json b/test/fixtures/esprima/expression-binary/migrated_0017/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/esprima/expression-binary/migrated_0017/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 1d480a3e1a..7da984159e 100644 --- a/test/fixtures/esprima/expression-bitwise-shift/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-bitwise-shift/migrated_0000/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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_0000/options.lightscript.json b/test/fixtures/esprima/expression-bitwise-shift/migrated_0000/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/esprima/expression-bitwise-shift/migrated_0000/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 80210cee23..51b1fefd9e 100644 --- a/test/fixtures/esprima/expression-bitwise-shift/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-bitwise-shift/migrated_0001/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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/options.lightscript.json b/test/fixtures/esprima/expression-bitwise-shift/migrated_0001/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/esprima/expression-bitwise-shift/migrated_0001/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 5edfbca9c7..c61c63d02d 100644 --- a/test/fixtures/esprima/expression-bitwise-shift/migrated_0002/expected.json +++ b/test/fixtures/esprima/expression-bitwise-shift/migrated_0002/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "y" + } }, "name": "y" } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-bitwise-shift/migrated_0002/options.lightscript.json b/test/fixtures/esprima/expression-bitwise-shift/migrated_0002/options.lightscript.json new file mode 100644 index 0000000000..7a9e872245 --- /dev/null +++ b/test/fixtures/esprima/expression-bitwise-shift/migrated_0002/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:2)" +} \ 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 d6a6a6320e..2158045bd1 100644 --- a/test/fixtures/esprima/expression-complex/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-complex/migrated_0000/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "b" + } }, "name": "b" }, @@ -132,8 +130,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "c" + } }, "name": "c" }, @@ -164,8 +161,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "d" + } }, "name": "d" }, @@ -196,8 +192,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "e" + } }, "name": "e" }, @@ -228,8 +223,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -260,8 +254,7 @@ "end": { "line": 1, "column": 28 - }, - "identifierName": "g" + } }, "name": "g" }, @@ -292,8 +285,7 @@ "end": { "line": 1, "column": 32 - }, - "identifierName": "h" + } }, "name": "h" }, @@ -324,8 +316,7 @@ "end": { "line": 1, "column": 38 - }, - "identifierName": "i" + } }, "name": "i" }, @@ -356,8 +347,7 @@ "end": { "line": 1, "column": 42 - }, - "identifierName": "j" + } }, "name": "j" }, @@ -374,8 +364,7 @@ "end": { "line": 1, "column": 46 - }, - "identifierName": "k" + } }, "name": "k" } @@ -390,7 +379,6 @@ } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-complex/migrated_0000/options.lightscript.json b/test/fixtures/esprima/expression-complex/migrated_0000/options.lightscript.json new file mode 100644 index 0000000000..e98705b591 --- /dev/null +++ b/test/fixtures/esprima/expression-complex/migrated_0000/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:12)" +} \ 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 ca2df57148..11b669b4ea 100644 --- a/test/fixtures/esprima/expression-conditional/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-conditional/migrated_0000/expected.json @@ -68,8 +68,7 @@ "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 7ec28110ed..32682fb46d 100644 --- a/test/fixtures/esprima/expression-conditional/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-conditional/migrated_0001/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "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 efb8e82279..0cbf738808 100644 --- a/test/fixtures/esprima/expression-conditional/migrated_0002/expected.json +++ b/test/fixtures/esprima/expression-conditional/migrated_0002/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -105,8 +104,7 @@ "extra": { "rawValue": 0, "raw": "0", - "parenthesized": true, - "parenStart": 4 + "parenthesized": true }, "value": 0 }, diff --git a/test/fixtures/esprima/expression-conditional/migrated_0002/expected.lightscript.json b/test/fixtures/esprima/expression-conditional/migrated_0002/expected.lightscript.json new file mode 100644 index 0000000000..ae829f5e8f --- /dev/null +++ b/test/fixtures/esprima/expression-conditional/migrated_0002/expected.lightscript.json @@ -0,0 +1,161 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "ConditionalExpression", + "start": 4, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "test": { + "type": "NumericLiteral", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 0, + "raw": "0", + "parenthesized": true, + "parenStart": 4 + }, + "value": 0 + }, + "consequent": { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "alternate": { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/expression-equality/migrated_0000/expected.json b/test/fixtures/esprima/expression-equality/migrated_0000/expected.json index 582e04e0dc..c1e5bf26af 100644 --- a/test/fixtures/esprima/expression-equality/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-equality/migrated_0000/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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_0000/expected.lightscript.json b/test/fixtures/esprima/expression-equality/migrated_0000/expected.lightscript.json new file mode 100644 index 0000000000..40f289ed6c --- /dev/null +++ b/test/fixtures/esprima/expression-equality/migrated_0000/expected.lightscript.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "===", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "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 507ec12519..8eb45e6a10 100644 --- a/test/fixtures/esprima/expression-equality/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-equality/migrated_0001/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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.lightscript.json b/test/fixtures/esprima/expression-equality/migrated_0001/expected.lightscript.json new file mode 100644 index 0000000000..f49e94403e --- /dev/null +++ b/test/fixtures/esprima/expression-equality/migrated_0001/expected.lightscript.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "!==", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "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 aada50d79c..2610f3986a 100644 --- a/test/fixtures/esprima/expression-equality/migrated_0002/expected.json +++ b/test/fixtures/esprima/expression-equality/migrated_0002/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 a22ceaea6a..ab3b9424ab 100644 --- a/test/fixtures/esprima/expression-equality/migrated_0003/expected.json +++ b/test/fixtures/esprima/expression-equality/migrated_0003/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 12f91e395e..6971eb4e8a 100644 --- a/test/fixtures/esprima/expression-grouping/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-grouping/migrated_0000/expected.json @@ -87,8 +87,7 @@ "extra": { "rawValue": 1, "raw": "1", - "parenthesized": true, - "parenStart": 0 + "parenthesized": true }, "value": 1 }, @@ -110,8 +109,7 @@ "extra": { "rawValue": 2, "raw": "2", - "parenthesized": true, - "parenStart": 6 + "parenthesized": true }, "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 b38c445344..8e7823f478 100644 --- a/test/fixtures/esprima/expression-grouping/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-grouping/migrated_0001/expected.json @@ -130,8 +130,7 @@ "extra": { "rawValue": 6, "raw": "6", - "parenthesized": true, - "parenStart": 9 + "parenthesized": true }, "value": 6 } diff --git a/test/fixtures/esprima/expression-grouping/migrated_0001/options.lightscript.json b/test/fixtures/esprima/expression-grouping/migrated_0001/options.lightscript.json new file mode 100644 index 0000000000..2d0f1a38ff --- /dev/null +++ b/test/fixtures/esprima/expression-grouping/migrated_0001/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (1:6)" +} \ No newline at end of file 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 8a400eec78..08c175955a 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,15 +68,13 @@ "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 05c9a2e459..782d5ea7e4 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,15 +68,13 @@ "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 42758a1f4e..376081c391 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,8 +82,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -92,7 +91,6 @@ "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 99a0eebd01..5c476aa6cf 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,8 +82,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -92,7 +91,6 @@ "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 b7777dc84a..1b87993df9 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,8 +96,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -115,8 +114,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -125,7 +123,6 @@ "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 ee47879eca..952d418f50 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,8 +82,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -99,8 +98,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -109,7 +107,6 @@ "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 dc595a854e..7ace856b56 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,8 +82,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -99,8 +98,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -109,7 +107,6 @@ "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 36a8e9983d..5e0c9c3c30 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,15 +96,13 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "foo" + } }, "name": "foo" }, "arguments": [], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } }, "property": { @@ -119,8 +117,7 @@ "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 14abd247cf..c20918ced6 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,8 +68,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -86,8 +85,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -103,15 +101,13 @@ "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 55989c03bf..2a92530d73 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,13 +68,11 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "foo" + } }, "name": "foo", "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } }, "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 85def70954..937e364bb2 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,8 +68,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "universe" + } }, "name": "universe" }, @@ -85,15 +84,13 @@ "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 9b29fb40a0..9b9c988c91 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,8 +82,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "universe" + } }, "name": "universe" }, @@ -99,8 +98,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "milkyway" + } }, "name": "milkyway" }, @@ -118,15 +116,13 @@ "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 3a03cde9b1..e160672e6a 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,8 +96,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "universe" + } }, "name": "universe" }, @@ -113,8 +112,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "milkyway" + } }, "name": "milkyway" }, @@ -132,8 +130,7 @@ "end": { "line": 1, "column": 29 - }, - "identifierName": "solarsystem" + } }, "name": "solarsystem" }, @@ -151,15 +148,13 @@ "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 fcc39e4ecc..269aad8658 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,8 +68,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "universe" + } }, "name": "universe" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "galaxyName" + } }, "name": "galaxyName" }, @@ -117,8 +115,7 @@ "end": { "line": 1, "column": 37 - }, - "identifierName": "otherUselessName" + } }, "name": "otherUselessName" } @@ -127,7 +124,6 @@ "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 6a6c95e194..fd2ad08336 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,8 +68,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "universe" + } }, "name": "universe" }, @@ -85,15 +84,13 @@ "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 7dbf01ef02..ff93859240 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,8 +82,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "universe" + } }, "name": "universe" }, @@ -121,8 +120,7 @@ "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 a732436290..a12ebbfc91 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,8 +82,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "universe" + } }, "name": "universe" }, @@ -122,8 +121,7 @@ "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 fa67fb5375..a8ceaa9228 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,8 +110,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "universe" + } }, "name": "universe" }, @@ -150,8 +149,7 @@ "end": { "line": 1, "column": 21 - }, - "identifierName": "galaxies" + } }, "name": "galaxies" }, @@ -232,8 +230,7 @@ "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 edbf36b172..0286b0ea65 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,8 +110,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "earth" + } }, "name": "earth" }, @@ -127,8 +126,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "asia" + } }, "name": "asia" }, @@ -146,8 +144,7 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "Indonesia" + } }, "name": "Indonesia" }, @@ -165,8 +162,7 @@ "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 92b467b8e9..41129f5624 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,8 +68,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "universe" + } }, "name": "universe" }, @@ -85,15 +84,13 @@ "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 43038cf090..b31bc7542a 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,8 +68,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "universe" + } }, "name": "universe" }, @@ -85,15 +84,13 @@ "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 76fd57dc7a..5bc538a2b9 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,8 +68,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "universe" + } }, "name": "universe" }, @@ -85,15 +84,13 @@ "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 1e0fe82f7b..a8f3caddc1 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,8 +68,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "universe" + } }, "name": "universe" }, @@ -85,15 +84,13 @@ "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 e4544003c4..89022ede9f 100644 --- a/test/fixtures/esprima/expression-multiplicative/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-multiplicative/migrated_0000/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 328a727dec..8a860dd890 100644 --- a/test/fixtures/esprima/expression-multiplicative/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-multiplicative/migrated_0001/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 ee2eb7b83f..2887a84d0e 100644 --- a/test/fixtures/esprima/expression-multiplicative/migrated_0002/expected.json +++ b/test/fixtures/esprima/expression-multiplicative/migrated_0002/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 6cff980e29..0712715b16 100644 --- a/test/fixtures/esprima/expression-postfix/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-postfix/migrated_0000/expected.json @@ -70,14 +70,12 @@ "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 b402ef1d3f..c4ea608985 100644 --- a/test/fixtures/esprima/expression-postfix/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-postfix/migrated_0001/expected.json @@ -70,14 +70,12 @@ "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 4436502a54..b1909f3acc 100644 --- a/test/fixtures/esprima/expression-postfix/migrated_0002/expected.json +++ b/test/fixtures/esprima/expression-postfix/migrated_0002/expected.json @@ -70,14 +70,12 @@ "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 28309341ef..aaebc648e7 100644 --- a/test/fixtures/esprima/expression-postfix/migrated_0003/expected.json +++ b/test/fixtures/esprima/expression-postfix/migrated_0003/expected.json @@ -70,14 +70,12 @@ "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 397833c9f4..bb07286fc5 100644 --- a/test/fixtures/esprima/expression-postfix/migrated_0004/expected.json +++ b/test/fixtures/esprima/expression-postfix/migrated_0004/expected.json @@ -70,14 +70,12 @@ "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 b27829eedc..5fdbf545d2 100644 --- a/test/fixtures/esprima/expression-postfix/migrated_0005/expected.json +++ b/test/fixtures/esprima/expression-postfix/migrated_0005/expected.json @@ -70,14 +70,12 @@ "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 1df1b8a0fb..10130f3578 100644 --- a/test/fixtures/esprima/expression-primary/array/expected.json +++ b/test/fixtures/esprima/expression-primary/array/expected.json @@ -27,7 +27,6 @@ } }, "sourceType": "script", - "body": [], - "directives": [] + "body": [] } } \ 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 1df1b8a0fb..10130f3578 100644 --- a/test/fixtures/esprima/expression-primary/literal/expected.json +++ b/test/fixtures/esprima/expression-primary/literal/expected.json @@ -27,7 +27,6 @@ } }, "sourceType": "script", - "body": [], - "directives": [] + "body": [] } } \ 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 1df1b8a0fb..10130f3578 100644 --- a/test/fixtures/esprima/expression-primary/object/expected.json +++ b/test/fixtures/esprima/expression-primary/object/expected.json @@ -27,7 +27,6 @@ } }, "sourceType": "script", - "body": [], - "directives": [] + "body": [] } } \ 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 1df1b8a0fb..10130f3578 100644 --- a/test/fixtures/esprima/expression-primary/other/expected.json +++ b/test/fixtures/esprima/expression-primary/other/expected.json @@ -27,7 +27,6 @@ } }, "sourceType": "script", - "body": [], - "directives": [] + "body": [] } } \ 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 39ed4b1c81..da2300c3ba 100644 --- a/test/fixtures/esprima/expression-relational/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-relational/migrated_0000/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 edbe85495e..d036898e8d 100644 --- a/test/fixtures/esprima/expression-relational/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-relational/migrated_0001/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 f4fd2421d9..21272df967 100644 --- a/test/fixtures/esprima/expression-relational/migrated_0002/expected.json +++ b/test/fixtures/esprima/expression-relational/migrated_0002/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 fab9884151..4eba25fa96 100644 --- a/test/fixtures/esprima/expression-relational/migrated_0003/expected.json +++ b/test/fixtures/esprima/expression-relational/migrated_0003/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 09804a0b7c..179ec5032f 100644 --- a/test/fixtures/esprima/expression-relational/migrated_0004/expected.json +++ b/test/fixtures/esprima/expression-relational/migrated_0004/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 992fb876e2..8edd71168c 100644 --- a/test/fixtures/esprima/expression-relational/migrated_0005/expected.json +++ b/test/fixtures/esprima/expression-relational/migrated_0005/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 39e74f7d29..855baa45d7 100644 --- a/test/fixtures/esprima/expression-relational/migrated_0006/expected.json +++ b/test/fixtures/esprima/expression-relational/migrated_0006/expected.json @@ -82,8 +82,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "y" + } }, "name": "y" } @@ -119,14 +117,12 @@ "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 a072a29131..b8e60e420d 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0000/expected.json @@ -70,17 +70,12 @@ "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 29f62109f3..74d0f506ec 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0001/expected.json @@ -70,17 +70,12 @@ "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 164c7de5e1..892974799e 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0002/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0002/expected.json @@ -70,17 +70,12 @@ "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 e24ebd8ae3..f82908bc2b 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0003/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0003/expected.json @@ -70,17 +70,12 @@ "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 f8c24a6e5c..e190c488dd 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0004/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0004/expected.json @@ -70,17 +70,12 @@ "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 7c9d3dd0a4..8451361753 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0005/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0005/expected.json @@ -70,17 +70,12 @@ "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 8c0aefbb8e..62ee624c4c 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0006/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0006/expected.json @@ -70,17 +70,12 @@ "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 d0695f2e20..4b614da625 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0007/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0007/expected.json @@ -70,17 +70,12 @@ "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 900b160cf8..326a3d6c51 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0008/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0008/expected.json @@ -70,17 +70,12 @@ "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/options.lightscript.json b/test/fixtures/esprima/expression-unary/migrated_0008/options.lightscript.json new file mode 100644 index 0000000000..919c05ec87 --- /dev/null +++ b/test/fixtures/esprima/expression-unary/migrated_0008/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:0)" +} \ 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 47e35ce89d..5db05c771f 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0009/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0009/expected.json @@ -70,17 +70,12 @@ "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 9c3d31a745..776ed71df2 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0010/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0010/expected.json @@ -70,17 +70,12 @@ "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 87f98df461..f5edc45759 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0011/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0011/expected.json @@ -70,17 +70,12 @@ "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 644e2e6689..137dc642bc 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0012/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0012/expected.json @@ -70,17 +70,12 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "x" + } }, "name": "x" - }, - "extra": { - "parenthesizedArgument": false } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/.GH-1106-09/expected.json b/test/fixtures/esprima/invalid-syntax/.GH-1106-09/expected.json new file mode 100644 index 0000000000..0d183a7bf6 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/.GH-1106-09/expected.json @@ -0,0 +1,66 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": "9", + "rawValue": "9", + "raw": "\"\\9\"" + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/.migrated_0033/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0033/expected.json new file mode 100644 index 0000000000..f4fe7d7ce4 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/.migrated_0033/expected.json @@ -0,0 +1,100 @@ +{ + "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 new file mode 100644 index 0000000000..bc71c475ce --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/.migrated_0034/expected.json @@ -0,0 +1,100 @@ +{ + "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 new file mode 100644 index 0000000000..798f613862 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/.migrated_0035/expected.json @@ -0,0 +1,102 @@ +{ + "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 new file mode 100644 index 0000000000..ee388c0ff8 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/.migrated_0036/expected.json @@ -0,0 +1,100 @@ +{ + "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 new file mode 100644 index 0000000000..1e4947ba6c --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/.migrated_0037/expected.json @@ -0,0 +1,100 @@ +{ + "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 new file mode 100644 index 0000000000..432370bc2e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/.migrated_0041/expected.json @@ -0,0 +1,100 @@ +{ + "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 new file mode 100644 index 0000000000..88d96a096a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/.migrated_0042/expected.json @@ -0,0 +1,100 @@ +{ + "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 new file mode 100644 index 0000000000..5dccf2df66 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/.migrated_0043/expected.json @@ -0,0 +1,100 @@ +{ + "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 new file mode 100644 index 0000000000..7b451084c4 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/.migrated_0044/expected.json @@ -0,0 +1,100 @@ +{ + "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 new file mode 100644 index 0000000000..c74b8f4b9d --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/.migrated_0048/expected.json @@ -0,0 +1,100 @@ +{ + "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 new file mode 100644 index 0000000000..0d8aed2410 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/.migrated_0049/expected.json @@ -0,0 +1,100 @@ +{ + "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 new file mode 100644 index 0000000000..fc597b32c5 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/.migrated_0050/expected.json @@ -0,0 +1,100 @@ +{ + "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 new file mode 100644 index 0000000000..e22bc63888 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/.migrated_0051/expected.json @@ -0,0 +1,100 @@ +{ + "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 new file mode 100644 index 0000000000..c910512d1a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/.migrated_0137/expected.json @@ -0,0 +1,100 @@ +{ + "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 new file mode 100644 index 0000000000..e3f4ea1270 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/.migrated_0163/expected.json @@ -0,0 +1,100 @@ +{ + "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 new file mode 100644 index 0000000000..968d4f6a66 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/.migrated_0165/expected.json @@ -0,0 +1,100 @@ +{ + "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 new file mode 100644 index 0000000000..f9b68dd718 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/.migrated_0166/expected.json @@ -0,0 +1,100 @@ +{ + "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 new file mode 100644 index 0000000000..238759889e --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/.migrated_0167/expected.json @@ -0,0 +1,100 @@ +{ + "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 new file mode 100644 index 0000000000..5dcccc5d34 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/.migrated_0169/expected.json @@ -0,0 +1,100 @@ +{ + "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 new file mode 100644 index 0000000000..374479f48a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/.migrated_0277/expected.json @@ -0,0 +1,168 @@ +{ + "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_0056/options.lightscript.json b/test/fixtures/esprima/invalid-syntax/migrated_0056/options.lightscript.json new file mode 100644 index 0000000000..002b66a77a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0056/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "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. (1:10)" +} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0071/options.lightscript.json b/test/fixtures/esprima/invalid-syntax/migrated_0071/options.lightscript.json new file mode 100644 index 0000000000..1dccc09c72 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0071/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected ( (1:8)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0072/options.lightscript.json b/test/fixtures/esprima/invalid-syntax/migrated_0072/options.lightscript.json new file mode 100644 index 0000000000..1dccc09c72 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0072/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected ( (1:8)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0073/options.lightscript.json b/test/fixtures/esprima/invalid-syntax/migrated_0073/options.lightscript.json new file mode 100644 index 0000000000..358068a16a --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0073/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:12)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0113/options.lightscript.json b/test/fixtures/esprima/invalid-syntax/migrated_0113/options.lightscript.json new file mode 100644 index 0000000000..e68fbb6aec --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0113/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0125/options.lightscript.json b/test/fixtures/esprima/invalid-syntax/migrated_0125/options.lightscript.json new file mode 100644 index 0000000000..34583d5638 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0125/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "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. (1:9)" +} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0126/options.lightscript.json b/test/fixtures/esprima/invalid-syntax/migrated_0126/options.lightscript.json new file mode 100644 index 0000000000..1bc50d2d19 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0126/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "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. (1:6)" +} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0216/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0216/options.json index 61a5834b63..91bbdfe83f 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:2)" + "throws": "Octal literal in strict mode (1:1)" } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0217/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0217/options.json index 11a57d6c56..68bfd75832 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:35)" + "throws": "Octal literal in strict mode (1:34)" } \ 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 2984958689..fa3a33b55e 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:38)" + "throws": "Octal literal in strict mode (1:37)" } \ 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 d094fe0284..ae2bfab55c 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:36)" + "throws": "Octal literal in strict mode (1:35)" } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0222/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0222/options.json index d094fe0284..ae2bfab55c 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:36)" + "throws": "Octal literal in strict mode (1:35)" } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0223/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0223/options.json index e92ad336dd..e689079a79 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:69)" + "throws": "Octal literal in strict mode (1:68)" } \ 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 1edd04b2e0..22d103a833 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": "yield is a reserved word (1:37)" -} + "throws": "Unexpected token (1:37)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0255/options.lightscript.json b/test/fixtures/esprima/invalid-syntax/migrated_0255/options.lightscript.json new file mode 100644 index 0000000000..e68fbb6aec --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0255/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:2)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0259/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0259/actual.js new file mode 100644 index 0000000000..e632766388 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0259/actual.js @@ -0,0 +1 @@ +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 new file mode 100644 index 0000000000..51c483f3d3 --- /dev/null +++ b/test/fixtures/esprima/invalid-syntax/migrated_0259/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:14)" +} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0261/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0261/options.json index 0ab445fe47..ffd3a3ed26 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0261/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0261/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token (1:5)" -} \ No newline at end of file + "throws": "A class name is required (1:5)" +} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0262/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0262/options.json index 0ab445fe47..ffd3a3ed26 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0262/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0262/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token (1:5)" -} \ No newline at end of file + "throws": "A class name is required (1:5)" +} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0263/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0263/options.json index 0ab445fe47..ffd3a3ed26 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0263/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0263/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token (1:5)" -} \ No newline at end of file + "throws": "A class name is required (1:5)" +} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0268/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0268/options.json index 89bfc2d73f..021ac49e5f 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 (1:10)" + "throws": "Unexpected token, expected ( (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 cb6c66081e..609492567c 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 (1:11)" + "throws": "Unexpected token, expected ( (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 562afcef48..cd71808039 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 (1:23)" + "throws": "Unexpected token, expected ( (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 deleted file mode 100644 index 3deff8cedd..0000000000 --- a/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-array/actual.js +++ /dev/null @@ -1 +0,0 @@ -(a, ...[b]) => c diff --git a/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-array/expected.json b/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-array/expected.json deleted file mode 100644 index 4bdc1344d7..0000000000 --- a/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-array/expected.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - }, - "expression": { - "type": "ArrowFunctionExpression", - "start": 0, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - }, - "id": null, - "generator": false, - "expression": true, - "async": false, - "params": [ - { - "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, - "name": "a" - }, - { - "type": "RestElement", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "argument": { - "type": "ArrayPattern", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "elements": [ - { - "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "b" - }, - "name": "b" - } - ] - } - } - ], - "body": { - "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "c" - }, - "name": "c" - } - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-object/actual.js b/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-object/actual.js deleted file mode 100644 index 5f444a41be..0000000000 --- a/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-object/actual.js +++ /dev/null @@ -1 +0,0 @@ -(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 deleted file mode 100644 index ea2b1244f6..0000000000 --- a/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-object/expected.json +++ /dev/null @@ -1,191 +0,0 @@ -{ - "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 deleted file mode 100644 index 712e8692f7..0000000000 --- a/test/fixtures/esprima/rest-parameter/function-declaration/actual.js +++ /dev/null @@ -1 +0,0 @@ -function f(a, ...b) {} diff --git a/test/fixtures/esprima/rest-parameter/function-declaration/expected.json b/test/fixtures/esprima/rest-parameter/function-declaration/expected.json deleted file mode 100644 index 07716be5ae..0000000000 --- a/test/fixtures/esprima/rest-parameter/function-declaration/expected.json +++ /dev/null @@ -1,137 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "sourceType": "script", - "body": [ - { - "type": "FunctionDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "id": { - "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, - "name": "f" - }, - "generator": false, - "expression": false, - "async": false, - "params": [ - { - "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "a" - }, - "name": "a" - }, - { - "type": "RestElement", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "argument": { - "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "b" - }, - "name": "b" - } - } - ], - "body": { - "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "body": [], - "directives": [] - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/rest-parameter/function-expression/actual.js b/test/fixtures/esprima/rest-parameter/function-expression/actual.js deleted file mode 100644 index fa971224bb..0000000000 --- a/test/fixtures/esprima/rest-parameter/function-expression/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 8c72a24d81..0000000000 --- a/test/fixtures/esprima/rest-parameter/function-expression/expected.json +++ /dev/null @@ -1,169 +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": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "expression": { - "type": "AssignmentExpression", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "operator": "=", - "left": { - "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "f" - }, - "name": "f" - }, - "right": { - "type": "FunctionExpression", - "start": 4, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "id": null, - "generator": false, - "expression": false, - "async": false, - "params": [ - { - "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "a" - }, - "name": "a" - }, - { - "type": "RestElement", - "start": 16, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "argument": { - "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "b" - }, - "name": "b" - } - } - ], - "body": { - "type": "BlockStatement", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "body": [], - "directives": [] - } - } - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/rest-parameter/invalid-setter-rest/actual.js b/test/fixtures/esprima/rest-parameter/invalid-setter-rest/actual.js deleted file mode 100644 index 3967f6fba2..0000000000 --- a/test/fixtures/esprima/rest-parameter/invalid-setter-rest/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 06e1f71eea..0000000000 --- a/test/fixtures/esprima/rest-parameter/invalid-setter-rest/expected.json +++ /dev/null @@ -1,190 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "expression": { - "type": "AssignmentExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "operator": "=", - "left": { - "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, - "name": "x" - }, - "right": { - "type": "ObjectExpression", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "properties": [ - { - "type": "ObjectMethod", - "start": 6, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "f" - }, - "name": "f" - }, - "kind": "set", - "id": null, - "generator": false, - "expression": false, - "async": false, - "params": [ - { - "type": "RestElement", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - } - }, - "argument": { - "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "y" - }, - "name": "y" - } - } - ], - "body": { - "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "body": [], - "directives": [] - } - } - ] - } - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/rest-parameter/object-method/actual.js b/test/fixtures/esprima/rest-parameter/object-method/actual.js deleted file mode 100644 index af5910b4fc..0000000000 --- a/test/fixtures/esprima/rest-parameter/object-method/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 44a231cab5..0000000000 --- a/test/fixtures/esprima/rest-parameter/object-method/expected.json +++ /dev/null @@ -1,221 +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": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, - "expression": { - "type": "AssignmentExpression", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, - "operator": "=", - "left": { - "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "o" - }, - "name": "o" - }, - "right": { - "type": "ObjectExpression", - "start": 4, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 31 - } - }, - "properties": [ - { - "type": "ObjectProperty", - "start": 6, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "f" - }, - "name": "f" - }, - "value": { - "type": "FunctionExpression", - "start": 9, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "id": null, - "generator": false, - "expression": false, - "async": false, - "params": [ - { - "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "a" - }, - "name": "a" - }, - { - "type": "RestElement", - "start": 21, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "argument": { - "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "b" - }, - "name": "b" - } - } - ], - "body": { - "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "body": [], - "directives": [] - } - } - } - ] - } - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/rest-parameter/object-shorthand-method/actual.js b/test/fixtures/esprima/rest-parameter/object-shorthand-method/actual.js deleted file mode 100644 index 5099434fef..0000000000 --- a/test/fixtures/esprima/rest-parameter/object-shorthand-method/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2d6b8d4961..0000000000 --- a/test/fixtures/esprima/rest-parameter/object-shorthand-method/expected.json +++ /dev/null @@ -1,190 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "expression": { - "type": "AssignmentExpression", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "operator": "=", - "left": { - "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, - "name": "x" - }, - "right": { - "type": "ObjectExpression", - "start": 4, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "properties": [ - { - "type": "ObjectMethod", - "start": 6, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "method": true, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "method" - }, - "name": "method" - }, - "kind": "method", - "id": null, - "generator": false, - "expression": false, - "async": false, - "params": [ - { - "type": "RestElement", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "argument": { - "type": "Identifier", - "start": 16, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "test" - }, - "name": "test" - } - } - ], - "body": { - "type": "BlockStatement", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "body": [], - "directives": [] - } - } - ] - } - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/rest-parameter/rest-parameter-array/actual.js b/test/fixtures/esprima/rest-parameter/rest-parameter-array/actual.js deleted file mode 100644 index be49b91260..0000000000 --- a/test/fixtures/esprima/rest-parameter/rest-parameter-array/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 5baa9cff60..0000000000 --- a/test/fixtures/esprima/rest-parameter/rest-parameter-array/expected.json +++ /dev/null @@ -1,137 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - }, - "sourceType": "script", - "body": [ - { - "type": "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 deleted file mode 100644 index 96eaa62074..0000000000 --- a/test/fixtures/esprima/rest-parameter/rest-parameter-object/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2d0c8bee41..0000000000 --- a/test/fixtures/esprima/rest-parameter/rest-parameter-object/expected.json +++ /dev/null @@ -1,175 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - }, - "sourceType": "script", - "body": [ - { - "type": "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 ca5a5fb0eb..5d5053da91 100644 --- a/test/fixtures/esprima/statement-block/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-block/migrated_0000/expected.json @@ -69,16 +69,13 @@ "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_0000/expected.lightscript.json b/test/fixtures/esprima/statement-block/migrated_0000/expected.lightscript.json new file mode 100644 index 0000000000..39aa99c7f0 --- /dev/null +++ b/test/fixtures/esprima/statement-block/migrated_0000/expected.lightscript.json @@ -0,0 +1,121 @@ +{ + "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": "ObjectExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "value": { + "type": "Identifier", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "extra": { + "shorthand": true + } + } + ] + } + } + ], + "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 b271f0a04c..eec6775871 100644 --- a/test/fixtures/esprima/statement-block/migrated_0001/expected.json +++ b/test/fixtures/esprima/statement-block/migrated_0001/expected.json @@ -83,8 +83,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "doThis" + } }, "name": "doThis" }, @@ -131,18 +130,15 @@ "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_0001/options.lightscript.json b/test/fixtures/esprima/statement-block/migrated_0001/options.lightscript.json new file mode 100644 index 0000000000..678798b61e --- /dev/null +++ b/test/fixtures/esprima/statement-block/migrated_0001/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected { (1:10)" +} diff --git a/test/fixtures/esprima/statement-block/migrated_0002/expected.json b/test/fixtures/esprima/statement-block/migrated_0002/expected.json index d209b58703..5792211240 100644 --- a/test/fixtures/esprima/statement-block/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-block/migrated_0002/expected.json @@ -42,10 +42,8 @@ "column": 2 } }, - "body": [], - "directives": [] + "body": [] } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-block/migrated_0002/expected.lightscript.json b/test/fixtures/esprima/statement-block/migrated_0002/expected.lightscript.json new file mode 100644 index 0000000000..a44549f455 --- /dev/null +++ b/test/fixtures/esprima/statement-block/migrated_0002/expected.lightscript.json @@ -0,0 +1,65 @@ +{ + "type": "File", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "properties": [] + } + } + ], + "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 b46b8cecc6..930203bdfe 100644 --- a/test/fixtures/esprima/statement-break/migrated_0001/expected.json +++ b/test/fixtures/esprima/statement-break/migrated_0001/expected.json @@ -113,8 +113,7 @@ "end": { "line": 1, "column": 31 - }, - "identifierName": "done" + } }, "name": "done" } @@ -135,8 +134,7 @@ "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 75ce4af774..207d4cf4c5 100644 --- a/test/fixtures/esprima/statement-break/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-break/migrated_0002/expected.json @@ -113,8 +113,7 @@ "end": { "line": 1, "column": 31 - }, - "identifierName": "done" + } }, "name": "done" } @@ -135,8 +134,7 @@ "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 91efaf586f..694def79b2 100644 --- a/test/fixtures/esprima/statement-break/migrated_0003/expected.json +++ b/test/fixtures/esprima/statement-break/migrated_0003/expected.json @@ -113,8 +113,7 @@ "end": { "line": 1, "column": 41 - }, - "identifierName": "__proto__" + } }, "name": "__proto__" } @@ -135,8 +134,7 @@ "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 7b69d3e398..3d3611769c 100644 --- a/test/fixtures/esprima/statement-continue/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-continue/migrated_0002/expected.json @@ -113,8 +113,7 @@ "end": { "line": 1, "column": 34 - }, - "identifierName": "done" + } }, "name": "done" } @@ -135,8 +134,7 @@ "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 73a3847e0b..e2eede95cf 100644 --- a/test/fixtures/esprima/statement-continue/migrated_0003/expected.json +++ b/test/fixtures/esprima/statement-continue/migrated_0003/expected.json @@ -113,8 +113,7 @@ "end": { "line": 1, "column": 34 - }, - "identifierName": "done" + } }, "name": "done" } @@ -135,8 +134,7 @@ "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 3c78b5f5bc..076d4478b5 100644 --- a/test/fixtures/esprima/statement-continue/migrated_0004/expected.json +++ b/test/fixtures/esprima/statement-continue/migrated_0004/expected.json @@ -113,8 +113,7 @@ "end": { "line": 1, "column": 44 - }, - "identifierName": "__proto__" + } }, "name": "__proto__" } @@ -135,8 +134,7 @@ "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 c70dc07eb5..bf36100cfe 100644 --- a/test/fixtures/esprima/statement-debugger/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-debugger/migrated_0000/expected.json @@ -43,7 +43,6 @@ } } } - ], - "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 e48902c158..d76894f1aa 100644 --- a/test/fixtures/esprima/statement-empty/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-empty/migrated_0000/expected.json @@ -43,7 +43,6 @@ } } } - ], - "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 7d660bdda7..470ad995ab 100644 --- a/test/fixtures/esprima/statement-expression/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-expression/migrated_0000/expected.json @@ -54,13 +54,11 @@ "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 a8a40d3c2b..a1f0e67018 100644 --- a/test/fixtures/esprima/statement-expression/migrated_0001/expected.json +++ b/test/fixtures/esprima/statement-expression/migrated_0001/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,15 +85,13 @@ "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 96f353ac3f..03f4a58cb3 100644 --- a/test/fixtures/esprima/statement-expression/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-expression/migrated_0002/expected.json @@ -69,8 +69,7 @@ "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 367ca3f2a4..d292e2317d 100644 --- a/test/fixtures/esprima/statement-expression/migrated_0003/expected.json +++ b/test/fixtures/esprima/statement-expression/migrated_0003/expected.json @@ -69,8 +69,7 @@ "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 598c8c3a94..58b1ca21f8 100644 --- a/test/fixtures/esprima/statement-expression/migrated_0004/expected.json +++ b/test/fixtures/esprima/statement-expression/migrated_0004/expected.json @@ -69,8 +69,7 @@ "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 d368ff1a7f..b9ab7766f2 100644 --- a/test/fixtures/esprima/statement-expression/migrated_0005/expected.json +++ b/test/fixtures/esprima/statement-expression/migrated_0005/expected.json @@ -69,8 +69,7 @@ "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 18f37a7b65..61f0887961 100644 --- a/test/fixtures/esprima/statement-if/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-if/migrated_0000/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "morning" + } }, "name": "morning" }, @@ -99,8 +98,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "goodMorning" + } }, "name": "goodMorning" }, @@ -109,7 +107,6 @@ }, "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 38198e3d25..640c5691c2 100644 --- a/test/fixtures/esprima/statement-if/migrated_0001/expected.json +++ b/test/fixtures/esprima/statement-if/migrated_0001/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "morning" + } }, "name": "morning" }, @@ -90,7 +89,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -110,8 +108,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 13 + "parenthesized": true } } }, diff --git a/test/fixtures/esprima/statement-if/migrated_0002/expected.json b/test/fixtures/esprima/statement-if/migrated_0002/expected.json index 492f0ac62c..bf2044c42a 100644 --- a/test/fixtures/esprima/statement-if/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-if/migrated_0002/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "morning" + } }, "name": "morning" }, @@ -100,8 +99,7 @@ "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 453c4e700d..720f53798d 100644 --- a/test/fixtures/esprima/statement-if/migrated_0004/expected.json +++ b/test/fixtures/esprima/statement-if/migrated_0004/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "morning" + } }, "name": "morning" }, @@ -99,8 +98,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "goodMorning" + } }, "name": "goodMorning" }, @@ -147,8 +145,7 @@ "end": { "line": 1, "column": 40 - }, - "identifierName": "goodDay" + } }, "name": "goodDay" }, @@ -156,7 +153,6 @@ } } } - ], - "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 efb3af5fec..baa36356a5 100644 --- a/test/fixtures/esprima/statement-if/migrated_0005/expected.json +++ b/test/fixtures/esprima/statement-if/migrated_0005/expected.json @@ -98,8 +98,7 @@ "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 0cfad45c37..2f9b5c6964 100644 --- a/test/fixtures/esprima/statement-if/migrated_0006/expected.json +++ b/test/fixtures/esprima/statement-if/migrated_0006/expected.json @@ -98,8 +98,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "that" + } }, "name": "that" }, diff --git a/test/fixtures/esprima/statement-iteration/.migrated_0021/expected.json b/test/fixtures/esprima/statement-iteration/.migrated_0021/expected.json new file mode 100644 index 0000000000..20d1b7032f --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/.migrated_0021/expected.json @@ -0,0 +1,176 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "x" + }, + "init": { + "type": "AssignmentExpression", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "y" + }, + "right": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "z" + } + } + } + ], + "kind": "var" + }, + "right": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "q" + }, + "body": { + "type": "EmptyStatement", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/const_forin/expected.json b/test/fixtures/esprima/statement-iteration/const_forin/expected.json index aea7786f71..24f754ab5a 100644 --- a/test/fixtures/esprima/statement-iteration/const_forin/expected.json +++ b/test/fixtures/esprima/statement-iteration/const_forin/expected.json @@ -42,7 +42,6 @@ "column": 33 } }, - "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -84,8 +83,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -106,8 +104,7 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "list" + } }, "name": "list" }, @@ -151,8 +148,7 @@ "end": { "line": 1, "column": 29 - }, - "identifierName": "process" + } }, "name": "process" }, @@ -169,8 +165,7 @@ "end": { "line": 1, "column": 31 - }, - "identifierName": "x" + } }, "name": "x" } @@ -178,7 +173,6 @@ } } } - ], - "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 da4f943e81..caaf4a9a96 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,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -86,8 +85,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "b" + } }, "name": "b" }, @@ -103,8 +101,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "c" + } }, "name": "c" } @@ -128,7 +125,6 @@ } } } - ], - "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 6b99345c09..52f64a4d6b 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0000/expected.json @@ -82,8 +82,7 @@ "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 a131703fce..04998adb58 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0001/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0001/expected.json @@ -82,8 +82,7 @@ "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 e2f50113d3..9814bc6039 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0002/expected.json @@ -99,8 +99,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "x" + } }, "name": "x" } @@ -148,8 +147,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "y" + } }, "name": "y" } @@ -184,8 +182,7 @@ "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 new file mode 100644 index 0000000000..2d4f18af3e --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0003/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected , (1:5)" +} diff --git a/test/fixtures/esprima/statement-iteration/migrated_0004/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0004/expected.json index b8d3fb1e01..746642c0a5 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0004/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0004/expected.json @@ -82,8 +82,7 @@ "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 a618237dc9..5019d62edd 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0005/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0005/expected.json @@ -82,8 +82,7 @@ "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 1cd371f080..b154f386f7 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0006/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0006/expected.json @@ -98,8 +98,7 @@ "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 f08d3a9485..8ca1322823 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0007/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0007/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -152,8 +151,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "x" + } }, "name": "x" } @@ -201,8 +199,7 @@ "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 5f4998d8a0..9474ed02f5 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0008/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0008/expected.json @@ -61,7 +61,6 @@ } } } - ], - "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 67a281d20e..ee4511c5df 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0009/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0009/expected.json @@ -59,11 +59,9 @@ "column": 9 } }, - "body": [], - "directives": [] + "body": [] } } - ], - "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 ac885ace49..96e6163073 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0010/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0010/expected.json @@ -69,8 +69,7 @@ "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 424fedd8b8..06e23e5726 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0011/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0011/expected.json @@ -83,8 +83,7 @@ "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 a1ccc73433..ced9b7da30 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0012/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0012/expected.json @@ -83,8 +83,7 @@ "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 f701a8cc20..9703da41dc 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0013/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0013/expected.json @@ -83,8 +83,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -135,8 +134,7 @@ "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 019c93da93..799bca6bd8 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0014/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0014/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -121,8 +120,7 @@ "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 d44ae9616d..bab630bd14 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0015/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0015/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -121,8 +120,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -176,8 +174,7 @@ "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 bd932cf468..88e0fa1c9f 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0016/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0016/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -121,8 +120,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -176,8 +174,7 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "x" + } }, "name": "x" } @@ -222,8 +219,7 @@ "end": { "line": 1, "column": 31 - }, - "identifierName": "process" + } }, "name": "process" }, @@ -240,8 +236,7 @@ "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 9c7cdebe0f..f95b2f15a7 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0017/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0017/expected.json @@ -42,7 +42,6 @@ "column": 26 } }, - "await": false, "left": { "type": "Identifier", "start": 4, @@ -55,8 +54,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -72,8 +70,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "list" + } }, "name": "list" }, @@ -117,8 +114,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "process" + } }, "name": "process" }, @@ -135,8 +131,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "x" + } }, "name": "x" } @@ -144,7 +139,6 @@ } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0017/options.lightscript.json b/test/fixtures/esprima/statement-iteration/migrated_0017/options.lightscript.json new file mode 100644 index 0000000000..4fa5b8e28b --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0017/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "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. (1:4)" +} diff --git a/test/fixtures/esprima/statement-iteration/migrated_0018/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0018/expected.json index 4a3a0ecfda..50d29b5d32 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0018/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0018/expected.json @@ -42,7 +42,6 @@ "column": 31 } }, - "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -84,8 +83,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -106,8 +104,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "list" + } }, "name": "list" }, @@ -151,8 +148,7 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "process" + } }, "name": "process" }, @@ -169,8 +165,7 @@ "end": { "line": 1, "column": 29 - }, - "identifierName": "x" + } }, "name": "x" } @@ -178,7 +173,6 @@ } } } - ], - "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 c86ced2dd6..12d30b3dd3 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0020/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0020/expected.json @@ -42,7 +42,6 @@ "column": 31 } }, - "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -84,8 +83,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -106,8 +104,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "list" + } }, "name": "list" }, @@ -151,8 +148,7 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "process" + } }, "name": "process" }, @@ -169,8 +165,7 @@ "end": { "line": 1, "column": 29 - }, - "identifierName": "x" + } }, "name": "x" } @@ -178,7 +173,6 @@ } } } - ], - "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 9bb6c3e3fc..5eba72f1c0 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0024/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0024/expected.json @@ -42,7 +42,6 @@ "column": 21 } }, - "await": false, "left": { "type": "MemberExpression", "start": 5, @@ -69,8 +68,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -100,8 +98,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "b" + } }, "name": "b" }, @@ -118,8 +115,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "c" + } }, "name": "c" } @@ -138,8 +134,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "d" + } }, "name": "d" }, @@ -159,7 +154,6 @@ } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0024/options.lightscript.json b/test/fixtures/esprima/statement-iteration/migrated_0024/options.lightscript.json new file mode 100644 index 0000000000..ca73984388 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0024/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "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. (1:13)" +} diff --git a/test/fixtures/esprima/statement-iteration/migrated_0025/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0025/expected.json index a50e44182a..c0f69f2729 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0025/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0025/expected.json @@ -42,7 +42,6 @@ "column": 24 } }, - "await": false, "left": { "type": "MemberExpression", "start": 5, @@ -83,8 +82,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -115,8 +113,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "b" + } }, "name": "b" }, @@ -133,8 +130,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "c" + } }, "name": "c" } @@ -175,8 +171,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "d" + } }, "name": "d" }, diff --git a/test/fixtures/esprima/statement-iteration/migrated_0025/options.lightscript.json b/test/fixtures/esprima/statement-iteration/migrated_0025/options.lightscript.json new file mode 100644 index 0000000000..7b132e9113 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0025/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "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. (1:16)" +} diff --git a/test/fixtures/esprima/statement-iteration/migrated_0026/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0026/expected.json index dc3c4e3104..df5bd2f21b 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0026/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0026/expected.json @@ -42,7 +42,6 @@ "column": 16 } }, - "await": false, "left": { "type": "MemberExpression", "start": 5, @@ -69,8 +68,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -86,8 +84,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "in" + } }, "name": "in" }, @@ -105,8 +102,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -126,7 +122,6 @@ } } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0026/options.lightscript.json b/test/fixtures/esprima/statement-iteration/migrated_0026/options.lightscript.json new file mode 100644 index 0000000000..c9acc52b86 --- /dev/null +++ b/test/fixtures/esprima/statement-iteration/migrated_0026/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "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. (1:7)" +} diff --git a/test/fixtures/esprima/statement-labelled/migrated_0000/expected.json b/test/fixtures/esprima/statement-labelled/migrated_0000/expected.json index 0edfa7e1e6..ea2201a00e 100644 --- a/test/fixtures/esprima/statement-labelled/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-labelled/migrated_0000/expected.json @@ -85,8 +85,7 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "start" + } }, "name": "start" } @@ -104,13 +103,11 @@ "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 0c49d0e8f9..5157602658 100644 --- a/test/fixtures/esprima/statement-labelled/migrated_0001/expected.json +++ b/test/fixtures/esprima/statement-labelled/migrated_0001/expected.json @@ -98,8 +98,7 @@ "end": { "line": 1, "column": 31 - }, - "identifierName": "start" + } }, "name": "start" } @@ -117,8 +116,7 @@ "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 7f81100ffa..c1996f9d1b 100644 --- a/test/fixtures/esprima/statement-labelled/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-labelled/migrated_0002/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "test" + } }, "name": "test" } @@ -86,13 +85,11 @@ "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 fe9666a99e..3811851cf2 100644 --- a/test/fixtures/esprima/statement-return/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-return/migrated_0000/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -96,8 +95,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/esprima/statement-return/migrated_0001/expected.json b/test/fixtures/esprima/statement-return/migrated_0001/expected.json index 1f4ff8a16a..cfc30f8e34 100644 --- a/test/fixtures/esprima/statement-return/migrated_0001/expected.json +++ b/test/fixtures/esprima/statement-return/migrated_0001/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -96,8 +95,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/esprima/statement-return/migrated_0002/expected.json b/test/fixtures/esprima/statement-return/migrated_0002/expected.json index 05b71f8cff..7e253235fc 100644 --- a/test/fixtures/esprima/statement-return/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-return/migrated_0002/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -102,8 +101,7 @@ "end": { "line": 1, "column": 21 - }, - "identifierName": "x" + } }, "name": "x" } @@ -112,8 +110,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/esprima/statement-return/migrated_0003/expected.json b/test/fixtures/esprima/statement-return/migrated_0003/expected.json index bd73928291..d4f71c39ad 100644 --- a/test/fixtures/esprima/statement-return/migrated_0003/expected.json +++ b/test/fixtures/esprima/statement-return/migrated_0003/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -116,8 +115,7 @@ "end": { "line": 1, "column": 21 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -134,8 +132,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "y" + } }, "name": "y" } @@ -145,8 +142,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/esprima/statement-switch/migrated_0000/expected.json b/test/fixtures/esprima/statement-switch/migrated_0000/expected.json index b77f94e94a..e48fd0f035 100644 --- a/test/fixtures/esprima/statement-switch/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-switch/migrated_0000/expected.json @@ -54,14 +54,12 @@ "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 3c3a42b257..54b7c12792 100644 --- a/test/fixtures/esprima/statement-switch/migrated_0001/expected.json +++ b/test/fixtures/esprima/statement-switch/migrated_0001/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "answer" + } }, "name": "answer" }, @@ -115,8 +114,7 @@ "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 f474c77e7d..ce967090f0 100644 --- a/test/fixtures/esprima/statement-switch/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-switch/migrated_0002/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "answer" + } }, "name": "answer" }, @@ -115,8 +114,7 @@ "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 a5a7fc11ac..0e9f3c0da0 100644 --- a/test/fixtures/esprima/statement-throw/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-throw/migrated_0000/expected.json @@ -54,13 +54,11 @@ "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 fbc9ab8952..91f3d0ffa7 100644 --- a/test/fixtures/esprima/statement-throw/migrated_0001/expected.json +++ b/test/fixtures/esprima/statement-throw/migrated_0001/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -86,14 +85,12 @@ "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 e0ef904785..1586888a8b 100644 --- a/test/fixtures/esprima/statement-throw/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-throw/migrated_0002/expected.json @@ -86,8 +86,7 @@ "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 e5753c7cc2..49a3324324 100644 --- a/test/fixtures/esprima/statement-try/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-try/migrated_0000/expected.json @@ -56,8 +56,7 @@ "column": 7 } }, - "body": [], - "directives": [] + "body": [] }, "handler": { "type": "CatchClause", @@ -85,8 +84,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "e" + } }, "name": "e" }, @@ -104,14 +102,12 @@ "column": 21 } }, - "body": [], - "directives": [] + "body": [] } }, "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 7a8e08f5e0..4fa8f999b5 100644 --- a/test/fixtures/esprima/statement-try/migrated_0001/expected.json +++ b/test/fixtures/esprima/statement-try/migrated_0001/expected.json @@ -56,8 +56,7 @@ "column": 7 } }, - "body": [], - "directives": [] + "body": [] }, "handler": { "type": "CatchClause", @@ -85,8 +84,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "eval" + } }, "name": "eval" }, @@ -104,14 +102,12 @@ "column": 24 } }, - "body": [], - "directives": [] + "body": [] } }, "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 a6eb4ec45b..42cc2e8bf7 100644 --- a/test/fixtures/esprima/statement-try/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-try/migrated_0002/expected.json @@ -56,8 +56,7 @@ "column": 7 } }, - "body": [], - "directives": [] + "body": [] }, "handler": { "type": "CatchClause", @@ -85,8 +84,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "arguments" + } }, "name": "arguments" }, @@ -104,14 +102,12 @@ "column": 29 } }, - "body": [], - "directives": [] + "body": [] } }, "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 2e17e596c6..bb353db32f 100644 --- a/test/fixtures/esprima/statement-try/migrated_0003/expected.json +++ b/test/fixtures/esprima/statement-try/migrated_0003/expected.json @@ -56,8 +56,7 @@ "column": 7 } }, - "body": [], - "directives": [] + "body": [] }, "handler": { "type": "CatchClause", @@ -85,8 +84,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "e" + } }, "name": "e" }, @@ -145,8 +143,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "say" + } }, "name": "say" }, @@ -163,22 +160,19 @@ "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 4f92072de7..ca8f6bd080 100644 --- a/test/fixtures/esprima/statement-try/migrated_0004/expected.json +++ b/test/fixtures/esprima/statement-try/migrated_0004/expected.json @@ -56,8 +56,7 @@ "column": 7 } }, - "body": [], - "directives": [] + "body": [] }, "handler": null, "guardedHandlers": [], @@ -116,8 +115,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "cleanup" + } }, "name": "cleanup" }, @@ -134,19 +132,16 @@ "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 6024793dbd..291705c18b 100644 --- a/test/fixtures/esprima/statement-try/migrated_0005/expected.json +++ b/test/fixtures/esprima/statement-try/migrated_0005/expected.json @@ -97,16 +97,14 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "doThat" + } }, "name": "doThat" }, "arguments": [] } } - ], - "directives": [] + ] }, "handler": { "type": "CatchClause", @@ -134,8 +132,7 @@ "end": { "line": 1, "column": 26 - }, - "identifierName": "e" + } }, "name": "e" }, @@ -194,8 +191,7 @@ "end": { "line": 1, "column": 33 - }, - "identifierName": "say" + } }, "name": "say" }, @@ -212,22 +208,19 @@ "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 c73f720c72..9dd799f3ee 100644 --- a/test/fixtures/esprima/statement-try/migrated_0006/expected.json +++ b/test/fixtures/esprima/statement-try/migrated_0006/expected.json @@ -97,16 +97,14 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "doThat" + } }, "name": "doThat" }, "arguments": [] } } - ], - "directives": [] + ] }, "handler": { "type": "CatchClause", @@ -134,8 +132,7 @@ "end": { "line": 1, "column": 26 - }, - "identifierName": "e" + } }, "name": "e" }, @@ -194,8 +191,7 @@ "end": { "line": 1, "column": 33 - }, - "identifierName": "say" + } }, "name": "say" }, @@ -212,16 +208,14 @@ "end": { "line": 1, "column": 35 - }, - "identifierName": "e" + } }, "name": "e" } ] } } - ], - "directives": [] + ] } }, "guardedHandlers": [], @@ -280,8 +274,7 @@ "end": { "line": 1, "column": 56 - }, - "identifierName": "cleanup" + } }, "name": "cleanup" }, @@ -298,19 +291,16 @@ "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 2dc156600a..ec2dadfcf0 100644 --- a/test/fixtures/esprima/statement-variable/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-variable/migrated_0000/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -79,7 +78,6 @@ ], "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 efb47e7394..4ed5077fe0 100644 --- a/test/fixtures/esprima/statement-variable/migrated_0001/expected.json +++ b/test/fixtures/esprima/statement-variable/migrated_0001/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -102,8 +101,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -112,7 +110,6 @@ ], "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 8515e2fd31..fceb7088d9 100644 --- a/test/fixtures/esprima/statement-variable/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-variable/migrated_0002/expected.json @@ -69,8 +69,7 @@ "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 c43470cfea..0937c1b68d 100644 --- a/test/fixtures/esprima/statement-variable/migrated_0003/expected.json +++ b/test/fixtures/esprima/statement-variable/migrated_0003/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "eval" + } }, "name": "eval" }, @@ -121,8 +120,7 @@ "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 880833c662..4c14f501ea 100644 --- a/test/fixtures/esprima/statement-variable/migrated_0004/expected.json +++ b/test/fixtures/esprima/statement-variable/migrated_0004/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -121,8 +120,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -173,8 +171,7 @@ "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 3b4811d947..17a5559327 100644 --- a/test/fixtures/esprima/statement-variable/migrated_0005/expected.json +++ b/test/fixtures/esprima/statement-variable/migrated_0005/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "implements" + } }, "name": "implements" }, @@ -102,8 +101,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "interface" + } }, "name": "interface" }, @@ -135,8 +133,7 @@ "end": { "line": 1, "column": 34 - }, - "identifierName": "package" + } }, "name": "package" }, @@ -145,7 +142,6 @@ ], "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 1afee34c9e..8744560249 100644 --- a/test/fixtures/esprima/statement-variable/migrated_0006/expected.json +++ b/test/fixtures/esprima/statement-variable/migrated_0006/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "private" + } }, "name": "private" }, @@ -102,8 +101,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "protected" + } }, "name": "protected" }, @@ -135,8 +133,7 @@ "end": { "line": 1, "column": 30 - }, - "identifierName": "public" + } }, "name": "public" }, @@ -168,8 +165,7 @@ "end": { "line": 1, "column": 38 - }, - "identifierName": "static" + } }, "name": "static" }, @@ -178,7 +174,6 @@ ], "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 c1ca938f16..f4e3da9d15 100644 --- a/test/fixtures/esprima/statement-with/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-with/migrated_0000/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -117,15 +115,13 @@ "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_0000/expected.lightscript.json b/test/fixtures/esprima/statement-with/migrated_0000/expected.lightscript.json new file mode 100644 index 0000000000..cf49c292d6 --- /dev/null +++ b/test/fixtures/esprima/statement-with/migrated_0000/expected.lightscript.json @@ -0,0 +1,133 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WithStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "object": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "x" + }, + "name": "x" + }, + "body": { + "type": "VariableDeclaration", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 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 bca8b9d7da..9e895a7f45 100644 --- a/test/fixtures/esprima/statement-with/migrated_0001/expected.json +++ b/test/fixtures/esprima/statement-with/migrated_0001/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -117,15 +115,13 @@ "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.lightscript.json b/test/fixtures/esprima/statement-with/migrated_0001/expected.lightscript.json new file mode 100644 index 0000000000..184633b878 --- /dev/null +++ b/test/fixtures/esprima/statement-with/migrated_0001/expected.lightscript.json @@ -0,0 +1,133 @@ +{ + "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": "WithStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "object": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "x" + }, + "name": "x" + }, + "body": { + "type": "VariableDeclaration", + "start": 9, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 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 e44e902aa7..d9e30cca90 100644 --- a/test/fixtures/esprima/statement-with/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-with/migrated_0002/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -115,8 +114,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -132,18 +130,15 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "bar" + } }, "name": "bar" } } } - ], - "directives": [] + ] } } - ], - "directives": [] + ] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-with/migrated_0002/expected.lightscript.json b/test/fixtures/esprima/statement-with/migrated_0002/expected.lightscript.json new file mode 100644 index 0000000000..d39409dcc3 --- /dev/null +++ b/test/fixtures/esprima/statement-with/migrated_0002/expected.lightscript.json @@ -0,0 +1,154 @@ +{ + "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": "WithStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "object": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "x" + }, + "name": "x" + }, + "body": { + "type": "BlockStatement", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 11, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 11, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "bar" + }, + "name": "bar" + } + } + ] + } + ], + "directives": [], + "extra": { + "curly": true + } + } + } + ], + "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 8b70b14f6d..87805524b4 100644 --- a/test/fixtures/estree/class-method/basic/expected.json +++ b/test/fixtures/estree/class-method/basic/expected.json @@ -89,7 +89,6 @@ "column": 10 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -108,6 +107,7 @@ }, "name": "foo" }, + "static": false, "kind": "method", "value": { "type": "FunctionExpression", @@ -125,7 +125,6 @@ }, "id": null, "generator": false, - "expression": false, "async": false, "params": [], "body": { @@ -143,7 +142,8 @@ } }, "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 deleted file mode 100644 index 43e689ef2a..0000000000 --- a/test/fixtures/estree/directives/program-order/actual.js +++ /dev/null @@ -1,3 +0,0 @@ -"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 deleted file mode 100644 index 2f58e0a7a4..0000000000 --- a/test/fixtures/estree/directives/program-order/expected.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "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 0fb347fbd5..9cb28a78b5 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 f333081a50..3d8f657e41 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 f27bafff6e..4a0f809cc1 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 dd522b9e9c..1cc7f34829 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 5e91d5d539..eb0a80831e 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 650d82af47..61a0aaeb62 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 deleted file mode 100644 index fd3dc7f8ae..0000000000 --- a/test/fixtures/experimental/async-generators/class-method-2/actual.js +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index ea451fd3cb..0000000000 --- a/test/fixtures/experimental/async-generators/class-method-2/expected.json +++ /dev/null @@ -1,141 +0,0 @@ -{ - "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 deleted file mode 100644 index 4b42b64210..0000000000 --- a/test/fixtures/experimental/async-generators/class-method-no-asi/actual.js +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index af38bd1530..0000000000 --- a/test/fixtures/experimental/async-generators/class-method-no-asi/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 82b6bd579f..f1a8cb05c1 100644 --- a/test/fixtures/experimental/async-generators/class-method/expected.json +++ b/test/fixtures/experimental/async-generators/class-method/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "Query" + } }, "name": "Query" }, @@ -89,7 +88,6 @@ "column": 5 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,11 +101,11 @@ "end": { "line": 2, "column": 19 - }, - "identifierName": "queryAll" + } }, "name": "queryAll" }, + "static": false, "kind": "method", "id": null, "generator": true, @@ -126,8 +124,7 @@ "end": { "line": 2, "column": 23 - }, - "identifierName": "ids" + } }, "name": "ids" } @@ -161,7 +158,6 @@ "column": 9 } }, - "await": false, "left": { "type": "VariableDeclaration", "start": 54, @@ -203,8 +199,7 @@ "end": { "line": 3, "column": 21 - }, - "identifierName": "id" + } }, "name": "id" }, @@ -225,8 +220,7 @@ "end": { "line": 3, "column": 28 - }, - "identifierName": "ids" + } }, "name": "ids" }, @@ -343,8 +337,7 @@ "end": { "line": 4, "column": 34 - }, - "identifierName": "query" + } }, "name": "query" }, @@ -363,8 +356,7 @@ "end": { "line": 4, "column": 37 - }, - "identifierName": "id" + } }, "name": "id" } @@ -387,4 +379,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/experimental/async-generators/for-await-async-context/options.lightscript.json b/test/fixtures/experimental/async-generators/for-await-async-context/options.lightscript.json new file mode 100644 index 0000000000..38ea64b097 --- /dev/null +++ b/test/fixtures/experimental/async-generators/for-await-async-context/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (2:13)" +} \ 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 b69586316e..1551481f51 100644 --- a/test/fixtures/experimental/async-generators/for-await/expected.json +++ b/test/fixtures/experimental/async-generators/for-await/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -79,7 +78,7 @@ }, "body": [ { - "type": "ForOfStatement", + "type": "ForAwaitStatement", "start": 23, "end": 46, "loc": { @@ -92,7 +91,6 @@ "column": 25 } }, - "await": true, "left": { "type": "VariableDeclaration", "start": 34, @@ -134,8 +132,7 @@ "end": { "line": 2, "column": 18 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -156,8 +153,7 @@ "end": { "line": 2, "column": 23 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -184,4 +180,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 79413a2d47..5a25c2ce85 100644 --- a/test/fixtures/experimental/async-generators/object-method/expected.json +++ b/test/fixtures/experimental/async-generators/object-method/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "query" + } }, "name": "query" }, @@ -118,8 +117,7 @@ "end": { "line": 2, "column": 19 - }, - "identifierName": "queryAll" + } }, "name": "queryAll" }, @@ -141,8 +139,7 @@ "end": { "line": 2, "column": 23 - }, - "identifierName": "ids" + } }, "name": "ids" } @@ -176,7 +173,6 @@ "column": 9 } }, - "await": false, "left": { "type": "VariableDeclaration", "start": 56, @@ -218,8 +214,7 @@ "end": { "line": 3, "column": 21 - }, - "identifierName": "id" + } }, "name": "id" }, @@ -240,8 +235,7 @@ "end": { "line": 3, "column": 28 - }, - "identifierName": "ids" + } }, "name": "ids" }, @@ -358,8 +352,7 @@ "end": { "line": 4, "column": 34 - }, - "identifierName": "query" + } }, "name": "query" }, @@ -378,8 +371,7 @@ "end": { "line": 4, "column": 37 - }, - "identifierName": "id" + } }, "name": "id" } @@ -405,4 +397,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 new file mode 100644 index 0000000000..6fd5dd7d11 --- /dev/null +++ b/test/fixtures/experimental/class-constructor-call/.duplicate/actual.js @@ -0,0 +1,4 @@ +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 new file mode 100644 index 0000000000..9a3bd5d8d6 --- /dev/null +++ b/test/fixtures/experimental/class-constructor-call/illegal-generator/actual.js @@ -0,0 +1,5 @@ +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 new file mode 100644 index 0000000000..db35c194d3 --- /dev/null +++ b/test/fixtures/experimental/class-constructor-call/illegal-generator/options.json @@ -0,0 +1,3 @@ +{ + "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 new file mode 100644 index 0000000000..e3155a24a8 --- /dev/null +++ b/test/fixtures/experimental/class-constructor-call/illegal-key/actual.js @@ -0,0 +1,5 @@ +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 new file mode 100644 index 0000000000..606cbed9d9 --- /dev/null +++ b/test/fixtures/experimental/class-constructor-call/illegal-key/options.json @@ -0,0 +1,3 @@ +{ + "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 new file mode 100644 index 0000000000..253cf5199b --- /dev/null +++ b/test/fixtures/experimental/class-constructor-call/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classConstructorCall"] +} diff --git a/test/fixtures/experimental/class-constructor-call/plain/actual.js b/test/fixtures/experimental/class-constructor-call/plain/actual.js new file mode 100644 index 0000000000..1f8b64ef4a --- /dev/null +++ b/test/fixtures/experimental/class-constructor-call/plain/actual.js @@ -0,0 +1,5 @@ +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 new file mode 100644 index 0000000000..49c89dadbc --- /dev/null +++ b/test/fixtures/experimental/class-constructor-call/plain/expected.json @@ -0,0 +1,186 @@ +{ + "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-computed/expected.lightscript.json b/test/fixtures/experimental/class-properties/asi-failure-computed/expected.lightscript.json new file mode 100644 index 0000000000..638018d996 --- /dev/null +++ b/test/fixtures/experimental/class-properties/asi-failure-computed/expected.lightscript.json @@ -0,0 +1,195 @@ +{ + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "p" + }, + "name": "p" + }, + "static": false, + "value": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + { + "type": "ClassMethod", + "start": 22, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "computed": true, + "key": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 4 + }, + "identifierName": "m" + }, + "name": "m" + }, + "static": false, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ], + "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 deleted file mode 100644 index efddc05595..0000000000 --- a/test/fixtures/experimental/class-properties/asi-failure-inline/actual.js +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 2a11366381..0000000000 --- a/test/fixtures/experimental/class-properties/asi-failure-inline/options.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "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 180c9fa44d..c78a521f9c 100644 --- a/test/fixtures/experimental/class-properties/asi-success/expected.json +++ b/test/fixtures/experimental/class-properties/asi-success/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -89,7 +88,6 @@ "column": 3 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,11 +101,11 @@ "end": { "line": 2, "column": 3 - }, - "identifierName": "x" + } }, "name": "x" }, + "static": false, "value": null }, { @@ -124,7 +122,6 @@ "column": 3 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -138,11 +135,11 @@ "end": { "line": 3, "column": 3 - }, - "identifierName": "y" + } }, "name": "y" }, + "static": false, "value": null } ] @@ -174,8 +171,7 @@ "end": { "line": 6, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -209,7 +205,6 @@ "column": 3 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -223,11 +218,11 @@ "end": { "line": 7, "column": 3 - }, - "identifierName": "p" + } }, "name": "p" }, + "static": false, "value": null }, { @@ -244,7 +239,6 @@ "column": 11 } }, - "static": false, "computed": true, "key": { "type": "Identifier", @@ -258,16 +252,15 @@ "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 dcdd64b2d8..763fedb8d0 100644 --- a/test/fixtures/experimental/class-properties/computed/expected.json +++ b/test/fixtures/experimental/class-properties/computed/expected.json @@ -89,7 +89,6 @@ "column": 5 } }, - "static": false, "computed": true, "key": { "type": "Identifier", @@ -108,6 +107,7 @@ }, "name": "x" }, + "static": false, "value": null }, { @@ -124,7 +124,6 @@ "column": 7 } }, - "static": false, "computed": true, "key": { "type": "StringLiteral", @@ -146,6 +145,7 @@ }, "value": "y" }, + "static": false, "value": null } ] @@ -212,7 +212,6 @@ "column": 5 } }, - "static": false, "computed": true, "key": { "type": "Identifier", @@ -231,6 +230,7 @@ }, "name": "p" }, + "static": false, "value": null }, { @@ -247,7 +247,6 @@ "column": 11 } }, - "static": false, "computed": true, "key": { "type": "Identifier", @@ -266,6 +265,7 @@ }, "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 deleted file mode 100644 index 539a3ccff8..0000000000 --- a/test/fixtures/experimental/class-properties/edge-cases/actual.js +++ /dev/null @@ -1,50 +0,0 @@ -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 deleted file mode 100644 index e029628a70..0000000000 --- a/test/fixtures/experimental/class-properties/edge-cases/expected.json +++ /dev/null @@ -1,1496 +0,0 @@ -{ - "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 deleted file mode 100644 index 9c27576d4a..0000000000 --- a/test/fixtures/experimental/class-properties/edge-cases/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/test/fixtures/experimental/class-properties/inline/actual.js b/test/fixtures/experimental/class-properties/inline/actual.js deleted file mode 100644 index 615a25ab4e..0000000000 --- a/test/fixtures/experimental/class-properties/inline/actual.js +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index d5369121bb..0000000000 --- a/test/fixtures/experimental/class-properties/inline/expected.json +++ /dev/null @@ -1,312 +0,0 @@ -{ - "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 deleted file mode 100644 index 9c27576d4a..0000000000 --- a/test/fixtures/experimental/class-properties/inline/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index a327a4a132..0000000000 --- a/test/fixtures/experimental/class-properties/no-ctor-2/actual.js +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index 9884529d32..0000000000 --- a/test/fixtures/experimental/class-properties/no-ctor-2/options.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "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 deleted file mode 100644 index 581943685f..0000000000 --- a/test/fixtures/experimental/class-properties/no-ctor/actual.js +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 9884529d32..0000000000 --- a/test/fixtures/experimental/class-properties/no-ctor/options.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "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 deleted file mode 100644 index a7eb328656..0000000000 --- a/test/fixtures/experimental/class-properties/no-static-prototype-2/actual.js +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index 5bde2716eb..0000000000 --- a/test/fixtures/experimental/class-properties/no-static-prototype-2/options.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "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 deleted file mode 100644 index f7a9f68dfe..0000000000 --- a/test/fixtures/experimental/class-properties/no-static-prototype/actual.js +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 5bde2716eb..0000000000 --- a/test/fixtures/experimental/class-properties/no-static-prototype/options.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "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 deleted file mode 100644 index f82f8d51d7..0000000000 --- a/test/fixtures/experimental/class-properties/with-initializer-and-type-no-plugin/actual.js +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index e185feb80a..0000000000 --- a/test/fixtures/experimental/class-properties/with-initializer-and-type-no-plugin/options.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "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 deleted file mode 100644 index fa80e3af68..0000000000 --- a/test/fixtures/experimental/class-properties/with-initializer-missing-plugin/actual.js +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index af38bd1530..0000000000 --- a/test/fixtures/experimental/class-properties/with-initializer-missing-plugin/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index a36cdd975c..0000000000 --- a/test/fixtures/experimental/class-properties/without-initializer-missing-plugin/actual.js +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index af38bd1530..0000000000 --- a/test/fixtures/experimental/class-properties/without-initializer-missing-plugin/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 4a401fa758..db2bccbfcb 100644 --- a/test/fixtures/experimental/decorators/class-method-parameter/expected.json +++ b/test/fixtures/experimental/decorators/class-method-parameter/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -89,7 +88,6 @@ "column": 53 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,16 +101,15 @@ "end": { "line": 2, "column": 13 - }, - "identifierName": "constructor" + } }, "name": "constructor" }, + "static": false, "kind": "constructor", "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -126,8 +123,7 @@ "end": { "line": 2, "column": 22 - }, - "identifierName": "x" + } }, "name": "x", "decorators": [ @@ -171,8 +167,7 @@ "end": { "line": 2, "column": 18 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -193,8 +188,7 @@ "end": { "line": 2, "column": 49 - }, - "identifierName": "y" + } }, "name": "y", "decorators": [ @@ -238,8 +232,7 @@ "end": { "line": 2, "column": 28 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -288,8 +281,7 @@ "end": { "line": 2, "column": 32 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -359,8 +351,7 @@ "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 16385a68fc..184415bff7 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,7 +156,6 @@ } } ], - "static": false, "computed": false, "key": { "type": "Identifier", @@ -175,6 +174,7 @@ }, "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 71b00fd8a1..d0c4947e9b 100644 --- a/test/fixtures/experimental/decorators/computed-member-expression/expected.json +++ b/test/fixtures/experimental/decorators/computed-member-expression/expected.json @@ -156,7 +156,6 @@ } } ], - "static": false, "computed": false, "key": { "type": "Identifier", @@ -175,6 +174,7 @@ }, "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 deleted file mode 100644 index 51804c6056..0000000000 --- a/test/fixtures/experimental/decorators/export-decorators-on-class/actual.js +++ /dev/null @@ -1,2 +0,0 @@ -@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 deleted file mode 100644 index 6933de60e7..0000000000 --- a/test/fixtures/experimental/decorators/export-decorators-on-class/expected.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "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-default-declaration-function-declaration-parameter/expected.json b/test/fixtures/experimental/decorators/export-default-declaration-function-declaration-parameter/expected.json index a936f5fee4..7905089635 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,14 +68,12 @@ "end": { "line": 1, "column": 28 - }, - "identifierName": "func" + } }, "name": "func" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -89,8 +87,7 @@ "end": { "line": 1, "column": 37 - }, - "identifierName": "x" + } }, "name": "x", "decorators": [ @@ -134,8 +131,7 @@ "end": { "line": 1, "column": 33 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -156,8 +152,7 @@ "end": { "line": 1, "column": 64 - }, - "identifierName": "y" + } }, "name": "y", "decorators": [ @@ -201,8 +196,7 @@ "end": { "line": 1, "column": 43 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -251,8 +245,7 @@ "end": { "line": 1, "column": 47 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -322,8 +315,7 @@ "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 2c797decfc..8fc784a7a3 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,6 +56,23 @@ "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", @@ -90,23 +107,6 @@ } } ], - "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,7 +137,6 @@ "column": 3 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -156,6 +155,7 @@ }, "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 2949fbdb5c..8d6e1bf9f3 100644 --- a/test/fixtures/experimental/decorators/function-declaration-parameter/expected.json +++ b/test/fixtures/experimental/decorators/function-declaration-parameter/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "func" + } }, "name": "func" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "x" + } }, "name": "x", "decorators": [ @@ -120,8 +117,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -142,8 +138,7 @@ "end": { "line": 1, "column": 49 - }, - "identifierName": "y" + } }, "name": "y", "decorators": [ @@ -187,8 +182,7 @@ "end": { "line": 1, "column": 28 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -237,8 +231,7 @@ "end": { "line": 1, "column": 32 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -308,8 +301,7 @@ "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 652a728e04..8c82bbc2f3 100644 --- a/test/fixtures/experimental/decorators/function-expression-parameter/expected.json +++ b/test/fixtures/experimental/decorators/function-expression-parameter/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "func" + } }, "name": "func" }, @@ -91,7 +90,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -105,8 +103,7 @@ "end": { "line": 1, "column": 31 - }, - "identifierName": "x" + } }, "name": "x", "decorators": [ @@ -150,8 +147,7 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -172,8 +168,7 @@ "end": { "line": 1, "column": 58 - }, - "identifierName": "y" + } }, "name": "y", "decorators": [ @@ -217,8 +212,7 @@ "end": { "line": 1, "column": 37 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -267,8 +261,7 @@ "end": { "line": 1, "column": 41 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -338,8 +331,7 @@ "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 deleted file mode 100644 index 4387084bbf..0000000000 --- a/test/fixtures/experimental/decorators/no-constructor-decorators/actual.js +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index c0baef5996..0000000000 --- a/test/fixtures/experimental/decorators/no-constructor-decorators/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index c5a55d643f..0000000000 --- a/test/fixtures/experimental/decorators/no-export-decorators-without-class/actual.js +++ /dev/null @@ -1,2 +0,0 @@ -@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 deleted file mode 100644 index 61c2c23daa..0000000000 --- a/test/fixtures/experimental/decorators/no-export-decorators-without-class/options.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "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 deleted file mode 100644 index 4630d555a4..0000000000 --- a/test/fixtures/experimental/decorators/no-export-decorators/actual.js +++ /dev/null @@ -1,2 +0,0 @@ -@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 deleted file mode 100644 index 61c2c23daa..0000000000 --- a/test/fixtures/experimental/decorators/no-export-decorators/options.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "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 5a22cd58ee..08600db91a 100644 --- a/test/fixtures/experimental/decorators/object-method-parameter/expected.json +++ b/test/fixtures/experimental/decorators/object-method-parameter/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "obj" + } }, "name": "obj" }, @@ -118,8 +117,7 @@ "end": { "line": 2, "column": 8 - }, - "identifierName": "method" + } }, "name": "method" }, @@ -127,7 +125,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -141,8 +138,7 @@ "end": { "line": 2, "column": 17 - }, - "identifierName": "x" + } }, "name": "x", "decorators": [ @@ -186,8 +182,7 @@ "end": { "line": 2, "column": 13 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -208,8 +203,7 @@ "end": { "line": 2, "column": 44 - }, - "identifierName": "y" + } }, "name": "y", "decorators": [ @@ -253,8 +247,7 @@ "end": { "line": 2, "column": 23 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -303,8 +296,7 @@ "end": { "line": 2, "column": 27 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -374,8 +366,7 @@ "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 deleted file mode 100644 index 871cd28fa8..0000000000 --- a/test/fixtures/experimental/export-extensions/ns-default/actual.js +++ /dev/null @@ -1 +0,0 @@ -export * as default from "foo"; diff --git a/test/fixtures/experimental/export-extensions/ns-default/expected.json b/test/fixtures/experimental/export-extensions/ns-default/expected.json deleted file mode 100644 index 38c5f40bd5..0000000000 --- a/test/fixtures/experimental/export-extensions/ns-default/expected.json +++ /dev/null @@ -1,103 +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": "module", - "body": [ - { - "type": "ExportNamedDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, - "specifiers": [ - { - "type": "ExportNamespaceSpecifier", - "start": 7, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "exported": { - "type": "Identifier", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "default" - }, - "name": "default" - } - } - ], - "source": { - "type": "StringLiteral", - "start": 25, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 30 - } - }, - "extra": { - "rawValue": "foo", - "raw": "\"foo\"" - }, - "value": "foo" - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/test/fixtures/experimental/function-sent/inside-generator/expected.json b/test/fixtures/experimental/function-sent/inside-generator/expected.json index bfacd5b28e..c0692c9a9d 100644 --- a/test/fixtures/experimental/function-sent/inside-generator/expected.json +++ b/test/fixtures/experimental/function-sent/inside-generator/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "foo" + } }, "name": "foo" }, "generator": true, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -118,8 +116,7 @@ "end": { "line": 2, "column": 17 - }, - "identifierName": "function" + } }, "name": "function" }, @@ -135,8 +132,7 @@ "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 5a26deddd0..5ee0540170 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": "RestElement", + "type": "RestProperty", "start": 5, "end": 9, "loc": { @@ -98,8 +98,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "x" + } }, "name": "x" } @@ -118,8 +117,7 @@ "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 cd68bed7a3..6f6be6d836 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": "RestElement", + "type": "RestProperty", "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 c6d9695d8b..0c15cfbe9c 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": "RestElement", + "type": "RestProperty", "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 77ad59f8cb..f017a9cc8e 100644 --- a/test/fixtures/experimental/object-rest-spread/2/expected.json +++ b/test/fixtures/experimental/object-rest-spread/2/expected.json @@ -101,8 +101,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,17 +117,13 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "x" + } }, "name": "x" - }, - "extra": { - "shorthand": true } }, { - "type": "RestElement", + "type": "RestProperty", "start": 8, "end": 12, "loc": { @@ -153,8 +148,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "y" + } }, "name": "y" } @@ -173,8 +167,7 @@ "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 bb0cd7a162..64c2046836 100644 --- a/test/fixtures/experimental/object-rest-spread/3/expected.json +++ b/test/fixtures/experimental/object-rest-spread/3/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "ObjectPattern", @@ -105,8 +104,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -122,17 +120,13 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "x" + } }, "name": "x" - }, - "extra": { - "shorthand": true } }, { - "type": "RestElement", + "type": "RestProperty", "start": 14, "end": 18, "loc": { @@ -157,8 +151,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "y" + } }, "name": "y" } @@ -184,8 +177,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/experimental/object-rest-spread/4/expected.json b/test/fixtures/experimental/object-rest-spread/4/expected.json index 8b971ee635..0a777c2a2f 100644 --- a/test/fixtures/experimental/object-rest-spread/4/expected.json +++ b/test/fixtures/experimental/object-rest-spread/4/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "z" + } }, "name": "z" }, @@ -90,7 +89,7 @@ }, "properties": [ { - "type": "SpreadElement", + "type": "SpreadProperty", "start": 9, "end": 13, "loc": { @@ -115,8 +114,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "x" + } }, "name": "x" } @@ -127,7 +125,6 @@ ], "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 efbc0e3f05..13c6c8dc0c 100644 --- a/test/fixtures/experimental/object-rest-spread/5/expected.json +++ b/test/fixtures/experimental/object-rest-spread/5/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "z" + } }, "name": "z" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -135,17 +133,13 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "x" + } }, "name": "x" - }, - "extra": { - "shorthand": true } }, { - "type": "SpreadElement", + "type": "SpreadProperty", "start": 8, "end": 12, "loc": { @@ -170,8 +164,7 @@ "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 new file mode 100644 index 0000000000..f7c8bbe8d6 --- /dev/null +++ b/test/fixtures/experimental/object-rest-spread/5/expected.lightscript.json @@ -0,0 +1,188 @@ +{ + "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 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "z" + }, + "name": "z" + }, + "init": { + "type": "ObjectExpression", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "x" + }, + "name": "x" + }, + "value": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "x" + }, + "name": "x" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "SpreadProperty", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "argument": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "y" + }, + "name": "y" + } + } + ] + } + } + ] + } + ], + "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 0584ebbbe7..748d406185 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": "SpreadElement", + "type": "SpreadProperty", "start": 5, "end": 9, "loc": { @@ -200,7 +200,7 @@ } }, { - "type": "SpreadElement", + "type": "SpreadProperty", "start": 14, "end": 18, "loc": { diff --git a/test/fixtures/experimental/object-rest-spread/8/expected.json b/test/fixtures/experimental/object-rest-spread/8/expected.json new file mode 100644 index 0000000000..f97a0ab95c --- /dev/null +++ b/test/fixtures/experimental/object-rest-spread/8/expected.json @@ -0,0 +1,243 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "ObjectPattern", + "start": 4, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "x" + }, + "name": "x" + }, + "value": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "x" + }, + "name": "x" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "y" + }, + "name": "y" + }, + "value": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "y" + }, + "name": "y" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "RestProperty", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "argument": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "z" + }, + "name": "z" + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "obj" + }, + "name": "obj" + } + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/object-rest-spread/8/options.json b/test/fixtures/experimental/object-rest-spread/8/options.json deleted file mode 100644 index 4a97ac85ea..0000000000 --- a/test/fixtures/experimental/object-rest-spread/8/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index e62c7abcaf..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/1/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index d8b75cc1d0..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/1/expected.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "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 deleted file mode 100644 index 1b7671b74a..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/10/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 6ef94ad9bd..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/10/expected.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "expression": { - "type": "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 deleted file mode 100644 index 87bfd46be5..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/11/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 1cf6041972..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/11/expected.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "sourceType": "script", - "body": [ - { - "type": "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 deleted file mode 100644 index eed8a8c9a1..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/12/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index eaa8c4ab42..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/12/expected.json +++ /dev/null @@ -1,200 +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": 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 deleted file mode 100644 index 28ab31c9c1..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/actual.js +++ /dev/null @@ -1 +0,0 @@ -sampleTag`\xAg` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/expected.json deleted file mode 100644 index 6422cab83c..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/expected.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "expression": { - "type": "TaggedTemplateExpression", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "tag": { - "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, - "name": "sampleTag" - }, - "quasi": { - "type": "TemplateLiteral", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "expressions": [], - "quasis": [ - { - "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, - "value": { - "raw": "\\xAg", - "cooked": null - }, - "tail": true - } - ] - } - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/14/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/14/actual.js deleted file mode 100644 index cc0ec32af0..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/14/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 253459c464..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/14/expected.json +++ /dev/null @@ -1,160 +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": "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 deleted file mode 100644 index cd57463528..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/15/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index ec73dac5d8..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/15/expected.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "expression": { - "type": "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 deleted file mode 100644 index 04cdb9e9b2..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/16/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index bf367875f1..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/16/expected.json +++ /dev/null @@ -1,200 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "sourceType": "script", - "body": [ - { - "type": "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 deleted file mode 100644 index 191ca653c0..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/17/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index db6bfd7588..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/17/expected.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "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 deleted file mode 100644 index ab93eda9d9..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/18/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 7d1d4ecac2..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/18/expected.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "expression": { - "type": "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 deleted file mode 100644 index d26dfc60e7..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/19/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 30b397ba11..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/19/expected.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "sourceType": "script", - "body": [ - { - "type": "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 deleted file mode 100644 index 4fb52640f5..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/2/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index dc2581302c..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/2/expected.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "expression": { - "type": "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 deleted file mode 100644 index 7b0f56fa2a..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/20/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 5995e5c491..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/20/expected.json +++ /dev/null @@ -1,200 +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": 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 deleted file mode 100644 index 6aa1d27769..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/21/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 3eff694145..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/21/expected.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "expression": { - "type": "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 deleted file mode 100644 index 44eb637a41..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/22/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index fcfe7dbcd0..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/22/expected.json +++ /dev/null @@ -1,160 +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": "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 deleted file mode 100644 index 30d440cd97..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/23/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index aa1740dac3..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/23/expected.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "expression": { - "type": "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 deleted file mode 100644 index 59d991056a..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/24/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 39b3bb484e..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/24/expected.json +++ /dev/null @@ -1,200 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "sourceType": "script", - "body": [ - { - "type": "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 deleted file mode 100644 index 05d2fafe66..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/25/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index f978e9e2bb..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/25/expected.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "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 deleted file mode 100644 index 525cfc3d26..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/26/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 02603f46cd..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/26/expected.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "sourceType": "script", - "body": [ - { - "type": "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 deleted file mode 100644 index b5687e98f8..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/27/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index bda12c9651..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/27/expected.json +++ /dev/null @@ -1,160 +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": "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 deleted file mode 100644 index 39b7ca87b5..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/28/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2ee6bf6d75..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/28/expected.json +++ /dev/null @@ -1,200 +0,0 @@ -{ - "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 deleted file mode 100644 index a409ba9123..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/29/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index ab787c76b0..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/29/expected.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "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 deleted file mode 100644 index 592b5c6eb8..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/3/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 82a87607c9..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/3/expected.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "sourceType": "script", - "body": [ - { - "type": "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 deleted file mode 100644 index c1b737a8de..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/30/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 5467e09a34..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/30/expected.json +++ /dev/null @@ -1,160 +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": "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 deleted file mode 100644 index 1936125122..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/31/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 7792df9415..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/31/expected.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "sourceType": "script", - "body": [ - { - "type": "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 deleted file mode 100644 index 8920322734..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/32/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 00a0ad78bc..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/32/expected.json +++ /dev/null @@ -1,200 +0,0 @@ -{ - "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 deleted file mode 100644 index ff7451e4f7..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/33/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 11d9cd92b3..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/33/expected.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "expression": { - "type": "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 deleted file mode 100644 index b936b2aa79..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/34/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 072eac4db4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/34/expected.json +++ /dev/null @@ -1,160 +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": "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 deleted file mode 100644 index af58ad5476..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/35/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index f6e57d84f1..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/35/expected.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "expression": { - "type": "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 deleted file mode 100644 index 9809674f2d..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/36/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 5a52cbb588..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/36/expected.json +++ /dev/null @@ -1,200 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "sourceType": "script", - "body": [ - { - "type": "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 deleted file mode 100644 index f3b7c60be7..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/37/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index b6ad827a92..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/37/expected.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "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 deleted file mode 100644 index 2de362b243..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/38/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index b25f264baf..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/38/expected.json +++ /dev/null @@ -1,160 +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": "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 deleted file mode 100644 index aec71687c2..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/39/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index d0ee5e2b4f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/39/expected.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "sourceType": "script", - "body": [ - { - "type": "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 deleted file mode 100644 index 4e72a53bb6..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/4/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 3c240cbca5..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/4/expected.json +++ /dev/null @@ -1,200 +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": 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 deleted file mode 100644 index 4884482024..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/40/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index c5c6235df6..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/40/expected.json +++ /dev/null @@ -1,200 +0,0 @@ -{ - "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 deleted file mode 100644 index 0dbd371767..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/41/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 70facd5b6a..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/41/expected.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "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 deleted file mode 100644 index 506ec11d83..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/42/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 4dd20c77bc..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/42/expected.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "sourceType": "script", - "body": [ - { - "type": "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 deleted file mode 100644 index 2f863994a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/43/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index d75d926a77..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/43/expected.json +++ /dev/null @@ -1,160 +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": "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 deleted file mode 100644 index 96f9d738d9..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/44/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 811cbc9664..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/44/expected.json +++ /dev/null @@ -1,200 +0,0 @@ -{ - "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 deleted file mode 100644 index 7be4c3fa0f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/45/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 7e104de733..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/45/expected.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "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 deleted file mode 100644 index 000f2fbf37..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/46/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 3f850af6f9..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/46/expected.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "expression": { - "type": "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 deleted file mode 100644 index 74d5b29f61..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/47/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 4d25257bf2..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/47/expected.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "sourceType": "script", - "body": [ - { - "type": "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 deleted file mode 100644 index 849edc693e..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/48/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 54b4914e13..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/48/expected.json +++ /dev/null @@ -1,200 +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": 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 deleted file mode 100644 index 9575b3d816..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/49/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 5dc69624b3..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/49/expected.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "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 deleted file mode 100644 index 00c3211a93..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/actual.js +++ /dev/null @@ -1 +0,0 @@ -sampleTag`\1` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/expected.json deleted file mode 100644 index bf13103e1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/expected.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "expression": { - "type": "TaggedTemplateExpression", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "tag": { - "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, - "name": "sampleTag" - }, - "quasi": { - "type": "TemplateLiteral", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "expressions": [], - "quasis": [ - { - "type": "TemplateElement", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, - "value": { - "raw": "\\1", - "cooked": null - }, - "tail": true - } - ] - } - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/50/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/50/actual.js deleted file mode 100644 index a931f49dc3..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/50/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 88982b42de..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/50/expected.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "sourceType": "script", - "body": [ - { - "type": "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 deleted file mode 100644 index 6c51808602..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/51/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 999202808b..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/51/expected.json +++ /dev/null @@ -1,160 +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": "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 deleted file mode 100644 index 71c32286f8..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/52/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index ff94ba4145..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/52/expected.json +++ /dev/null @@ -1,200 +0,0 @@ -{ - "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 deleted file mode 100644 index dadcb43b49..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/53/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index bd743338a8..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/53/expected.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "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 deleted file mode 100644 index 9d9f26b33b..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/54/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 1ef2fcc477..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/54/expected.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "sourceType": "script", - "body": [ - { - "type": "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 deleted file mode 100644 index e108605dd8..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/55/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index db9472adc3..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/55/expected.json +++ /dev/null @@ -1,160 +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": "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 deleted file mode 100644 index c53213af0b..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/56/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index a29dca62cb..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/56/expected.json +++ /dev/null @@ -1,200 +0,0 @@ -{ - "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 deleted file mode 100644 index 35fb813aeb..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/57/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 440e1e7b6c..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/57/expected.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "expression": { - "type": "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 deleted file mode 100644 index e6a45880f4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/58/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index d5c6e26513..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/58/expected.json +++ /dev/null @@ -1,160 +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": "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 deleted file mode 100644 index 8c3d8e2394..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/59/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index ea9c9bb696..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/59/expected.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "expression": { - "type": "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 deleted file mode 100644 index 636accd45c..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/6/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index e756aa3c50..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/6/expected.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "sourceType": "script", - "body": [ - { - "type": "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 deleted file mode 100644 index 3c91289aa4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/60/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index d77b26a5d6..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/60/expected.json +++ /dev/null @@ -1,200 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "sourceType": "script", - "body": [ - { - "type": "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 deleted file mode 100644 index a04b3de90f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/actual.js +++ /dev/null @@ -1 +0,0 @@ -sampleTag`\u{\u{0}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/expected.json deleted file mode 100644 index 4d954dc2d3..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/expected.json +++ /dev/null @@ -1,119 +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": "ExpressionStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "expression": { - "type": "TaggedTemplateExpression", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "tag": { - "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, - "name": "sampleTag" - }, - "quasi": { - "type": "TemplateLiteral", - "start": 9, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "expressions": [], - "quasis": [ - { - "type": "TemplateElement", - "start": 10, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "value": { - "raw": "\\u{\\u{0}", - "cooked": null - }, - "tail": true - } - ] - } - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/62/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/62/actual.js deleted file mode 100644 index a01abfbccb..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/62/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index a4ab688484..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/62/expected.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "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 deleted file mode 100644 index 7180334fe7..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/63/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index d6f59b6cd6..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/63/expected.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "expression": { - "type": "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 deleted file mode 100644 index 913257ec23..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/64/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index b3cd32eb66..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/64/expected.json +++ /dev/null @@ -1,200 +0,0 @@ -{ - "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 deleted file mode 100644 index 57cee514aa..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/65/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index d381bed78f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/65/expected.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - }, - "expression": { - "type": "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 deleted file mode 100644 index 1021623c19..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/66/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index b6d1bad8e0..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/66/expected.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "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 deleted file mode 100644 index 28d404e2e8..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/67/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 9f89295266..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/67/expected.json +++ /dev/null @@ -1,160 +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": "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 deleted file mode 100644 index ddfde0880a..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/68/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 59ad74af19..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/68/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": "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 deleted file mode 100644 index 7ae506f9be..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/7/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 8dd1cb7248..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/7/expected.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - }, - "expression": { - "type": "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 deleted file mode 100644 index 808e93f360..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/8/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 8fd7e0ab30..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/8/expected.json +++ /dev/null @@ -1,200 +0,0 @@ -{ - "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 deleted file mode 100644 index 6a82dddf36..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/9/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2306ad4846..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/9/expected.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "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 deleted file mode 100644 index 0967ef424b..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/options.json +++ /dev/null @@ -1 +0,0 @@ -{} 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 deleted file mode 100644 index 38c654a5b4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index f9b52ebde0..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index a0c30ccebf..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index b951c4896c..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 59702c7be1..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 2b1e66e6c5..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 1742efdd1d..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 0b999a4306..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 5750e28788..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 8f0e13d9f8..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 84fc9009b6..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 629c7645c9..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 66024330d3..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 55cd59a2c7..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 0968b3b2b0..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 39b67a92dd..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index d3656d3d08..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index f401af6e63..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index bbd2bb505b..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 710a43999a..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index f4a5e3653a..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 4c4daa380e..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 3663eaffcc..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index d0525f75cb..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 981b65ab1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index c6441febbd..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 90ace87a84..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index eadeb7b3cd..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index cd7b76fe4f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 79a1eedc9a..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index d7c716f1b5..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index da568ab1dd..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index a564107d91..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index f0ea873a5d..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 66ecba8b94..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index a4b058d036..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 05dd670eb9..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 0c02fbcc5b..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index f81c6beccc..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 2e6b74b44e..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 162c16696d..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 72bc784142..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index af0cefff92..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 512229f60c..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index a4ffac63b8..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 2811cdfcf9..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 1f3f5e3640..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index fd255a9f91..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 77e7e029e4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 843e2f4031..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 08c9e10363..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index d6b1f25a7e..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index af2be992b1..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 6612fdbb02..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 983aae670e..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 554c901c69..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 611f774bdc..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 6b91a4e8c7..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 18df761fc1..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 5d54005046..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index e5989149e9..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 63b6915978..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 4fa89bb1d3..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 9d9819b1eb..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 0ff67f82a6..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 03b6467b6f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 384fad327e..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/actual.js +++ /dev/null @@ -1 +0,0 @@ -`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 deleted file mode 100644 index 27524e2b1f..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index a8dec8c005..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/actual.js +++ /dev/null @@ -1 +0,0 @@ -`\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 deleted file mode 100644 index fd4da953a4..0000000000 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 027ed9cf62..11f4e10cdb 100644 --- a/test/fixtures/experimental/uncategorised/33/expected.json +++ b/test/fixtures/experimental/uncategorised/33/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "foo" + } }, "name": "foo" } @@ -88,8 +87,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -111,7 +109,6 @@ "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 923fccd749..8186beeeb5 100644 --- a/test/fixtures/experimental/uncategorised/34/expected.json +++ b/test/fixtures/experimental/uncategorised/34/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -115,8 +114,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "foo" + } }, "name": "foo" } @@ -134,8 +132,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -161,7 +158,6 @@ ], "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 99edaedb74..ff000260aa 100644 --- a/test/fixtures/experimental/uncategorised/35/expected.json +++ b/test/fixtures/experimental/uncategorised/35/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -116,14 +115,12 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "foo" + } }, "name": "foo" } } ], - "static": false, "computed": false, "key": { "type": "Identifier", @@ -137,16 +134,15 @@ "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 74f8fb569a..118d2b69c5 100644 --- a/test/fixtures/experimental/uncategorised/36/expected.json +++ b/test/fixtures/experimental/uncategorised/36/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -116,14 +115,12 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "foo" + } }, "name": "foo" } } ], - "static": false, "computed": false, "key": { "type": "Identifier", @@ -137,16 +134,15 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "bar" + } }, "name": "bar" }, + "static": false, "kind": "set", "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -160,8 +156,7 @@ "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 cc23bfd6b2..ad67c94592 100644 --- a/test/fixtures/experimental/uncategorised/37/expected.json +++ b/test/fixtures/experimental/uncategorised/37/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -116,14 +115,12 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "foo" + } }, "name": "foo" } } ], - "static": false, "computed": false, "key": { "type": "Identifier", @@ -137,16 +134,15 @@ "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 621411c8b8..d55670aa51 100644 --- a/test/fixtures/experimental/uncategorised/38/expected.json +++ b/test/fixtures/experimental/uncategorised/38/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -116,8 +115,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "foo" + } }, "name": "foo" } @@ -148,14 +146,12 @@ "end": { "line": 1, "column": 21 - }, - "identifierName": "bar" + } }, "name": "bar" } } ], - "static": false, "computed": false, "key": { "type": "Identifier", @@ -169,16 +165,15 @@ "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 29893aa8b2..b8e2fae3e8 100644 --- a/test/fixtures/experimental/uncategorised/39/expected.json +++ b/test/fixtures/experimental/uncategorised/39/expected.json @@ -83,8 +83,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -145,8 +144,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "bar" + } }, "name": "bar" } @@ -167,8 +165,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -224,8 +221,7 @@ "end": { "line": 1, "column": 30 - }, - "identifierName": "bar" + } }, "name": "bar" } @@ -243,8 +239,7 @@ "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 1303f6d2b6..561ed2763d 100644 --- a/test/fixtures/experimental/uncategorised/40/expected.json +++ b/test/fixtures/experimental/uncategorised/40/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "bar" + } }, "name": "bar" } @@ -88,8 +87,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -134,8 +132,7 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "foo" + } }, "name": "foo" } @@ -153,8 +150,7 @@ "end": { "line": 1, "column": 37 - }, - "identifierName": "Bar" + } }, "name": "Bar" }, @@ -193,7 +189,6 @@ "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 b5e0eed1ee..f1956ad133 100644 --- a/test/fixtures/experimental/uncategorised/43/expected.json +++ b/test/fixtures/experimental/uncategorised/43/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -89,7 +88,6 @@ "column": 24 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,11 +101,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 0bd96ae88c..f0a0229229 100644 --- a/test/fixtures/experimental/uncategorised/44/expected.json +++ b/test/fixtures/experimental/uncategorised/44/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -89,7 +88,6 @@ "column": 16 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,17 +101,16 @@ "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 9c603e0ed1..5b0f534e52 100644 --- a/test/fixtures/experimental/uncategorised/45/expected.json +++ b/test/fixtures/experimental/uncategorised/45/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -89,7 +88,6 @@ "column": 23 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -103,17 +101,16 @@ "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 221e6c8c0a..ade2f517c1 100644 --- a/test/fixtures/experimental/uncategorised/46/expected.json +++ b/test/fixtures/experimental/uncategorised/46/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -89,7 +88,6 @@ "column": 31 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -103,11 +101,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 d638426ba2..e13785eb68 100644 --- a/test/fixtures/experimental/uncategorised/47/expected.json +++ b/test/fixtures/experimental/uncategorised/47/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -116,14 +115,12 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "bar" + } }, "name": "bar" } } ], - "static": false, "computed": false, "key": { "type": "Identifier", @@ -137,11 +134,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 2dfeed15ab..9f756cd6cb 100644 --- a/test/fixtures/experimental/uncategorised/48/expected.json +++ b/test/fixtures/experimental/uncategorised/48/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -116,14 +115,12 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "bar" + } }, "name": "bar" } } ], - "static": true, "computed": false, "key": { "type": "Identifier", @@ -137,11 +134,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 a339588287..1186fc6b42 100644 --- a/test/fixtures/experimental/uncategorised/49/expected.json +++ b/test/fixtures/experimental/uncategorised/49/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "obj" + } }, "name": "obj" }, @@ -130,8 +129,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "foo" + } }, "name": "foo" } @@ -152,8 +150,7 @@ "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 7d5e584066..c901163da6 100644 --- a/test/fixtures/experimental/uncategorised/50/expected.json +++ b/test/fixtures/experimental/uncategorised/50/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "foo" + } }, "name": "foo" } @@ -101,8 +100,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -118,8 +116,7 @@ "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 c3ff5e5a66..cf777d23e3 100644 --- a/test/fixtures/experimental/uncategorised/51/expected.json +++ b/test/fixtures/experimental/uncategorised/51/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "foo" + } }, "name": "foo" } @@ -101,8 +100,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -118,8 +116,7 @@ "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 fb3dbdc979..56f6998476 100644 --- a/test/fixtures/experimental/uncategorised/52/expected.json +++ b/test/fixtures/experimental/uncategorised/52/expected.json @@ -69,8 +69,7 @@ "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 72a96cf589..8e1fc31aea 100644 --- a/test/fixtures/experimental/uncategorised/53/expected.json +++ b/test/fixtures/experimental/uncategorised/53/expected.json @@ -69,8 +69,7 @@ "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 b92718dd1b..90607f31ac 100644 --- a/test/fixtures/experimental/uncategorised/54/expected.json +++ b/test/fixtures/experimental/uncategorised/54/expected.json @@ -69,8 +69,7 @@ "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 e8bfb35773..8b52f4f5bb 100644 --- a/test/fixtures/experimental/uncategorised/62/expected.json +++ b/test/fixtures/experimental/uncategorised/62/expected.json @@ -83,8 +83,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "decorate" + } }, "name": "decorate" }, @@ -106,7 +105,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -120,8 +118,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "arg" + } }, "name": "arg" } @@ -158,8 +155,7 @@ "end": { "line": 2, "column": 8 - }, - "identifierName": "Ex" + } }, "name": "Ex" }, @@ -181,7 +177,6 @@ "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 ce0e1324e4..a09644e718 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,7 +88,6 @@ "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 2baac05e21..7383572fa8 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,7 +88,6 @@ "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 27e2f2a7b9..073bb795bf 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,7 +88,6 @@ "column": 35 } }, - "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 11, @@ -165,7 +164,7 @@ ], "rest": null, "returnType": { - "type": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "start": 24, "end": 27, "loc": { @@ -178,11 +177,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 70c0c695b0..49ef79cba3 100644 --- a/test/fixtures/flow/anonymous-function-types/good_01/expected.json +++ b/test/fixtures/flow/anonymous-function-types/good_01/expected.json @@ -187,8 +187,7 @@ } } } - }, - "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 acd3af9b78..e522809a4c 100644 --- a/test/fixtures/flow/anonymous-function-types/good_10/expected.json +++ b/test/fixtures/flow/anonymous-function-types/good_10/expected.json @@ -88,7 +88,6 @@ "column": 38 } }, - "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 11, @@ -169,7 +168,7 @@ ], "rest": null, "returnType": { - "type": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "start": 28, "end": 31, "loc": { @@ -182,11 +181,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 794fbace18..0cdbecd783 100644 --- a/test/fixtures/flow/anonymous-function-types/good_11/expected.json +++ b/test/fixtures/flow/anonymous-function-types/good_11/expected.json @@ -88,7 +88,6 @@ "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 c70e9e0bae..cd8dec7223 100644 --- a/test/fixtures/flow/anonymous-function-types/good_12/expected.json +++ b/test/fixtures/flow/anonymous-function-types/good_12/expected.json @@ -88,7 +88,6 @@ "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 6f7739e278..0448cdbd22 100644 --- a/test/fixtures/flow/anonymous-function-types/good_13/expected.json +++ b/test/fixtures/flow/anonymous-function-types/good_13/expected.json @@ -88,7 +88,6 @@ "column": 37 } }, - "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 11, @@ -159,7 +158,7 @@ ], "rest": null, "returnType": { - "type": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "start": 26, "end": 29, "loc": { @@ -172,11 +171,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 1844409016..3aa12410f0 100644 --- a/test/fixtures/flow/anonymous-function-types/good_14/expected.json +++ b/test/fixtures/flow/anonymous-function-types/good_14/expected.json @@ -88,7 +88,6 @@ "column": 25 } }, - "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 11, @@ -119,7 +118,7 @@ }, "types": [ { - "type": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "start": 15, "end": 16, "loc": { @@ -132,14 +131,14 @@ "column": 16 } }, + "value": 1, "extra": { "rawValue": 1, "raw": "1" - }, - "value": 1 + } }, { - "type": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "start": 19, "end": 20, "loc": { @@ -152,11 +151,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 4a628f8b88..ec761b745f 100644 --- a/test/fixtures/flow/array-types/1/expected.json +++ b/test/fixtures/flow/array-types/1/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -124,7 +123,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 ac973c42c3..1c35be8908 100644 --- a/test/fixtures/flow/array-types/2/expected.json +++ b/test/fixtures/flow/array-types/2/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -139,7 +138,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 97f2e67bb2..3bc1a328ed 100644 --- a/test/fixtures/flow/array-types/3/expected.json +++ b/test/fixtures/flow/array-types/3/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -139,7 +138,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 1e607ecb92..9af2946b1c 100644 --- a/test/fixtures/flow/array-types/4/expected.json +++ b/test/fixtures/flow/array-types/4/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 21 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -142,7 +141,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 1d9bb7f09e..3c6ed8b705 100644 --- a/test/fixtures/flow/array-types/5/expected.json +++ b/test/fixtures/flow/array-types/5/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -142,7 +141,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 75d9b0ed40..07cd5aeb7a 100644 --- a/test/fixtures/flow/array-types/6/expected.json +++ b/test/fixtures/flow/array-types/6/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -142,8 +141,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "A" + } }, "name": "A" } @@ -157,7 +155,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 075d711fea..dc3060e046 100644 --- a/test/fixtures/flow/array-types/7/expected.json +++ b/test/fixtures/flow/array-types/7/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -139,7 +138,7 @@ ], "kind": "var" } - ], - "directives": [] - } -} \ No newline at end of file + ] + }, + "comments": [] +} diff --git a/test/fixtures/flow/array-types/8/expected.json b/test/fixtures/flow/array-types/8/expected.json index 5942211299..624bd8732a 100644 --- a/test/fixtures/flow/array-types/8/expected.json +++ b/test/fixtures/flow/array-types/8/expected.json @@ -26,7 +26,6 @@ "column": 19 } }, - "sourceType": "module", "body": [ { "type": "VariableDeclaration", @@ -69,8 +68,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -154,7 +152,7 @@ ], "kind": "var" } - ], - "directives": [] - } -} \ No newline at end of file + ] + }, + "comments": [] +} diff --git a/test/fixtures/flow/array-types/9/expected.json b/test/fixtures/flow/array-types/9/expected.json index fffc354953..9ac33d433a 100644 --- a/test/fixtures/flow/array-types/9/expected.json +++ b/test/fixtures/flow/array-types/9/expected.json @@ -26,7 +26,6 @@ "column": 2 } }, - "sourceType": "module", "body": [ { "type": "VariableDeclaration", @@ -69,8 +68,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -140,7 +138,7 @@ "elements": [] } } - ], - "directives": [] - } -} \ No newline at end of file + ] + }, + "comments": [] +} diff --git a/test/fixtures/flow/bounded-polymorphism/1/expected.json b/test/fixtures/flow/bounded-polymorphism/1/expected.json index 5f53d9572e..dd5b6e120d 100644 --- a/test/fixtures/flow/bounded-polymorphism/1/expected.json +++ b/test/fixtures/flow/bounded-polymorphism/1/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -89,7 +88,6 @@ } }, "name": "T", - "variance": null, "bound": { "type": "TypeAnnotation", "start": 9, @@ -131,8 +129,7 @@ "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 e7f5ee680d..cce66b9065 100644 --- a/test/fixtures/flow/bounded-polymorphism/2/expected.json +++ b/test/fixtures/flow/bounded-polymorphism/2/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -92,7 +91,6 @@ } }, "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 6ea3d1e4bb..35b90b3c11 100644 --- a/test/fixtures/flow/call-properties/1/expected.json +++ b/test/fixtures/flow/call-properties/1/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -116,7 +115,6 @@ "column": 20 } }, - "static": false, "value": { "type": "FunctionTypeAnnotation", "start": 10, @@ -153,8 +151,7 @@ } ], "properties": [], - "indexers": [], - "exact": false + "indexers": [] } } }, @@ -163,7 +160,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 87148b542a..ddb97cd917 100644 --- a/test/fixtures/flow/call-properties/2/expected.json +++ b/test/fixtures/flow/call-properties/2/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -105,7 +104,7 @@ { "type": "ObjectTypeCallProperty", "start": 10, - "end": 20, + "end": 21, "loc": { "start": { "line": 1, @@ -113,10 +112,9 @@ }, "end": { "line": 1, - "column": 20 + "column": 21 } }, - "static": false, "value": { "type": "FunctionTypeAnnotation", "start": 10, @@ -153,8 +151,7 @@ } ], "properties": [], - "indexers": [], - "exact": false + "indexers": [] } } }, @@ -163,7 +160,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 acd2bf6782..cd2eadb7d0 100644 --- a/test/fixtures/flow/call-properties/3/expected.json +++ b/test/fixtures/flow/call-properties/3/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 54 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -105,7 +104,7 @@ { "type": "ObjectTypeCallProperty", "start": 10, - "end": 20, + "end": 21, "loc": { "start": { "line": 1, @@ -113,10 +112,9 @@ }, "end": { "line": 1, - "column": 20 + "column": 21 } }, - "static": false, "value": { "type": "FunctionTypeAnnotation", "start": 10, @@ -165,7 +163,6 @@ "column": 52 } }, - "static": false, "value": { "type": "FunctionTypeAnnotation", "start": 33, @@ -207,8 +204,7 @@ "end": { "line": 1, "column": 35 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -254,7 +250,7 @@ { "type": "ObjectTypeProperty", "start": 22, - "end": 31, + "end": 32, "loc": { "start": { "line": 1, @@ -262,7 +258,7 @@ }, "end": { "line": 1, - "column": 31 + "column": 32 } }, "key": { @@ -277,13 +273,10 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "y" + } }, "name": "y" }, - "static": false, - "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 25, @@ -299,12 +292,11 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], - "indexers": [], - "exact": false + "indexers": [] } } }, @@ -313,7 +305,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 08e9c26694..4fefc20fda 100644 --- a/test/fixtures/flow/call-properties/4/expected.json +++ b/test/fixtures/flow/call-properties/4/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 30 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -105,7 +104,7 @@ { "type": "ObjectTypeCallProperty", "start": 10, - "end": 27, + "end": 28, "loc": { "start": { "line": 1, @@ -113,10 +112,9 @@ }, "end": { "line": 1, - "column": 27 + "column": 28 } }, - "static": false, "value": { "type": "FunctionTypeAnnotation", "start": 10, @@ -158,8 +156,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -191,8 +188,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "T" + } }, "name": "T" } @@ -229,8 +225,7 @@ "column": 12 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -253,8 +248,7 @@ } ], "properties": [], - "indexers": [], - "exact": false + "indexers": [] } } }, diff --git a/test/fixtures/flow/call-properties/5/expected.json b/test/fixtures/flow/call-properties/5/expected.json index 74587ef411..4815e902bc 100644 --- a/test/fixtures/flow/call-properties/5/expected.json +++ b/test/fixtures/flow/call-properties/5/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "A" + } }, "name": "A" }, "typeParameters": null, "extends": [], - "mixins": [], "body": { "type": "ObjectTypeAnnotation", "start": 12, @@ -80,7 +78,7 @@ { "type": "ObjectTypeCallProperty", "start": 14, - "end": 24, + "end": 25, "loc": { "start": { "line": 1, @@ -88,7 +86,7 @@ }, "end": { "line": 1, - "column": 24 + "column": 25 } }, "static": false, @@ -128,11 +126,10 @@ } ], "properties": [], - "indexers": [], - "exact": false + "indexers": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 deleted file mode 100644 index 7a6fc4985b..0000000000 --- a/test/fixtures/flow/class-properties/getter-setter/actual.js +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 13744ddb93..0000000000 --- a/test/fixtures/flow/class-properties/getter-setter/expected.json +++ /dev/null @@ -1,656 +0,0 @@ -{ - "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 deleted file mode 100644 index 0cc1b7fa51..0000000000 --- a/test/fixtures/flow/class-properties/invalid-getter-setter/actual.js +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 4e84114247..0000000000 --- a/test/fixtures/flow/class-properties/invalid-getter-setter/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 016fc254c0..0000000000 --- a/test/fixtures/flow/class-properties/invalid-named-static/expected.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "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 eea8e7d6a6..e3d5623c98 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": 29, + "end": 30, "loc": { "start": { "line": 2, @@ -89,7 +89,7 @@ }, "end": { "line": 2, - "column": 11 + "column": 12 } }, "key": { @@ -109,8 +109,6 @@ }, "name": "static" }, - "static": false, - "kind": "init", "value": { "type": "GenericTypeAnnotation", "start": 28, @@ -144,8 +142,9 @@ "name": "T" } }, - "variance": null, - "optional": false + "optional": false, + "static": false, + "variance": null } ], "indexers": [], diff --git a/test/fixtures/flow/declare-export/export-class/actual.js b/test/fixtures/flow/declare-export/export-class/actual.js deleted file mode 100644 index 07165a036a..0000000000 --- a/test/fixtures/flow/declare-export/export-class/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index d403da0296..0000000000 --- a/test/fixtures/flow/declare-export/export-class/expected.json +++ /dev/null @@ -1,275 +0,0 @@ -{ - "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 deleted file mode 100644 index f6ae0263aa..0000000000 --- a/test/fixtures/flow/declare-export/export-default-arrow/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index cd5ff0a411..0000000000 --- a/test/fixtures/flow/declare-export/export-default-arrow/expected.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "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 deleted file mode 100644 index c26ec8d304..0000000000 --- a/test/fixtures/flow/declare-export/export-default-class/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 62d258e3a7..0000000000 --- a/test/fixtures/flow/declare-export/export-default-class/expected.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "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 deleted file mode 100644 index 7f28065f5c..0000000000 --- a/test/fixtures/flow/declare-export/export-default-function/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index b433681f6b..0000000000 --- a/test/fixtures/flow/declare-export/export-default-function/expected.json +++ /dev/null @@ -1,180 +0,0 @@ -{ - "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 deleted file mode 100644 index ec6a2fb669..0000000000 --- a/test/fixtures/flow/declare-export/export-default-union/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 331f6890a2..0000000000 --- a/test/fixtures/flow/declare-export/export-default-union/expected.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "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 deleted file mode 100644 index 516e8e2100..0000000000 --- a/test/fixtures/flow/declare-export/export-from/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 6fde07ca48..0000000000 --- a/test/fixtures/flow/declare-export/export-from/expected.json +++ /dev/null @@ -1,175 +0,0 @@ -{ - "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 deleted file mode 100644 index 4b0b254fe4..0000000000 --- a/test/fixtures/flow/declare-export/export-function/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 79377de65a..0000000000 --- a/test/fixtures/flow/declare-export/export-function/expected.json +++ /dev/null @@ -1,233 +0,0 @@ -{ - "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 deleted file mode 100644 index 2f9a87e3ad..0000000000 --- a/test/fixtures/flow/declare-export/export-interface-and-var/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index c793dc2bb5..0000000000 --- a/test/fixtures/flow/declare-export/export-interface-and-var/expected.json +++ /dev/null @@ -1,237 +0,0 @@ -{ - "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 deleted file mode 100644 index d624036826..0000000000 --- a/test/fixtures/flow/declare-export/export-interface-commonjs/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 9263cc2989..0000000000 --- a/test/fixtures/flow/declare-export/export-interface-commonjs/expected.json +++ /dev/null @@ -1,204 +0,0 @@ -{ - "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 deleted file mode 100644 index 29047342e2..0000000000 --- a/test/fixtures/flow/declare-export/export-interface/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2524845b73..0000000000 --- a/test/fixtures/flow/declare-export/export-interface/expected.json +++ /dev/null @@ -1,159 +0,0 @@ -{ - "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 deleted file mode 100644 index 6a25a18365..0000000000 --- a/test/fixtures/flow/declare-export/export-named-pattern/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 6e1791ff95..0000000000 --- a/test/fixtures/flow/declare-export/export-named-pattern/expected.json +++ /dev/null @@ -1,156 +0,0 @@ -{ - "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 deleted file mode 100644 index 3f0c9ebabf..0000000000 --- a/test/fixtures/flow/declare-export/export-star-as/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index ecf6deda99..0000000000 --- a/test/fixtures/flow/declare-export/export-star-as/expected.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "sourceType": "module", - "body": [ - { - "type": "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 deleted file mode 100644 index edcc382322..0000000000 --- a/test/fixtures/flow/declare-export/export-star-as/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["exportExtensions"] -} diff --git a/test/fixtures/flow/declare-export/export-star/actual.js b/test/fixtures/flow/declare-export/export-star/actual.js deleted file mode 100644 index 25be792a09..0000000000 --- a/test/fixtures/flow/declare-export/export-star/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 16df6ff122..0000000000 --- a/test/fixtures/flow/declare-export/export-star/expected.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "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 deleted file mode 100644 index f4de1e146f..0000000000 --- a/test/fixtures/flow/declare-export/export-type-and-var/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 1b6544a294..0000000000 --- a/test/fixtures/flow/declare-export/export-type-and-var/expected.json +++ /dev/null @@ -1,231 +0,0 @@ -{ - "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 deleted file mode 100644 index 21cd35d78d..0000000000 --- a/test/fixtures/flow/declare-export/export-type-commonjs/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index c97883f7d0..0000000000 --- a/test/fixtures/flow/declare-export/export-type-commonjs/expected.json +++ /dev/null @@ -1,198 +0,0 @@ -{ - "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 deleted file mode 100644 index 422ea5547e..0000000000 --- a/test/fixtures/flow/declare-export/export-type/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index aa03bfa368..0000000000 --- a/test/fixtures/flow/declare-export/export-type/expected.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "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 deleted file mode 100644 index b14a9dda53..0000000000 --- a/test/fixtures/flow/declare-export/export-var/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index d176ea111b..0000000000 --- a/test/fixtures/flow/declare-export/export-var/expected.json +++ /dev/null @@ -1,165 +0,0 @@ -{ - "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 deleted file mode 100644 index f2c105f061..0000000000 --- a/test/fixtures/flow/declare-export/invalid-declare-export-type/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2f2a34e735..0000000000 --- a/test/fixtures/flow/declare-export/invalid-declare-export-type/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index a5b27cf870..0000000000 --- a/test/fixtures/flow/declare-export/invalid-export-arrow/actual.js +++ /dev/null @@ -1 +0,0 @@ -declare export (a:number) => number diff --git a/test/fixtures/flow/declare-export/invalid-export-const/actual.js b/test/fixtures/flow/declare-export/invalid-export-const/actual.js deleted file mode 100644 index 8ee799daa5..0000000000 --- a/test/fixtures/flow/declare-export/invalid-export-const/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 8466e2ca85..0000000000 --- a/test/fixtures/flow/declare-export/invalid-export-const/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 237a1224ad..0000000000 --- a/test/fixtures/flow/declare-export/invalid-export-default-function/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 40981abf7e..0000000000 --- a/test/fixtures/flow/declare-export/invalid-export-default-function/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index c90458445b..0000000000 --- a/test/fixtures/flow/declare-export/invalid-export-default-var/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 562afcef48..0000000000 --- a/test/fixtures/flow/declare-export/invalid-export-default-var/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index aad1860f10..0000000000 --- a/test/fixtures/flow/declare-export/invalid-export-interface/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 3977f3c480..0000000000 --- a/test/fixtures/flow/declare-export/invalid-export-interface/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index cffa3c63b6..0000000000 --- a/test/fixtures/flow/declare-export/invalid-export-let/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 745a711f11..0000000000 --- a/test/fixtures/flow/declare-export/invalid-export-let/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 f209133694..6c62e08565 100644 --- a/test/fixtures/flow/declare-module/1/expected.json +++ b/test/fixtures/flow/declare-module/1/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -74,10 +73,9 @@ } }, "body": [] - }, - "kind": "CommonJS" + } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 deleted file mode 100644 index ccbf397e99..0000000000 --- a/test/fixtures/flow/declare-module/10/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 5b28d3a95c..0000000000 --- a/test/fixtures/flow/declare-module/10/expected.json +++ /dev/null @@ -1,152 +0,0 @@ -{ - "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 8643e9feaa..887e105b6e 100644 --- a/test/fixtures/flow/declare-module/2/expected.json +++ b/test/fixtures/flow/declare-module/2/expected.json @@ -77,8 +77,7 @@ } }, "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 8e61c95762..8654fdf948 100644 --- a/test/fixtures/flow/declare-module/3/expected.json +++ b/test/fixtures/flow/declare-module/3/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 40 - }, - "identifierName": "x" + } }, "name": "x", "typeAnnotation": { @@ -137,10 +135,9 @@ } } ] - }, - "kind": "CommonJS" + } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 71deaaf280..e53817230a 100644 --- a/test/fixtures/flow/declare-module/4/expected.json +++ b/test/fixtures/flow/declare-module/4/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 49 - }, - "identifierName": "foo" + } }, "name": "foo", "typeAnnotation": { @@ -152,14 +150,12 @@ } } } - }, - "predicate": null + } } ] - }, - "kind": "CommonJS" + } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 d6491c6f37..5da254c476 100644 --- a/test/fixtures/flow/declare-module/5/expected.json +++ b/test/fixtures/flow/declare-module/5/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -100,14 +99,12 @@ "end": { "line": 1, "column": 34 - }, - "identifierName": "B" + } }, "name": "B" }, "typeParameters": null, "extends": [], - "mixins": [], "body": { "type": "ObjectTypeAnnotation", "start": 35, @@ -127,7 +124,7 @@ { "type": "ObjectTypeProperty", "start": 37, - "end": 50, + "end": 51, "loc": { "start": { "line": 1, @@ -135,28 +132,9 @@ }, "end": { "line": 1, - "column": 50 + "column": 51 } }, - "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, @@ -190,18 +168,32 @@ } } }, + "key": { + "type": "Identifier", + "start": 37, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "name": "foo" + }, "optional": false } ], - "indexers": [], - "exact": false + "indexers": [] } } ] - }, - "kind": "CommonJS" + } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 7b1772c283..713a1d71c1 100644 --- a/test/fixtures/flow/declare-module/6/expected.json +++ b/test/fixtures/flow/declare-module/6/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -121,7 +120,7 @@ { "type": "ObjectTypeProperty", "start": 45, - "end": 58, + "end": 59, "loc": { "start": { "line": 1, @@ -129,28 +128,9 @@ }, "end": { "line": 1, - "column": 58 + "column": 59 } }, - "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, @@ -184,17 +164,31 @@ } } }, + "key": { + "type": "Identifier", + "start": 45, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "name": "foo" + }, "optional": false } ], - "indexers": [], - "exact": false + "indexers": [] } } } ] - }, - "kind": "CommonJS" + } } ], "directives": [] diff --git a/test/fixtures/flow/declare-module/9/expected.json b/test/fixtures/flow/declare-module/9/expected.json index 37a6fe2711..d549499d21 100644 --- a/test/fixtures/flow/declare-module/9/expected.json +++ b/test/fixtures/flow/declare-module/9/expected.json @@ -120,8 +120,7 @@ } } ] - }, - "kind": "CommonJS" + } } ], "directives": [] diff --git a/test/fixtures/flow/declare-module/import/expected.json b/test/fixtures/flow/declare-module/import/expected.json index f1f57afa41..391e0de595 100644 --- a/test/fixtures/flow/declare-module/import/expected.json +++ b/test/fixtures/flow/declare-module/import/expected.json @@ -148,8 +148,7 @@ } } ] - }, - "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 deleted file mode 100644 index 094feacb53..0000000000 --- a/test/fixtures/flow/declare-module/invalid-commonjs-module/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index adfde32363..0000000000 --- a/test/fixtures/flow/declare-module/invalid-commonjs-module/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 111a0c6927..0000000000 --- a/test/fixtures/flow/declare-module/invalid-es-module/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index b40239a560..0000000000 --- a/test/fixtures/flow/declare-module/invalid-es-module/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 7b0be343c3..0000000000 --- a/test/fixtures/flow/declare-module/invalid-module-in-module/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index cd823bd7c4..0000000000 --- a/test/fixtures/flow/declare-module/invalid-module-in-module/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 3c6d3a0307..0000000000 --- a/test/fixtures/flow/declare-module/invalid-multiple-commonjs/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 1520d766b0..0000000000 --- a/test/fixtures/flow/declare-module/invalid-multiple-commonjs/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 de51d0d730..c09b84fcf9 100644 --- a/test/fixtures/flow/declare-statements/1/expected.json +++ b/test/fixtures/flow/declare-statements/1/expected.json @@ -54,13 +54,12 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "foo" + } }, "name": "foo" } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 378c963659..9254cba4fe 100644 --- a/test/fixtures/flow/declare-statements/10/expected.json +++ b/test/fixtures/flow/declare-statements/10/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "A" + } }, "name": "A" }, "typeParameters": null, "extends": [], - "mixins": [], "body": { "type": "ObjectTypeAnnotation", "start": 16, @@ -81,7 +79,7 @@ { "type": "ObjectTypeProperty", "start": 18, - "end": 38, + "end": 39, "loc": { "start": { "line": 1, @@ -89,28 +87,9 @@ }, "end": { "line": 1, - "column": 38 + "column": 39 } }, - "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, @@ -144,6 +123,23 @@ } } }, + "static": true, + "key": { + "type": "Identifier", + "start": 25, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "name": "foo" + }, "optional": false }, { @@ -172,13 +168,10 @@ "end": { "line": 1, "column": 48 - }, - "identifierName": "x" + } }, "name": "x" }, - "static": true, - "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 51, @@ -194,15 +187,15 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "static": true, + "variance": null } ], - "indexers": [], - "exact": false + "indexers": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 6c57828705..cbc8903f9e 100644 --- a/test/fixtures/flow/declare-statements/11/expected.json +++ b/test/fixtures/flow/declare-statements/11/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "A" + } }, "name": "A" }, "typeParameters": null, "extends": [], - "mixins": [], "body": { "type": "ObjectTypeAnnotation", "start": 16, @@ -106,8 +104,7 @@ "end": { "line": 1, "column": 34 - }, - "identifierName": "indexer" + } }, "name": "indexer" }, @@ -143,11 +140,10 @@ }, "variance": null } - ], - "exact": false + ] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 d7e3836060..5ff774491c 100644 --- a/test/fixtures/flow/declare-statements/12/expected.json +++ b/test/fixtures/flow/declare-statements/12/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "A" + } }, "name": "A" }, "typeParameters": null, "extends": [], - "mixins": [], "body": { "type": "ObjectTypeAnnotation", "start": 16, @@ -128,11 +126,10 @@ } ], "properties": [], - "indexers": [], - "exact": false + "indexers": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 2e0f0e768e..28eabe6252 100644 --- a/test/fixtures/flow/declare-statements/13/expected.json +++ b/test/fixtures/flow/declare-statements/13/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -88,8 +87,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "B" + } }, "name": "B" }, @@ -135,8 +133,7 @@ "end": { "line": 1, "column": 26 - }, - "identifierName": "T" + } }, "name": "T" } @@ -170,8 +167,7 @@ "end": { "line": 1, "column": 30 - }, - "identifierName": "C" + } }, "name": "C" }, @@ -194,8 +190,7 @@ }, "callProperties": [], "properties": [], - "indexers": [], - "exact": false + "indexers": [] } } ], diff --git a/test/fixtures/flow/declare-statements/14/expected.json b/test/fixtures/flow/declare-statements/14/expected.json index ea11ee2d77..a43cb40adf 100644 --- a/test/fixtures/flow/declare-statements/14/expected.json +++ b/test/fixtures/flow/declare-statements/14/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -102,8 +101,7 @@ "end": { "line": 2, "column": 14 - }, - "identifierName": "T" + } }, "name": "T" }, @@ -136,8 +134,7 @@ "column": 16 } }, - "name": "U", - "variance": null + "name": "U" } ] }, @@ -172,7 +169,6 @@ "column": 35 } }, - "static": false, "id": { "type": "Identifier", "start": 48, @@ -185,8 +181,7 @@ "end": { "line": 2, "column": 24 - }, - "identifierName": "k" + } }, "name": "k" }, @@ -232,16 +227,14 @@ "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 6b3d9f0b04..81024f30bd 100644 --- a/test/fixtures/flow/declare-statements/15/expected.json +++ b/test/fixtures/flow/declare-statements/15/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "I" + } }, "name": "I" }, @@ -104,13 +103,10 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "foo" + } }, "name": "foo" }, - "static": false, - "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 27, @@ -126,12 +122,11 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], - "indexers": [], - "exact": false + "indexers": [] } }, { @@ -160,8 +155,7 @@ "end": { "line": 2, "column": 19 - }, - "identifierName": "I" + } }, "name": "I" }, @@ -194,8 +188,7 @@ "column": 21 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -243,13 +236,10 @@ "end": { "line": 2, "column": 28 - }, - "identifierName": "foo" + } }, "name": "foo" }, - "static": false, - "kind": "init", "value": { "type": "GenericTypeAnnotation", "start": 66, @@ -277,18 +267,16 @@ "end": { "line": 2, "column": 31 - }, - "identifierName": "T" + } }, "name": "T" } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], - "indexers": [], - "exact": false + "indexers": [] } } ], diff --git a/test/fixtures/flow/declare-statements/16/expected.json b/test/fixtures/flow/declare-statements/16/expected.json index 63647f77c7..4fbc1787d4 100644 --- a/test/fixtures/flow/declare-statements/16/expected.json +++ b/test/fixtures/flow/declare-statements/16/expected.json @@ -176,8 +176,7 @@ }, "callProperties": [], "properties": [], - "indexers": [], - "exact": false + "indexers": [] } } ], diff --git a/test/fixtures/flow/declare-statements/17/actual.js b/test/fixtures/flow/declare-statements/17/actual.js index d9fbcbcab1..004d91583b 100644 --- a/test/fixtures/flow/declare-statements/17/actual.js +++ b/test/fixtures/flow/declare-statements/17/actual.js @@ -1,5 +1,5 @@ declare class X { - a: number; - static b: number; - c: number; + a: number; + static b: number; + c: number; } diff --git a/test/fixtures/flow/declare-statements/17/expected.json b/test/fixtures/flow/declare-statements/17/expected.json index 2f4a6dc1cb..292b96e24c 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": 28, + "end": 29, "loc": { "start": { "line": 2, @@ -89,7 +89,7 @@ }, "end": { "line": 2, - "column": 10 + "column": 11 } }, "key": { @@ -109,8 +109,6 @@ }, "name": "a" }, - "static": false, - "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 22, @@ -126,13 +124,14 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "static": false, + "variance": null }, { "type": "ObjectTypeProperty", "start": 31, - "end": 47, + "end": 48, "loc": { "start": { "line": 3, @@ -140,7 +139,7 @@ }, "end": { "line": 3, - "column": 17 + "column": 18 } }, "key": { @@ -160,8 +159,6 @@ }, "name": "b" }, - "static": true, - "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 41, @@ -177,13 +174,14 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "static": true, + "variance": null }, { "type": "ObjectTypeProperty", "start": 50, - "end": 59, + "end": 60, "loc": { "start": { "line": 4, @@ -191,7 +189,7 @@ }, "end": { "line": 4, - "column": 10 + "column": 11 } }, "key": { @@ -211,8 +209,6 @@ }, "name": "c" }, - "static": false, - "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 53, @@ -228,8 +224,9 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "static": false, + "variance": null } ], "indexers": [], diff --git a/test/fixtures/flow/declare-statements/2/expected.json b/test/fixtures/flow/declare-statements/2/expected.json index f5ce52dc9e..bed757d73f 100644 --- a/test/fixtures/flow/declare-statements/2/expected.json +++ b/test/fixtures/flow/declare-statements/2/expected.json @@ -54,13 +54,12 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "foo" + } }, "name": "foo" } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 b85ed89a5b..f77a398e93 100644 --- a/test/fixtures/flow/declare-statements/3/expected.json +++ b/test/fixtures/flow/declare-statements/3/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 28 - }, - "identifierName": "foo" + } }, "name": "foo", "typeAnnotation": { @@ -106,10 +105,9 @@ } } } - }, - "predicate": null + } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 3551a556fe..f5aaaa9224 100644 --- a/test/fixtures/flow/declare-statements/4/expected.json +++ b/test/fixtures/flow/declare-statements/4/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 28 - }, - "identifierName": "foo" + } }, "name": "foo", "typeAnnotation": { @@ -106,10 +105,9 @@ } } } - }, - "predicate": null + } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 3670040e1d..c391cadcac 100644 --- a/test/fixtures/flow/declare-statements/5/expected.json +++ b/test/fixtures/flow/declare-statements/5/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 31 - }, - "identifierName": "foo" + } }, "name": "foo", "typeAnnotation": { @@ -115,8 +114,7 @@ "column": 22 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -139,8 +137,7 @@ } } } - }, - "predicate": null + } } ], "directives": [] diff --git a/test/fixtures/flow/declare-statements/6/expected.json b/test/fixtures/flow/declare-statements/6/expected.json index 443d802910..c61da189d6 100644 --- a/test/fixtures/flow/declare-statements/6/expected.json +++ b/test/fixtures/flow/declare-statements/6/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 48 - }, - "identifierName": "foo" + } }, "name": "foo", "typeAnnotation": { @@ -114,8 +113,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -162,8 +160,7 @@ "end": { "line": 1, "column": 33 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -203,10 +200,9 @@ } } } - }, - "predicate": null + } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 babd12a4f5..04218670c8 100644 --- a/test/fixtures/flow/declare-statements/7/expected.json +++ b/test/fixtures/flow/declare-statements/7/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 26 - }, - "identifierName": "IViewFactory" + } }, "name": "IViewFactory" }, "typeParameters": null, "extends": [], - "mixins": [], "body": { "type": "ObjectTypeAnnotation", "start": 27, @@ -81,7 +79,7 @@ { "type": "ObjectTypeProperty", "start": 29, - "end": 71, + "end": 72, "loc": { "start": { "line": 1, @@ -89,28 +87,9 @@ }, "end": { "line": 1, - "column": 71 + "column": 72 } }, - "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, @@ -152,8 +131,7 @@ "end": { "line": 1, "column": 44 - }, - "identifierName": "view" + } }, "name": "view" }, @@ -185,8 +163,7 @@ "end": { "line": 1, "column": 51 - }, - "identifierName": "Object" + } }, "name": "Object" } @@ -218,8 +195,7 @@ "end": { "line": 1, "column": 57 - }, - "identifierName": "prop" + } }, "name": "prop" }, @@ -259,14 +235,29 @@ } } }, + "key": { + "type": "Identifier", + "start": 29, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "name": "didAnimate" + }, "optional": false } ], - "indexers": [], - "exact": false + "indexers": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 3f5d39aa5f..18bc5e8955 100644 --- a/test/fixtures/flow/declare-statements/8/expected.json +++ b/test/fixtures/flow/declare-statements/8/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "A" + } }, "name": "A" }, "typeParameters": null, "extends": [], - "mixins": [], "body": { "type": "ObjectTypeAnnotation", "start": 16, @@ -78,11 +76,10 @@ }, "callProperties": [], "properties": [], - "indexers": [], - "exact": false + "indexers": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 3bafe9b3ab..d3d340e972 100644 --- a/test/fixtures/flow/declare-statements/9/expected.json +++ b/test/fixtures/flow/declare-statements/9/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -88,8 +87,7 @@ "column": 17 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -120,8 +118,7 @@ "end": { "line": 1, "column": 28 - }, - "identifierName": "B" + } }, "name": "B" }, @@ -167,8 +164,7 @@ "end": { "line": 1, "column": 30 - }, - "identifierName": "T" + } }, "name": "T" } @@ -220,13 +216,10 @@ "end": { "line": 1, "column": 35 - }, - "identifierName": "x" + } }, "name": "x" }, - "static": false, - "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 37, @@ -242,12 +235,11 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], - "indexers": [], - "exact": false + "indexers": [] } } ], diff --git a/test/fixtures/flow/declare-statements/invalid-literal/actual.js b/test/fixtures/flow/declare-statements/invalid-literal/actual.js deleted file mode 100644 index b70552565f..0000000000 --- a/test/fixtures/flow/declare-statements/invalid-literal/actual.js +++ /dev/null @@ -1 +0,0 @@ -declare 1; diff --git a/test/fixtures/flow/declare-statements/invalid-literal/options.json b/test/fixtures/flow/declare-statements/invalid-literal/options.json deleted file mode 100644 index 1288082ab0..0000000000 --- a/test/fixtures/flow/declare-statements/invalid-literal/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 2ee9a406c5..ad7acee460 100644 --- a/test/fixtures/flow/def-site-variance/1/expected.json +++ b/test/fixtures/flow/def-site-variance/1/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "C" + } }, "name": "C" }, @@ -88,23 +87,8 @@ "column": 10 } }, - "name": "T", - "variance": { - "type": "Variance", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - }, - "kind": "plus" - } + "variance": "plus", + "name": "T" }, { "type": "TypeParameter", @@ -120,23 +104,8 @@ "column": 13 } }, - "name": "U", - "variance": { - "type": "Variance", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, - "kind": "minus" - } + "variance": "minus", + "name": "U" } ] }, @@ -184,8 +153,7 @@ "end": { "line": 2, "column": 10 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -221,23 +189,8 @@ "column": 13 } }, - "name": "T", - "variance": { - "type": "Variance", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - } - }, - "kind": "plus" - } + "variance": "plus", + "name": "T" }, { "type": "TypeParameter", @@ -253,23 +206,8 @@ "column": 16 } }, - "name": "U", - "variance": { - "type": "Variance", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - } - }, - "kind": "minus" - } + "variance": "minus", + "name": "U" } ] }, @@ -318,8 +256,7 @@ "end": { "line": 3, "column": 6 - }, - "identifierName": "T" + } }, "name": "T" }, @@ -352,23 +289,8 @@ "column": 9 } }, - "name": "T", - "variance": { - "type": "Variance", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - } - }, - "kind": "plus" - } + "variance": "plus", + "name": "T" }, { "type": "TypeParameter", @@ -384,23 +306,8 @@ "column": 12 } }, - "name": "U", - "variance": { - "type": "Variance", - "start": 51, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - } - }, - "kind": "minus" - } + "variance": "minus", + "name": "U" } ] }, @@ -420,11 +327,10 @@ }, "callProperties": [], "properties": [], - "indexers": [], - "exact": false + "indexers": [] } } ], "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 005f5ae9d3..f6196760be 100644 --- a/test/fixtures/flow/interfaces-module-and-script/1/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/1/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "A" + } }, "name": "A" }, "typeParameters": null, "extends": [], - "mixins": [], "body": { "type": "ObjectTypeAnnotation", "start": 12, @@ -78,11 +76,10 @@ }, "callProperties": [], "properties": [], - "indexers": [], - "exact": false + "indexers": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 deleted file mode 100644 index c12feec022..0000000000 --- a/test/fixtures/flow/interfaces-module-and-script/10/actual.js +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 4fb5918fb1..0000000000 --- a/test/fixtures/flow/interfaces-module-and-script/10/expected.json +++ /dev/null @@ -1,241 +0,0 @@ -{ - "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 044027ca74..953e5928d5 100644 --- a/test/fixtures/flow/interfaces-module-and-script/2/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/2/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -87,15 +86,13 @@ "end": { "line": 1, "column": 21 - }, - "identifierName": "B" + } }, "name": "B" }, "typeParameters": null } ], - "mixins": [], "body": { "type": "ObjectTypeAnnotation", "start": 22, @@ -112,11 +109,10 @@ }, "callProperties": [], "properties": [], - "indexers": [], - "exact": false + "indexers": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 2f896014d6..ce900a2e99 100644 --- a/test/fixtures/flow/interfaces-module-and-script/3/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/3/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -88,8 +87,7 @@ "column": 13 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -120,8 +118,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "B" + } }, "name": "B" }, @@ -167,8 +164,7 @@ "end": { "line": 1, "column": 26 - }, - "identifierName": "T" + } }, "name": "T" } @@ -202,8 +198,7 @@ "end": { "line": 1, "column": 30 - }, - "identifierName": "C" + } }, "name": "C" }, @@ -249,8 +244,7 @@ "end": { "line": 1, "column": 32 - }, - "identifierName": "T" + } }, "name": "T" } @@ -276,8 +270,7 @@ }, "callProperties": [], "properties": [], - "indexers": [], - "exact": false + "indexers": [] } } ], diff --git a/test/fixtures/flow/interfaces-module-and-script/4/expected.json b/test/fixtures/flow/interfaces-module-and-script/4/expected.json index 83636e0555..922afad5c6 100644 --- a/test/fixtures/flow/interfaces-module-and-script/4/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/4/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "A" + } }, "name": "A" }, "typeParameters": null, "extends": [], - "mixins": [], "body": { "type": "ObjectTypeAnnotation", "start": 12, @@ -81,7 +79,7 @@ { "type": "ObjectTypeProperty", "start": 14, - "end": 31, + "end": 32, "loc": { "start": { "line": 1, @@ -89,7 +87,7 @@ }, "end": { "line": 1, - "column": 31 + "column": 32 } }, "key": { @@ -104,13 +102,10 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "foo" + } }, "name": "foo" }, - "static": false, - "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 19, @@ -144,15 +139,14 @@ }, "typeParameters": null }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], - "indexers": [], - "exact": false + "indexers": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 da45e73fc6..23bbe6bc92 100644 --- a/test/fixtures/flow/interfaces-module-and-script/5/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/5/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "Dictionary" + } }, "name": "Dictionary" }, "typeParameters": null, "extends": [], - "mixins": [], "body": { "type": "ObjectTypeAnnotation", "start": 21, @@ -81,7 +79,7 @@ { "type": "ObjectTypeProperty", "start": 48, - "end": 62, + "end": 63, "loc": { "start": { "line": 1, @@ -89,7 +87,7 @@ }, "end": { "line": 1, - "column": 62 + "column": 63 } }, "key": { @@ -104,13 +102,10 @@ "end": { "line": 1, "column": 54 - }, - "identifierName": "length" + } }, "name": "length" }, - "static": false, - "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 56, @@ -126,15 +121,15 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], "indexers": [ { "type": "ObjectTypeIndexer", "start": 23, - "end": 46, + "end": 47, "loc": { "start": { "line": 1, @@ -142,10 +137,9 @@ }, "end": { "line": 1, - "column": 46 + "column": 47 } }, - "static": false, "id": { "type": "Identifier", "start": 24, @@ -158,8 +152,7 @@ "end": { "line": 1, "column": 29 - }, - "identifierName": "index" + } }, "name": "index" }, @@ -195,11 +188,10 @@ }, "variance": null } - ], - "exact": false + ] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 bb54189558..e2c90567fb 100644 --- a/test/fixtures/flow/interfaces-module-and-script/6/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/6/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -87,8 +86,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "Bar" + } }, "name": "Bar" }, @@ -112,7 +110,7 @@ "body": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 faeb81e32f..edfbf9f89b 100644 --- a/test/fixtures/flow/interfaces-module-and-script/7/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/7/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -71,8 +70,7 @@ "end": { "line": 1, "column": 21 - }, - "identifierName": "Bar" + } }, "name": "Bar" }, @@ -103,8 +101,7 @@ "end": { "line": 1, "column": 36 - }, - "identifierName": "Bat" + } }, "name": "Bat" }, @@ -136,8 +133,7 @@ "end": { "line": 1, "column": 41 - }, - "identifierName": "Man" + } }, "name": "Man" }, @@ -192,7 +188,7 @@ "body": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 c06be5f984..64e39ba8ff 100644 --- a/test/fixtures/flow/interfaces-module-and-script/8/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/8/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -85,8 +84,7 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "Bar" + } }, "name": "Bar" }, @@ -118,8 +116,7 @@ "end": { "line": 1, "column": 42 - }, - "identifierName": "Bat" + } }, "name": "Bat" }, @@ -160,7 +157,7 @@ "body": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 25a172c9ca..d68a71a9c4 100644 --- a/test/fixtures/flow/interfaces-module-and-script/9/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/9/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -85,8 +84,7 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "Bar" + } }, "name": "Bar" }, @@ -118,8 +116,7 @@ "end": { "line": 1, "column": 42 - }, - "identifierName": "Bat" + } }, "name": "Bat" }, @@ -170,8 +167,7 @@ "end": { "line": 1, "column": 60 - }, - "identifierName": "Man" + } }, "name": "Man" }, @@ -195,7 +191,7 @@ "body": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 7b3dbda941..6cc01d01a9 100644 --- a/test/fixtures/flow/literal-types/boolean-false/expected.json +++ b/test/fixtures/flow/literal-types/boolean-false/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "foo" + } }, "name": "foo", "typeAnnotation": { @@ -110,7 +109,6 @@ ], "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 74fbf09ae1..b05db87966 100644 --- a/test/fixtures/flow/literal-types/boolean-true/expected.json +++ b/test/fixtures/flow/literal-types/boolean-true/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "foo" + } }, "name": "foo", "typeAnnotation": { @@ -110,7 +109,6 @@ ], "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 9eefed3e90..78ebec7ba0 100644 --- a/test/fixtures/flow/literal-types/null/expected.json +++ b/test/fixtures/flow/literal-types/null/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "foo" + } }, "name": "foo", "typeAnnotation": { @@ -110,7 +109,6 @@ ], "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 0490f1092c..44d455a56d 100644 --- a/test/fixtures/flow/literal-types/number-binary/expected.json +++ b/test/fixtures/flow/literal-types/number-binary/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -88,7 +87,7 @@ } }, "typeAnnotation": { - "type": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "start": 7, "end": 16, "loc": { @@ -101,11 +100,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 2ef1aa9f66..4cdb637a55 100644 --- a/test/fixtures/flow/literal-types/number-float/expected.json +++ b/test/fixtures/flow/literal-types/number-float/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -88,7 +87,7 @@ } }, "typeAnnotation": { - "type": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "start": 7, "end": 12, "loc": { @@ -101,11 +100,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 009266cb9a..9b9a6da608 100644 --- a/test/fixtures/flow/literal-types/number-integer/expected.json +++ b/test/fixtures/flow/literal-types/number-integer/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -88,7 +87,7 @@ } }, "typeAnnotation": { - "type": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "start": 7, "end": 10, "loc": { @@ -101,11 +100,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 d0e43e2b7c..a97406933e 100644 --- a/test/fixtures/flow/literal-types/number-negative-binary/expected.json +++ b/test/fixtures/flow/literal-types/number-negative-binary/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -88,7 +87,7 @@ } }, "typeAnnotation": { - "type": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "start": 7, "end": 17, "loc": { @@ -101,11 +100,11 @@ "column": 17 } }, + "value": -123, "extra": { "rawValue": -123, "raw": "-0b1111011" - }, - "value": -123 + } } } }, @@ -117,4 +116,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 e1f7c14aba..25ac6b0013 100644 --- a/test/fixtures/flow/literal-types/number-negative-float/expected.json +++ b/test/fixtures/flow/literal-types/number-negative-float/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -88,7 +87,7 @@ } }, "typeAnnotation": { - "type": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "start": 7, "end": 13, "loc": { @@ -101,11 +100,11 @@ "column": 13 } }, + "value": -123, "extra": { "rawValue": -123, "raw": "-123.0" - }, - "value": -123 + } } } }, @@ -117,4 +116,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 b694f2aff6..136224babb 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,8 +69,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -88,7 +87,7 @@ } }, "typeAnnotation": { - "type": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "start": 7, "end": 13, "loc": { @@ -101,11 +100,11 @@ "column": 13 } }, + "value": -123, "extra": { "rawValue": -123, "raw": "-0o173" - }, - "value": -123 + } } } }, @@ -117,4 +116,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 9b95a16a64..aaa9ab4cce 100644 --- a/test/fixtures/flow/literal-types/number-negative-octal/expected.json +++ b/test/fixtures/flow/literal-types/number-negative-octal/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -88,7 +87,7 @@ } }, "typeAnnotation": { - "type": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "start": 7, "end": 12, "loc": { @@ -101,11 +100,11 @@ "column": 12 } }, + "value": -123, "extra": { "rawValue": -123, "raw": "-0x7B" - }, - "value": -123 + } } } }, @@ -117,4 +116,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 4da3b6ff0c..7c7b41adc3 100644 --- a/test/fixtures/flow/literal-types/number-octal-2/expected.json +++ b/test/fixtures/flow/literal-types/number-octal-2/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -88,7 +87,7 @@ } }, "typeAnnotation": { - "type": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "start": 7, "end": 12, "loc": { @@ -101,11 +100,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 ecb707cc9a..608b0731b2 100644 --- a/test/fixtures/flow/literal-types/number-octal/expected.json +++ b/test/fixtures/flow/literal-types/number-octal/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -88,7 +87,7 @@ } }, "typeAnnotation": { - "type": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "start": 7, "end": 11, "loc": { @@ -101,11 +100,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 010fa630f4..75c50aa13a 100644 --- a/test/fixtures/flow/literal-types/string-double/expected.json +++ b/test/fixtures/flow/literal-types/string-double/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "createElement" + } }, "name": "createElement" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 37 - }, - "identifierName": "tagName" + } }, "name": "tagName", "typeAnnotation": { @@ -107,16 +104,15 @@ "column": 37 } }, + "value": "div", "extra": { "rawValue": "div", "raw": "\"div\"" - }, - "value": "div" + } } } } ], - "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 38, @@ -158,8 +154,7 @@ "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 bd14fc10ac..e168fb2f91 100644 --- a/test/fixtures/flow/literal-types/string-single/expected.json +++ b/test/fixtures/flow/literal-types/string-single/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "createElement" + } }, "name": "createElement" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 37 - }, - "identifierName": "tagName" + } }, "name": "tagName", "typeAnnotation": { @@ -107,16 +104,15 @@ "column": 37 } }, + "value": "div", "extra": { "rawValue": "div", "raw": "'div'" - }, - "value": "div" + } } } } ], - "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 38, @@ -158,8 +154,7 @@ "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 deleted file mode 100644 index 83d9b887fc..0000000000 --- a/test/fixtures/flow/object-types/invalid-getter-param-count/actual.js +++ /dev/null @@ -1,3 +0,0 @@ -type B = { - get a(foo:number): number; -} 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 deleted file mode 100644 index 1ccbc71755..0000000000 --- a/test/fixtures/flow/object-types/invalid-setter-param-count/actual.js +++ /dev/null @@ -1,3 +0,0 @@ -type B = { - set a(): void; -} diff --git a/test/fixtures/flow/optional-type/1/expected.json b/test/fixtures/flow/optional-type/1/expected.json index da459cf18d..14de301f7b 100644 --- a/test/fixtures/flow/optional-type/1/expected.json +++ b/test/fixtures/flow/optional-type/1/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -105,8 +104,7 @@ "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 338ba4dbb9..4958cf281a 100644 --- a/test/fixtures/flow/optional-type/3/expected.json +++ b/test/fixtures/flow/optional-type/3/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -105,8 +104,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "x" + } }, "name": "x", "optional": true @@ -137,8 +135,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "y" + } }, "name": "y", "optional": true, @@ -183,8 +180,7 @@ "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 8a9c1e5b99..a570eafd13 100644 --- a/test/fixtures/flow/optional-type/4/expected.json +++ b/test/fixtures/flow/optional-type/4/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -119,8 +118,7 @@ "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 6412f802f5..eb81514fc4 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 }, - "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, + "predicate": { + "type": "DeclaredPredicate", + "start": 40, + "end": 59, "loc": { "start": { "line": 1, - "column": 48 + "column": 40 }, "end": { "line": 1, - "column": 49 - }, - "identifierName": "x" + "column": 59 + } }, - "name": "x" - }, - "operator": "!==", - "right": { - "type": "NullLiteral", - "start": 54, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 54 + "expression": { + "type": "BinaryExpression", + "start": 48, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 58 + } }, - "end": { - "line": 1, - "column": 58 + "left": { + "type": "Identifier", + "start": 48, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 49 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "!==", + "right": { + "type": "NullLiteral", + "start": 54, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 54 + }, + "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 79772c2417..64df4c2006 100644 --- a/test/fixtures/flow/predicates/2/expected.json +++ b/test/fixtures/flow/predicates/2/expected.json @@ -88,22 +88,37 @@ "column": 52 } }, - "predicate": { - "type": "InferredPredicate", - "start": 20, + "returnType": { + "type": "TypeAnnotation", + "start": 18, "end": 27, "loc": { "start": { "line": 1, - "column": 20 + "column": 18 }, "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, @@ -238,4 +253,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/flow/predicates/3/expected.json b/test/fixtures/flow/predicates/3/expected.json index 85e6105aca..8553cc335f 100644 --- a/test/fixtures/flow/predicates/3/expected.json +++ b/test/fixtures/flow/predicates/3/expected.json @@ -111,22 +111,37 @@ } } ], - "predicate": { - "type": "InferredPredicate", - "start": 24, + "returnType": { + "type": "TypeAnnotation", + "start": 22, "end": 31, "loc": { "start": { "line": 1, - "column": 24 + "column": 22 }, "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, @@ -252,4 +267,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/flow/predicates/6/expected.json b/test/fixtures/flow/predicates/6/expected.json index d0c50d9555..0805a80bd3 100644 --- a/test/fixtures/flow/predicates/6/expected.json +++ b/test/fixtures/flow/predicates/6/expected.json @@ -178,7 +178,7 @@ }, "params": [ { - "type": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "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": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "start": 82, "end": 83, "loc": { @@ -543,11 +543,11 @@ "column": 83 } }, + "value": 1, "extra": { "rawValue": 1, "raw": "1" - }, - "value": 1 + } } ] }, @@ -591,10 +591,9 @@ } } } - }, - "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 073d4776b7..74c8b20f8e 100644 --- a/test/fixtures/flow/qualified-generic-type/1/expected.json +++ b/test/fixtures/flow/qualified-generic-type/1/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -128,8 +127,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -145,8 +143,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "B" + } }, "name": "B" } @@ -159,7 +156,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 511e2495e0..56ec96bee3 100644 --- a/test/fixtures/flow/qualified-generic-type/2/expected.json +++ b/test/fixtures/flow/qualified-generic-type/2/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -142,8 +141,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -159,8 +157,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "B" + } }, "name": "B" } @@ -177,8 +174,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "C" + } }, "name": "C" } @@ -191,7 +187,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 aba60b3aeb..5cd3ae50df 100644 --- a/test/fixtures/flow/qualified-generic-type/3/expected.json +++ b/test/fixtures/flow/qualified-generic-type/3/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -143,8 +142,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "T" + } }, "name": "T" } @@ -177,8 +175,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -194,8 +191,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "B" + } }, "name": "B" } @@ -208,7 +204,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 5fd9813013..4a826a0f2a 100644 --- a/test/fixtures/flow/qualified-generic-type/4/expected.json +++ b/test/fixtures/flow/qualified-generic-type/4/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 21 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -157,8 +156,7 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "T" + } }, "name": "T" } @@ -191,8 +189,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "A" + } }, "name": "A" }, @@ -208,8 +205,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "B" + } }, "name": "B" } @@ -223,7 +219,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ No newline at end of file diff --git a/test/fixtures/flow/regression/.arrow-function-parens-with-return-type/expected.json b/test/fixtures/flow/regression/.arrow-function-parens-with-return-type/expected.json new file mode 100644 index 0000000000..4fba0bba88 --- /dev/null +++ b/test/fixtures/flow/regression/.arrow-function-parens-with-return-type/expected.json @@ -0,0 +1,166 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "foo" + }, + "init": { + "type": "ArrowFunctionExpression", + "start": 10, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "foo", + "parenthesizedExpression": true + } + ], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "body": [] + }, + "returnType": { + "type": "TypeAnnotation", + "start": 17, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 19, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 25 + } + } + } + } + } + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/regression/issue-2083/expected.json b/test/fixtures/flow/regression/issue-2083/expected.json index ff7b01c2f5..9b59a8861e 100644 --- a/test/fixtures/flow/regression/issue-2083/expected.json +++ b/test/fixtures/flow/regression/issue-2083/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -89,7 +88,6 @@ "column": 3 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,11 +101,11 @@ "end": { "line": 2, "column": 5 - }, - "identifierName": "foo" + } }, "name": "foo" }, + "static": false, "kind": "method", "id": null, "generator": false, @@ -219,8 +217,7 @@ "end": { "line": 4, "column": 22 - }, - "identifierName": "MatrixType" + } }, "name": "MatrixType" }, @@ -236,8 +233,7 @@ "end": { "line": 4, "column": 32 - }, - "identifierName": "IsScaling" + } }, "name": "IsScaling" }, @@ -270,8 +266,7 @@ "end": { "line": 4, "column": 45 - }, - "identifierName": "MatrixType" + } }, "name": "MatrixType" }, @@ -287,16 +282,14 @@ "end": { "line": 4, "column": 59 - }, - "identifierName": "IsTranslation" + } }, "name": "IsTranslation" }, "computed": false }, "extra": { - "parenthesized": true, - "parenStart": 50 + "parenthesized": true } } } @@ -320,7 +313,6 @@ "column": 3 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -334,11 +326,11 @@ "end": { "line": 8, "column": 5 - }, - "identifierName": "bar" + } }, "name": "bar" }, + "static": false, "kind": "method", "id": null, "generator": false, @@ -414,8 +406,7 @@ "end": { "line": 9, "column": 18 - }, - "identifierName": "typeA" + } }, "name": "typeA" }, @@ -441,8 +432,7 @@ "value": 4 }, "extra": { - "parenthesized": true, - "parenStart": 134 + "parenthesized": true } }, "operator": "|", @@ -458,8 +448,7 @@ "end": { "line": 9, "column": 32 - }, - "identifierName": "typeB" + } }, "name": "typeB" } diff --git a/test/fixtures/flow/regression/issue-2083/options.lightscript.json b/test/fixtures/flow/regression/issue-2083/options.lightscript.json new file mode 100644 index 0000000000..0282d671c4 --- /dev/null +++ b/test/fixtures/flow/regression/issue-2083/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Bitwise operators have been disabled in LightScript. Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`). (4:33)" +} \ No newline at end of file diff --git a/test/fixtures/flow/regression/issue-2493/expected.json b/test/fixtures/flow/regression/issue-2493/expected.json index 9e890e3ca3..7442f6e26f 100644 --- a/test/fixtures/flow/regression/issue-2493/expected.json +++ b/test/fixtures/flow/regression/issue-2493/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "hello" + } }, "name": "hello" }, @@ -88,37 +87,6 @@ "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, @@ -150,8 +118,7 @@ "end": { "line": 1, "column": 28 - }, - "identifierName": "greeting" + } }, "name": "greeting", "typeAnnotation": { @@ -276,8 +243,7 @@ "end": { "line": 2, "column": 9 - }, - "identifierName": "console" + } }, "name": "console" }, @@ -293,8 +259,7 @@ "end": { "line": 2, "column": 13 - }, - "identifierName": "log" + } }, "name": "log" }, @@ -348,8 +313,7 @@ "end": { "line": 2, "column": 32 - }, - "identifierName": "greeting" + } }, "name": "greeting" } @@ -359,6 +323,36 @@ } ], "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 + } + } + } } } } @@ -405,8 +399,7 @@ "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 806ebcd4b7..114d371dff 100644 --- a/test/fixtures/flow/trailing-function-commas-type/1/expected.json +++ b/test/fixtures/flow/trailing-function-commas-type/1/expected.json @@ -56,55 +56,6 @@ "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, @@ -122,8 +73,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "props" + } }, "name": "props", "typeAnnotation": { @@ -167,8 +117,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "SomeType" + } }, "name": "SomeType" } @@ -197,6 +146,53 @@ "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 7694ca00f1..a5dd1a823b 100644 --- a/test/fixtures/flow/tuples/1/expected.json +++ b/test/fixtures/flow/tuples/1/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -125,7 +124,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 6044a8c8d9..628e2579d4 100644 --- a/test/fixtures/flow/tuples/2/expected.json +++ b/test/fixtures/flow/tuples/2/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -158,8 +157,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "T" + } }, "name": "T" } @@ -178,8 +176,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "Foo" + } }, "name": "Foo" } @@ -215,8 +212,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "foo" + } }, "name": "foo" } @@ -226,7 +222,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 a358df13e8..175fca2fdf 100644 --- a/test/fixtures/flow/tuples/3/expected.json +++ b/test/fixtures/flow/tuples/3/expected.json @@ -69,8 +69,7 @@ "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 9cd18d0a93..5a29b26f34 100644 --- a/test/fixtures/flow/tuples/4/expected.json +++ b/test/fixtures/flow/tuples/4/expected.json @@ -69,8 +69,7 @@ "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 f6591175a3..a889ed041a 100644 --- a/test/fixtures/flow/type-alias/1/expected.json +++ b/test/fixtures/flow/type-alias/1/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "FBID" + } }, "name": "FBID" }, @@ -76,7 +75,7 @@ } } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 974e65eb4d..f44d030159 100644 --- a/test/fixtures/flow/type-alias/2/expected.json +++ b/test/fixtures/flow/type-alias/2/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 8 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -88,8 +87,7 @@ "column": 10 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -149,8 +147,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "T" + } }, "name": "T" } @@ -169,8 +166,7 @@ "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 cda0b600d3..411a17ad35 100644 --- a/test/fixtures/flow/type-alias/3/expected.json +++ b/test/fixtures/flow/type-alias/3/expected.json @@ -42,9 +42,6 @@ "column": 25 } }, - "specifiers": [], - "source": null, - "exportKind": "type", "declaration": { "type": "TypeAlias", "start": 7, @@ -71,8 +68,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -92,9 +88,11 @@ } } } - } + }, + "specifiers": [], + "source": null } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 c45c0020b6..829a4048e2 100644 --- a/test/fixtures/flow/type-alias/4/expected.json +++ b/test/fixtures/flow/type-alias/4/expected.json @@ -122,8 +122,6 @@ }, "name": "type" }, - "static": false, - "kind": "init", "value": { "type": "StringLiteralTypeAnnotation", "start": 23, @@ -138,14 +136,15 @@ "column": 13 } }, + "value": "A", "extra": { "rawValue": "A", "raw": "\"A\"" - }, - "value": "A" + } }, - "variance": null, - "optional": false + "optional": false, + "static": false, + "variance": null } ], "indexers": [], @@ -198,8 +197,6 @@ }, "name": "type" }, - "static": false, - "kind": "init", "value": { "type": "StringLiteralTypeAnnotation", "start": 38, @@ -214,14 +211,15 @@ "column": 13 } }, + "value": "B", "extra": { "rawValue": "B", "raw": "\"B\"" - }, - "value": "B" + } }, - "variance": null, - "optional": false + "optional": false, + "static": false, + "variance": null } ], "indexers": [], @@ -523,8 +521,6 @@ }, "name": "x" }, - "static": false, - "kind": "init", "value": { "type": "UnionTypeAnnotation", "start": 147, @@ -587,8 +583,6 @@ }, "name": "type" }, - "static": false, - "kind": "init", "value": { "type": "StringLiteralTypeAnnotation", "start": 156, @@ -603,14 +597,15 @@ "column": 16 } }, + "value": "A", "extra": { "rawValue": "A", "raw": "\"A\"" - }, - "value": "A" + } }, - "variance": null, - "optional": false + "optional": false, + "static": false, + "variance": null } ], "indexers": [], @@ -663,8 +658,6 @@ }, "name": "type" }, - "static": false, - "kind": "init", "value": { "type": "StringLiteralTypeAnnotation", "start": 174, @@ -679,14 +672,15 @@ "column": 16 } }, + "value": "B", "extra": { "rawValue": "B", "raw": "\"B\"" - }, - "value": "B" + } }, - "variance": null, - "optional": false + "optional": false, + "static": false, + "variance": null } ], "indexers": [], @@ -694,8 +688,9 @@ } ] }, - "variance": null, - "optional": false + "optional": false, + "static": false, + "variance": null } ], "indexers": [], @@ -781,8 +776,6 @@ }, "name": "x" }, - "static": false, - "kind": "init", "value": { "type": "IntersectionTypeAnnotation", "start": 212, @@ -845,8 +838,6 @@ }, "name": "type" }, - "static": false, - "kind": "init", "value": { "type": "StringLiteralTypeAnnotation", "start": 221, @@ -861,14 +852,15 @@ "column": 16 } }, + "value": "A", "extra": { "rawValue": "A", "raw": "\"A\"" - }, - "value": "A" + } }, - "variance": null, - "optional": false + "optional": false, + "static": false, + "variance": null } ], "indexers": [], @@ -921,8 +913,6 @@ }, "name": "type" }, - "static": false, - "kind": "init", "value": { "type": "StringLiteralTypeAnnotation", "start": 239, @@ -937,14 +927,15 @@ "column": 16 } }, + "value": "B", "extra": { "rawValue": "B", "raw": "\"B\"" - }, - "value": "B" + } }, - "variance": null, - "optional": false + "optional": false, + "static": false, + "variance": null } ], "indexers": [], @@ -952,8 +943,9 @@ } ] }, - "variance": null, - "optional": false + "optional": false, + "static": false, + "variance": null } ], "indexers": [], diff --git a/test/fixtures/flow/type-annotations/1/expected.json b/test/fixtures/flow/type-annotations/1/expected.json index ae49055627..4d022b66ad 100644 --- a/test/fixtures/flow/type-annotations/1/expected.json +++ b/test/fixtures/flow/type-annotations/1/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "numVal" + } }, "name": "numVal", "typeAnnotation": { @@ -122,8 +119,7 @@ "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 9e46f1b9bf..6aae036622 100644 --- a/test/fixtures/flow/type-annotations/10/expected.json +++ b/test/fixtures/flow/type-annotations/10/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 53 - }, - "identifierName": "callback" + } }, "name": "callback", "typeAnnotation": { @@ -134,8 +131,7 @@ "end": { "line": 1, "column": 26 - }, - "identifierName": "_1" + } }, "name": "_1" }, @@ -182,8 +178,7 @@ "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 a0e6a89d2c..5efdb76d0e 100644 --- a/test/fixtures/flow/type-annotations/100/expected.json +++ b/test/fixtures/flow/type-annotations/100/expected.json @@ -1,3 +1,4 @@ + { "type": "File", "start": 0, @@ -54,8 +55,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -89,7 +89,6 @@ "column": 39 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,102 +102,99 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "bar" + } }, "name": "bar" }, + "static": false, "kind": "method", "id": null, - "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": [] - } + "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 + } + } + } + } + ] + } } ] } } - ], - "directives": [] - } -} \ No newline at end of file + ] + }, + "comments": [] +} diff --git a/test/fixtures/flow/type-annotations/101/expected.json b/test/fixtures/flow/type-annotations/101/expected.json index aaf4345455..ae370710de 100644 --- a/test/fixtures/flow/type-annotations/101/expected.json +++ b/test/fixtures/flow/type-annotations/101/expected.json @@ -56,7 +56,6 @@ "column": 45 } }, - "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 23, @@ -112,8 +111,7 @@ "end": { "line": 1, "column": 36 - }, - "identifierName": "ReturnType" + } }, "name": "ReturnType" } @@ -151,8 +149,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "props" + } }, "name": "props" }, @@ -197,8 +194,7 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "SomeType" + } }, "name": "SomeType" } @@ -233,4 +229,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 e48ab5b500..4af93bb673 100644 --- a/test/fixtures/flow/type-annotations/102/expected.json +++ b/test/fixtures/flow/type-annotations/102/expected.json @@ -56,7 +56,6 @@ "column": 50 } }, - "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 29, @@ -129,8 +128,7 @@ "end": { "line": 1, "column": 36 - }, - "identifierName": "Array" + } }, "name": "Array" } @@ -167,8 +165,7 @@ "end": { "line": 1, "column": 28 - }, - "identifierName": "modifiers" + } }, "name": "modifiers" } @@ -196,4 +193,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 fd5baadca1..0ef3fc5e61 100644 --- a/test/fixtures/flow/type-annotations/103/expected.json +++ b/test/fixtures/flow/type-annotations/103/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "parser" + } }, "name": "parser" }, @@ -88,7 +87,6 @@ "column": 73 } }, - "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 65, @@ -130,8 +128,7 @@ "end": { "line": 1, "column": 67 - }, - "identifierName": "a" + } }, "name": "a" } @@ -154,8 +151,7 @@ "end": { "line": 1, "column": 32 - }, - "identifierName": "rootPath" + } }, "name": "rootPath", "typeAnnotation": { @@ -215,8 +211,7 @@ "end": { "line": 1, "column": 49 - }, - "identifierName": "filesToParse" + } }, "name": "filesToParse" }, @@ -292,8 +287,7 @@ "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 6ff300d7c7..d1bef6ae76 100644 --- a/test/fixtures/flow/type-annotations/104/expected.json +++ b/test/fixtures/flow/type-annotations/104/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -89,7 +88,6 @@ "column": 13 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,11 +101,11 @@ "end": { "line": 2, "column": 5 - }, - "identifierName": "get" + } }, "name": "get" }, + "static": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", @@ -138,8 +136,7 @@ "column": 7 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -195,8 +192,7 @@ "end": { "line": 5, "column": 9 - }, - "identifierName": "Bar" + } }, "name": "Bar" }, @@ -230,7 +226,6 @@ "column": 13 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -244,11 +239,11 @@ "end": { "line": 6, "column": 5 - }, - "identifierName": "set" + } }, "name": "set" }, + "static": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", @@ -279,8 +274,7 @@ "column": 7 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -313,4 +307,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 9f972ee738..b17400628a 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 54aad24d12..4d147cf4f4 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": 20, + "end": 21, "loc": { "start": { "line": 1, @@ -114,7 +114,7 @@ }, "end": { "line": 1, - "column": 20 + "column": 21 } }, "key": { @@ -134,8 +134,6 @@ }, "name": "x" }, - "static": false, - "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 14, @@ -151,8 +149,8 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null }, { "type": "ObjectTypeProperty", @@ -185,8 +183,6 @@ }, "name": "y" }, - "static": false, - "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 25, @@ -202,8 +198,8 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], "indexers": [], @@ -420,7 +416,7 @@ { "type": "ObjectTypeProperty", "start": 68, - "end": 77, + "end": 78, "loc": { "start": { "line": 2, @@ -428,7 +424,7 @@ }, "end": { "line": 2, - "column": 20 + "column": 21 } }, "key": { @@ -448,8 +444,6 @@ }, "name": "x" }, - "static": false, - "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 71, @@ -465,13 +459,13 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null }, { "type": "ObjectTypeProperty", "start": 79, - "end": 88, + "end": 89, "loc": { "start": { "line": 2, @@ -479,7 +473,7 @@ }, "end": { "line": 2, - "column": 31 + "column": 32 } }, "key": { @@ -499,8 +493,6 @@ }, "name": "y" }, - "static": false, - "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 82, @@ -516,8 +508,8 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], "indexers": [], @@ -834,7 +826,7 @@ { "type": "ObjectTypeProperty", "start": 145, - "end": 174, + "end": 175, "loc": { "start": { "line": 4, @@ -842,7 +834,7 @@ }, "end": { "line": 4, - "column": 39 + "column": 40 } }, "key": { @@ -862,8 +854,6 @@ }, "name": "a" }, - "static": false, - "kind": "init", "value": { "type": "ObjectTypeAnnotation", "start": 148, @@ -883,7 +873,7 @@ { "type": "ObjectTypeProperty", "start": 151, - "end": 160, + "end": 161, "loc": { "start": { "line": 4, @@ -891,7 +881,7 @@ }, "end": { "line": 4, - "column": 25 + "column": 26 } }, "key": { @@ -911,8 +901,6 @@ }, "name": "x" }, - "static": false, - "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 154, @@ -928,8 +916,8 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null }, { "type": "ObjectTypeProperty", @@ -962,8 +950,6 @@ }, "name": "y" }, - "static": false, - "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 165, @@ -979,15 +965,15 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], "indexers": [], "exact": true }, - "variance": null, - "optional": false + "optional": false, + "variance": null }, { "type": "ObjectTypeProperty", @@ -1020,8 +1006,6 @@ }, "name": "b" }, - "static": false, - "kind": "init", "value": { "type": "BooleanTypeAnnotation", "start": 179, @@ -1037,8 +1021,8 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], "indexers": [], @@ -1358,7 +1342,7 @@ { "type": "ObjectTypeProperty", "start": 239, - "end": 266, + "end": 267, "loc": { "start": { "line": 5, @@ -1366,7 +1350,7 @@ }, "end": { "line": 5, - "column": 38 + "column": 39 } }, "key": { @@ -1386,8 +1370,6 @@ }, "name": "a" }, - "static": false, - "kind": "init", "value": { "type": "ObjectTypeAnnotation", "start": 242, @@ -1407,7 +1389,7 @@ { "type": "ObjectTypeProperty", "start": 244, - "end": 253, + "end": 254, "loc": { "start": { "line": 5, @@ -1415,7 +1397,7 @@ }, "end": { "line": 5, - "column": 25 + "column": 26 } }, "key": { @@ -1435,8 +1417,6 @@ }, "name": "x" }, - "static": false, - "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 247, @@ -1452,8 +1432,8 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null }, { "type": "ObjectTypeProperty", @@ -1486,8 +1466,6 @@ }, "name": "y" }, - "static": false, - "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 258, @@ -1503,15 +1481,15 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], "indexers": [], "exact": false }, - "variance": null, - "optional": false + "optional": false, + "variance": null }, { "type": "ObjectTypeProperty", @@ -1544,8 +1522,6 @@ }, "name": "b" }, - "static": false, - "kind": "init", "value": { "type": "BooleanTypeAnnotation", "start": 271, @@ -1561,8 +1537,8 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], "indexers": [], diff --git a/test/fixtures/flow/type-annotations/11/expected.json b/test/fixtures/flow/type-annotations/11/expected.json index 10d10e3696..5de62117eb 100644 --- a/test/fixtures/flow/type-annotations/11/expected.json +++ b/test/fixtures/flow/type-annotations/11/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 64 - }, - "identifierName": "callback" + } }, "name": "callback", "typeAnnotation": { @@ -134,8 +131,7 @@ "end": { "line": 1, "column": 26 - }, - "identifierName": "_1" + } }, "name": "_1" }, @@ -183,8 +179,7 @@ "end": { "line": 1, "column": 39 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -247,8 +242,7 @@ "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 063bbf7e97..6556914731 100644 --- a/test/fixtures/flow/type-annotations/110/expected.json +++ b/test/fixtures/flow/type-annotations/110/expected.json @@ -107,8 +107,6 @@ }, "name": "p" }, - "static": false, - "kind": "init", "value": { "type": "GenericTypeAnnotation", "start": 13, @@ -142,23 +140,9 @@ "name": "T" } }, - "variance": { - "type": "Variance", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - }, - "kind": "plus" - }, - "optional": false + "optional": false, + "static": false, + "variance": "plus" } ], "indexers": [], @@ -168,4 +152,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 02766a4758..8dde23737d 100644 --- a/test/fixtures/flow/type-annotations/111/expected.json +++ b/test/fixtures/flow/type-annotations/111/expected.json @@ -107,8 +107,6 @@ }, "name": "p" }, - "static": false, - "kind": "init", "value": { "type": "GenericTypeAnnotation", "start": 13, @@ -142,23 +140,9 @@ "name": "T" } }, - "variance": { - "type": "Variance", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - }, - "kind": "minus" - }, - "optional": false + "optional": false, + "static": false, + "variance": "minus" } ], "indexers": [], @@ -168,4 +152,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 5cbe3ec43a..6279284056 100644 --- a/test/fixtures/flow/type-annotations/114/expected.json +++ b/test/fixtures/flow/type-annotations/114/expected.json @@ -175,22 +175,7 @@ "name": "V" } }, - "variance": { - "type": "Variance", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - }, - "kind": "plus" - } + "variance": "plus" } ], "exact": false @@ -199,4 +184,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 cdb32af1e6..2ed71ae23e 100644 --- a/test/fixtures/flow/type-annotations/115/expected.json +++ b/test/fixtures/flow/type-annotations/115/expected.json @@ -175,22 +175,7 @@ "name": "V" } }, - "variance": { - "type": "Variance", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - }, - "kind": "minus" - } + "variance": "minus" } ], "exact": false @@ -199,4 +184,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 86dba55ab3..3197ff95a7 100644 --- a/test/fixtures/flow/type-annotations/118/expected.json +++ b/test/fixtures/flow/type-annotations/118/expected.json @@ -89,7 +89,6 @@ "column": 13 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -108,22 +107,8 @@ }, "name": "p" }, - "variance": { - "type": "Variance", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "kind": "plus" - }, + "variance": "plus", + "static": false, "typeAnnotation": { "type": "TypeAnnotation", "start": 11, @@ -180,4 +165,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 b975624266..601ec1663f 100644 --- a/test/fixtures/flow/type-annotations/119/expected.json +++ b/test/fixtures/flow/type-annotations/119/expected.json @@ -89,7 +89,6 @@ "column": 13 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -108,22 +107,8 @@ }, "name": "p" }, - "variance": { - "type": "Variance", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "kind": "minus" - }, + "variance": "minus", + "static": false, "typeAnnotation": { "type": "TypeAnnotation", "start": 11, @@ -180,4 +165,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 22f2c3c9df..fddf075029 100644 --- a/test/fixtures/flow/type-annotations/12/expected.json +++ b/test/fixtures/flow/type-annotations/12/expected.json @@ -54,16 +54,13 @@ "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 ecffbbf855..e55c90e118 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": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "start": 10, "end": 11, "loc": { @@ -116,14 +116,14 @@ "column": 4 } }, + "value": 1, "extra": { "rawValue": 1, "raw": "1" - }, - "value": 1 + } }, { - "type": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "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 3a78824d22..1070cfbe37 100644 --- a/test/fixtures/flow/type-annotations/13/expected.json +++ b/test/fixtures/flow/type-annotations/13/expected.json @@ -54,16 +54,13 @@ "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 15ad52dcb9..2a823858a4 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": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "start": 16, "end": 17, "loc": { @@ -122,14 +122,14 @@ "column": 17 } }, + "value": 1, "extra": { "rawValue": 1, "raw": "1" - }, - "value": 1 + } }, { - "type": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "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": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "start": 28, "end": 29, "loc": { @@ -211,14 +211,14 @@ "column": 29 } }, + "value": 3, "extra": { "rawValue": 3, "raw": "3" - }, - "value": 3 + } }, { - "type": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "start": 32, "end": 33, "loc": { @@ -231,18 +231,17 @@ "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 deleted file mode 100644 index b79dc870ee..0000000000 --- a/test/fixtures/flow/type-annotations/135/actual.js +++ /dev/null @@ -1,3 +0,0 @@ -type A = { - ...any, -}; diff --git a/test/fixtures/flow/type-annotations/135/expected.json b/test/fixtures/flow/type-annotations/135/expected.json deleted file mode 100644 index 14027b107e..0000000000 --- a/test/fixtures/flow/type-annotations/135/expected.json +++ /dev/null @@ -1,117 +0,0 @@ -{ - "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 deleted file mode 100644 index 09c0a04398..0000000000 --- a/test/fixtures/flow/type-annotations/136/actual.js +++ /dev/null @@ -1,4 +0,0 @@ -type A = { - p: {}, - ...{}, -}; diff --git a/test/fixtures/flow/type-annotations/136/expected.json b/test/fixtures/flow/type-annotations/136/expected.json deleted file mode 100644 index 6ccd7002c9..0000000000 --- a/test/fixtures/flow/type-annotations/136/expected.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "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 deleted file mode 100644 index b039a41ed2..0000000000 --- a/test/fixtures/flow/type-annotations/137/actual.js +++ /dev/null @@ -1,3 +0,0 @@ -interface A { - ...any, -}; diff --git a/test/fixtures/flow/type-annotations/137/options.json b/test/fixtures/flow/type-annotations/137/options.json deleted file mode 100644 index 786acad32a..0000000000 --- a/test/fixtures/flow/type-annotations/137/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 9a607c669f..0000000000 --- a/test/fixtures/flow/type-annotations/138/actual.js +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 3aabc9dfd3..0000000000 --- a/test/fixtures/flow/type-annotations/138/expected.json +++ /dev/null @@ -1,283 +0,0 @@ -{ - "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 deleted file mode 100644 index fbc1330612..0000000000 --- a/test/fixtures/flow/type-annotations/139/actual.js +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index 835e923674..0000000000 --- a/test/fixtures/flow/type-annotations/139/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 807aa5b5a4..96fb6480b2 100644 --- a/test/fixtures/flow/type-annotations/14/expected.json +++ b/test/fixtures/flow/type-annotations/14/expected.json @@ -54,16 +54,13 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" }, "generator": false, "expression": false, - "async": false, "params": [], - "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 14, @@ -119,8 +116,7 @@ "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 9d52a5cde3..310bd0ca0c 100644 --- a/test/fixtures/flow/type-annotations/15/expected.json +++ b/test/fixtures/flow/type-annotations/15/expected.json @@ -54,16 +54,13 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" }, "generator": false, "expression": false, - "async": false, "params": [], - "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 14, @@ -119,8 +116,7 @@ "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 51bc95587f..392f618655 100644 --- a/test/fixtures/flow/type-annotations/16/expected.json +++ b/test/fixtures/flow/type-annotations/16/expected.json @@ -54,16 +54,13 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" }, "generator": false, "expression": false, - "async": false, "params": [], - "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 14, @@ -94,8 +91,7 @@ }, "callProperties": [], "properties": [], - "indexers": [], - "exact": false + "indexers": [] } }, "body": { diff --git a/test/fixtures/flow/type-annotations/17/expected.json b/test/fixtures/flow/type-annotations/17/expected.json index ca24d0c90a..79b5a0eac8 100644 --- a/test/fixtures/flow/type-annotations/17/expected.json +++ b/test/fixtures/flow/type-annotations/17/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -91,8 +90,7 @@ "column": 14 } }, - "name": "T", - "variance": null + "name": "T" } ] }, diff --git a/test/fixtures/flow/type-annotations/18/expected.json b/test/fixtures/flow/type-annotations/18/expected.json index 56d24c9789..914cf6d4a7 100644 --- a/test/fixtures/flow/type-annotations/18/expected.json +++ b/test/fixtures/flow/type-annotations/18/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -91,8 +90,7 @@ "column": 14 } }, - "name": "T", - "variance": null + "name": "T" }, { "type": "TypeParameter", @@ -108,8 +106,7 @@ "column": 16 } }, - "name": "S", - "variance": null + "name": "S" } ] }, diff --git a/test/fixtures/flow/type-annotations/19/expected.json b/test/fixtures/flow/type-annotations/19/expected.json index 6155d2e0f5..efca68b2de 100644 --- a/test/fixtures/flow/type-annotations/19/expected.json +++ b/test/fixtures/flow/type-annotations/19/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -121,8 +120,7 @@ "column": 12 } }, - "name": "T", - "variance": null + "name": "T" }, { "type": "TypeParameter", @@ -138,8 +136,7 @@ "column": 14 } }, - "name": "S", - "variance": null + "name": "S" } ] }, diff --git a/test/fixtures/flow/type-annotations/19/expected.lightscript.json b/test/fixtures/flow/type-annotations/19/expected.lightscript.json new file mode 100644 index 0000000000..a6382138c3 --- /dev/null +++ b/test/fixtures/flow/type-annotations/19/expected.lightscript.json @@ -0,0 +1,175 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "FunctionExpression", + "start": 2, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "T", + "variance": null + }, + { + "type": "TypeParameter", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "S", + "variance": null + } + ] + }, + "params": [], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/2/expected.json b/test/fixtures/flow/type-annotations/2/expected.json index 39c2e55c4f..9f0c84fa45 100644 --- a/test/fixtures/flow/type-annotations/2/expected.json +++ b/test/fixtures/flow/type-annotations/2/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "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 cf418c1dd4..e21b48d766 100644 --- a/test/fixtures/flow/type-annotations/20/expected.json +++ b/test/fixtures/flow/type-annotations/20/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -118,13 +117,11 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "fooProp" + } }, "name": "fooProp" }, "kind": "set", - "variance": null, "id": null, "generator": false, "expression": false, @@ -142,8 +139,7 @@ "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 new file mode 100644 index 0000000000..9031bdb5ab --- /dev/null +++ b/test/fixtures/flow/type-annotations/20/expected.lightscript.json @@ -0,0 +1,212 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "kind": "const", + "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": "a" + }, + "name": "a" + }, + "init": { + "type": "ObjectExpression", + "start": 2, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 3, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 7, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "fooProp" + }, + "name": "fooProp" + }, + "kind": "set", + "variance": null, + "variancePos": 7, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 27 + }, + "identifierName": "value" + }, + "name": "value", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 20, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 27 + } + } + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "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 c5d4df45b5..d1ddc78e40 100644 --- a/test/fixtures/flow/type-annotations/21/expected.json +++ b/test/fixtures/flow/type-annotations/21/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -118,13 +117,11 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "fooProp" + } }, "name": "fooProp" }, "kind": "set", - "variance": null, "id": null, "generator": false, "expression": false, @@ -142,8 +139,7 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "value" + } }, "name": "value", "typeAnnotation": { @@ -178,7 +174,6 @@ } } ], - "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 new file mode 100644 index 0000000000..a9fb59fcf9 --- /dev/null +++ b/test/fixtures/flow/type-annotations/21/expected.lightscript.json @@ -0,0 +1,242 @@ +{ + "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": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "ObjectExpression", + "start": 2, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 3, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 7, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "fooProp" + }, + "name": "fooProp" + }, + "kind": "set", + "variance": null, + "variancePos": 7, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 27 + }, + "identifierName": "value" + }, + "name": "value", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 20, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 27 + } + } + } + } + } + ], + "returnType": { + "type": "TypeAnnotation", + "start": 28, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "typeAnnotation": { + "type": "VoidTypeAnnotation", + "start": 29, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 33 + } + } + } + }, + "body": { + "type": "BlockStatement", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "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 3cbd6273d8..4725285737 100644 --- a/test/fixtures/flow/type-annotations/22/expected.json +++ b/test/fixtures/flow/type-annotations/22/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -118,19 +117,16 @@ "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 new file mode 100644 index 0000000000..1d700bbd52 --- /dev/null +++ b/test/fixtures/flow/type-annotations/22/expected.lightscript.json @@ -0,0 +1,194 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "ObjectExpression", + "start": 2, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 3, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 7, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "fooProp" + }, + "name": "fooProp" + }, + "kind": "get", + "variance": null, + "variancePos": 7, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "returnType": { + "type": "TypeAnnotation", + "start": 16, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + } + } + } + }, + "body": { + "type": "BlockStatement", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "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 05b77ef383..3cb0c90897 100644 --- a/test/fixtures/flow/type-annotations/23/expected.json +++ b/test/fixtures/flow/type-annotations/23/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "id" + } }, "name": "id" }, @@ -141,8 +139,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "x" + } }, "name": "x", "typeAnnotation": { @@ -186,8 +183,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "T" + } }, "name": "T" } @@ -195,7 +191,6 @@ } } ], - "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 14, @@ -237,8 +232,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "T" + } }, "name": "T" } @@ -290,8 +284,7 @@ "column": 7 } }, - "name": "T", - "variance": null + "name": "T" } ] } diff --git a/test/fixtures/flow/type-annotations/23/expected.lightscript.json b/test/fixtures/flow/type-annotations/23/expected.lightscript.json new file mode 100644 index 0000000000..452dd41c06 --- /dev/null +++ b/test/fixtures/flow/type-annotations/23/expected.lightscript.json @@ -0,0 +1,310 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "ObjectExpression", + "start": 2, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 3, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "id" + }, + "name": "id" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "x" + }, + "name": "x", + "typeAnnotation": { + "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": "T" + }, + "name": "T" + } + } + } + } + ], + "returnType": { + "type": "TypeAnnotation", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "T" + }, + "name": "T" + } + } + }, + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "T", + "variance": null + } + ] + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/24/expected.json b/test/fixtures/flow/type-annotations/24/expected.json index ffb6d1e92c..8d2e85d6c2 100644 --- a/test/fixtures/flow/type-annotations/24/expected.json +++ b/test/fixtures/flow/type-annotations/24/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "id" + } }, "name": "id" }, @@ -141,8 +139,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "x" + } }, "name": "x", "typeAnnotation": { @@ -186,8 +183,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "T" + } }, "name": "T" } @@ -195,7 +191,6 @@ } } ], - "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 15, @@ -237,8 +232,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "T" + } }, "name": "T" } @@ -290,8 +284,7 @@ "column": 8 } }, - "name": "T", - "variance": null + "name": "T" } ] } diff --git a/test/fixtures/flow/type-annotations/24/expected.lightscript.json b/test/fixtures/flow/type-annotations/24/expected.lightscript.json new file mode 100644 index 0000000000..04666d77a2 --- /dev/null +++ b/test/fixtures/flow/type-annotations/24/expected.lightscript.json @@ -0,0 +1,310 @@ +{ + "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": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "ObjectExpression", + "start": 2, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 3, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "id" + }, + "name": "id" + }, + "kind": "method", + "id": null, + "generator": true, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "x" + }, + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "T" + }, + "name": "T" + } + } + } + } + ], + "returnType": { + "type": "TypeAnnotation", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "T" + }, + "name": "T" + } + } + }, + "body": { + "type": "BlockStatement", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "T", + "variance": null + } + ] + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/25/expected.json b/test/fixtures/flow/type-annotations/25/expected.json index cdf03fcf78..cc26713d44 100644 --- a/test/fixtures/flow/type-annotations/25/expected.json +++ b/test/fixtures/flow/type-annotations/25/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -118,8 +117,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "id" + } }, "name": "id" }, @@ -141,8 +139,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "x" + } }, "name": "x", "typeAnnotation": { @@ -186,8 +183,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "T" + } }, "name": "T" } @@ -195,7 +191,6 @@ } } ], - "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 20, @@ -237,8 +232,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "T" + } }, "name": "T" } @@ -290,8 +284,7 @@ "column": 13 } }, - "name": "T", - "variance": null + "name": "T" } ] } diff --git a/test/fixtures/flow/type-annotations/25/expected.lightscript.json b/test/fixtures/flow/type-annotations/25/expected.lightscript.json new file mode 100644 index 0000000000..7d6b74dd11 --- /dev/null +++ b/test/fixtures/flow/type-annotations/25/expected.lightscript.json @@ -0,0 +1,310 @@ +{ + "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": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "kind": "const", + "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": "a" + }, + "name": "a" + }, + "init": { + "type": "ObjectExpression", + "start": 2, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 3, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "id" + }, + "name": "id" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": true, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "x" + }, + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "T" + }, + "name": "T" + } + } + } + } + ], + "returnType": { + "type": "TypeAnnotation", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "T" + }, + "name": "T" + } + } + }, + "body": { + "type": "BlockStatement", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "T", + "variance": null + } + ] + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/26/expected.json b/test/fixtures/flow/type-annotations/26/expected.json index 9a5cf1d754..0507d3b4dc 100644 --- a/test/fixtures/flow/type-annotations/26/expected.json +++ b/test/fixtures/flow/type-annotations/26/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -144,8 +143,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "x" + } }, "name": "x", "typeAnnotation": { @@ -189,8 +187,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "T" + } }, "name": "T" } @@ -198,7 +195,6 @@ } } ], - "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 15, @@ -240,8 +236,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "T" + } }, "name": "T" } @@ -293,8 +288,7 @@ "column": 8 } }, - "name": "T", - "variance": null + "name": "T" } ] } diff --git a/test/fixtures/flow/type-annotations/26/expected.lightscript.json b/test/fixtures/flow/type-annotations/26/expected.lightscript.json new file mode 100644 index 0000000000..db8d072cb6 --- /dev/null +++ b/test/fixtures/flow/type-annotations/26/expected.lightscript.json @@ -0,0 +1,313 @@ +{ + "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": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "ObjectExpression", + "start": 2, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 3, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "NumericLiteral", + "start": 3, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 123, + "raw": "123" + }, + "value": 123 + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "x" + }, + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "T" + }, + "name": "T" + } + } + } + } + ], + "returnType": { + "type": "TypeAnnotation", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "T" + }, + "name": "T" + } + } + }, + "body": { + "type": "BlockStatement", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "T", + "variance": null + } + ] + } + } + ] + } + } + ] + } + ], + "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 07d8b8fd2d..71c96e968a 100644 --- a/test/fixtures/flow/type-annotations/27/expected.json +++ b/test/fixtures/flow/type-annotations/27/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -89,7 +88,6 @@ "column": 38 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,11 +101,11 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "fooProp" + } }, "name": "fooProp" }, + "static": false, "kind": "set", "id": null, "generator": false, @@ -126,8 +124,7 @@ "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 4dc6a8495b..ba9b916990 100644 --- a/test/fixtures/flow/type-annotations/28/expected.json +++ b/test/fixtures/flow/type-annotations/28/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -89,7 +88,6 @@ "column": 43 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,11 +101,11 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "fooProp" + } }, "name": "fooProp" }, + "static": false, "kind": "set", "id": null, "generator": false, @@ -126,8 +124,7 @@ "end": { "line": 1, "column": 35 - }, - "identifierName": "value" + } }, "name": "value", "typeAnnotation": { @@ -162,7 +159,6 @@ } } ], - "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 14dda0a969..b675422aca 100644 --- a/test/fixtures/flow/type-annotations/29/expected.json +++ b/test/fixtures/flow/type-annotations/29/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -89,7 +88,6 @@ "column": 33 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,18 +101,17 @@ "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 ad0533f545..6c069ca9dd 100644 --- a/test/fixtures/flow/type-annotations/3/expected.json +++ b/test/fixtures/flow/type-annotations/3/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "numVal" + } }, "name": "numVal", "typeAnnotation": { @@ -122,8 +119,7 @@ "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 3bf70055fa..f2d9219592 100644 --- a/test/fixtures/flow/type-annotations/30/expected.json +++ b/test/fixtures/flow/type-annotations/30/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "numVal" + } }, "name": "numVal", "typeAnnotation": { @@ -109,7 +108,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 654148cf75..c885a0e4d9 100644 --- a/test/fixtures/flow/type-annotations/31/expected.json +++ b/test/fixtures/flow/type-annotations/31/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "numVal" + } }, "name": "numVal", "typeAnnotation": { @@ -116,8 +115,7 @@ "end": { "line": 1, "column": 31 - }, - "identifierName": "otherNumVal" + } }, "name": "otherNumVal" } @@ -125,7 +123,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 2009fe86e1..272d0ef394 100644 --- a/test/fixtures/flow/type-annotations/32/expected.json +++ b/test/fixtures/flow/type-annotations/32/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -129,13 +128,10 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "numVal" + } }, "name": "numVal" }, - "static": false, - "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 16, @@ -151,12 +147,11 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], - "indexers": [], - "exact": false + "indexers": [] } } }, @@ -165,7 +160,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 20c064ef1a..0debe1f0b4 100644 --- a/test/fixtures/flow/type-annotations/33/expected.json +++ b/test/fixtures/flow/type-annotations/33/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -106,7 +105,7 @@ { "type": "ObjectTypeProperty", "start": 8, - "end": 22, + "end": 23, "loc": { "start": { "line": 1, @@ -114,7 +113,7 @@ }, "end": { "line": 1, - "column": 22 + "column": 23 } }, "key": { @@ -129,13 +128,10 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "numVal" + } }, "name": "numVal" }, - "static": false, - "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 16, @@ -151,12 +147,11 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], - "indexers": [], - "exact": false + "indexers": [] } } }, @@ -165,7 +160,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 8214472aee..dda3fa64e2 100644 --- a/test/fixtures/flow/type-annotations/34/expected.json +++ b/test/fixtures/flow/type-annotations/34/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 50 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -106,7 +105,7 @@ { "type": "ObjectTypeProperty", "start": 8, - "end": 22, + "end": 23, "loc": { "start": { "line": 1, @@ -114,7 +113,7 @@ }, "end": { "line": 1, - "column": 22 + "column": 23 } }, "key": { @@ -129,13 +128,10 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "numVal" + } }, "name": "numVal" }, - "static": false, - "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 16, @@ -151,8 +147,8 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], "indexers": [ @@ -170,7 +166,6 @@ "column": 49 } }, - "static": false, "id": { "type": "Identifier", "start": 25, @@ -183,8 +178,7 @@ "end": { "line": 1, "column": 32 - }, - "identifierName": "indexer" + } }, "name": "indexer" }, @@ -220,8 +214,7 @@ }, "variance": null } - ], - "exact": false + ] } } }, @@ -230,7 +223,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 0a016d2518..9b7e857b25 100644 --- a/test/fixtures/flow/type-annotations/35/expected.json +++ b/test/fixtures/flow/type-annotations/35/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -143,13 +142,10 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "numVal" + } }, "name": "numVal" }, - "static": false, - "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 17, @@ -165,12 +161,11 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], - "indexers": [], - "exact": false + "indexers": [] } } } @@ -180,7 +175,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 31e1d58d02..564ecad3f2 100644 --- a/test/fixtures/flow/type-annotations/36/expected.json +++ b/test/fixtures/flow/type-annotations/36/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 39 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -106,7 +105,7 @@ { "type": "ObjectTypeProperty", "start": 8, - "end": 22, + "end": 23, "loc": { "start": { "line": 1, @@ -114,7 +113,7 @@ }, "end": { "line": 1, - "column": 22 + "column": 23 } }, "key": { @@ -129,13 +128,10 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "numVal" + } }, "name": "numVal" }, - "static": false, - "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 16, @@ -151,8 +147,8 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null }, { "type": "ObjectTypeProperty", @@ -180,13 +176,10 @@ "end": { "line": 1, "column": 30 - }, - "identifierName": "strVal" + } }, "name": "strVal" }, - "static": false, - "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 32, @@ -202,12 +195,11 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], - "indexers": [], - "exact": false + "indexers": [] } } }, @@ -216,7 +208,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 5c4dbc804f..b28c546643 100644 --- a/test/fixtures/flow/type-annotations/37/expected.json +++ b/test/fixtures/flow/type-annotations/37/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 33 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -129,13 +128,10 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "subObj" + } }, "name": "subObj" }, - "static": false, - "kind": "init", "value": { "type": "ObjectTypeAnnotation", "start": 16, @@ -178,13 +174,10 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "strVal" + } }, "name": "strVal" }, - "static": false, - "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 25, @@ -200,19 +193,17 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], - "indexers": [], - "exact": false + "indexers": [] }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], - "indexers": [], - "exact": false + "indexers": [] } } }, @@ -221,7 +212,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 13365bd73e..d9a1247969 100644 --- a/test/fixtures/flow/type-annotations/38/expected.json +++ b/test/fixtures/flow/type-annotations/38/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 34 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -129,13 +128,10 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "subObj" + } }, "name": "subObj" }, - "static": false, - "kind": "init", "value": { "type": "NullableTypeAnnotation", "start": 16, @@ -192,13 +188,10 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "strVal" + } }, "name": "strVal" }, - "static": false, - "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 26, @@ -214,20 +207,18 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], - "indexers": [], - "exact": false + "indexers": [] } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], - "indexers": [], - "exact": false + "indexers": [] } } }, @@ -236,7 +227,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 ff7898371e..4e263242a8 100644 --- a/test/fixtures/flow/type-annotations/39/expected.json +++ b/test/fixtures/flow/type-annotations/39/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 39 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -106,7 +105,7 @@ { "type": "ObjectTypeProperty", "start": 8, - "end": 22, + "end": 23, "loc": { "start": { "line": 1, @@ -114,7 +113,7 @@ }, "end": { "line": 1, - "column": 22 + "column": 23 } }, "key": { @@ -129,13 +128,10 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "param1" + } }, "name": "param1" }, - "static": false, - "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 16, @@ -151,8 +147,8 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null }, { "type": "ObjectTypeProperty", @@ -180,13 +176,10 @@ "end": { "line": 1, "column": 30 - }, - "identifierName": "param2" + } }, "name": "param2" }, - "static": false, - "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 32, @@ -202,12 +195,11 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], - "indexers": [], - "exact": false + "indexers": [] } } }, @@ -216,7 +208,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 5535d3d0de..c888bafd92 100644 --- a/test/fixtures/flow/type-annotations/4/expected.json +++ b/test/fixtures/flow/type-annotations/4/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "numVal" + } }, "name": "numVal", "typeAnnotation": { @@ -122,8 +119,7 @@ "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 fc457a1df3..14d938827c 100644 --- a/test/fixtures/flow/type-annotations/40/expected.json +++ b/test/fixtures/flow/type-annotations/40/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 40 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -106,7 +105,7 @@ { "type": "ObjectTypeProperty", "start": 8, - "end": 22, + "end": 23, "loc": { "start": { "line": 1, @@ -114,7 +113,7 @@ }, "end": { "line": 1, - "column": 22 + "column": 23 } }, "key": { @@ -129,13 +128,10 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "param1" + } }, "name": "param1" }, - "static": false, - "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 16, @@ -151,8 +147,8 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null }, { "type": "ObjectTypeProperty", @@ -180,13 +176,10 @@ "end": { "line": 1, "column": 30 - }, - "identifierName": "param2" + } }, "name": "param2" }, - "static": false, - "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 33, @@ -202,12 +195,11 @@ } } }, - "variance": null, - "optional": true + "optional": true, + "variance": null } ], - "indexers": [], - "exact": false + "indexers": [] } } }, @@ -216,7 +208,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/41/expected.json b/test/fixtures/flow/type-annotations/41/expected.json index af45a70ad3..11f1b5529a 100644 --- a/test/fixtures/flow/type-annotations/41/expected.json +++ b/test/fixtures/flow/type-annotations/41/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 52 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -107,7 +106,7 @@ { "type": "ObjectTypeIndexer", "start": 9, - "end": 28, + "end": 29, "loc": { "start": { "line": 1, @@ -115,10 +114,9 @@ }, "end": { "line": 1, - "column": 28 + "column": 29 } }, - "static": false, "id": { "type": "Identifier", "start": 10, @@ -131,8 +129,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -165,13 +162,12 @@ "column": 28 } } - }, - "variance": null + } }, { "type": "ObjectTypeIndexer", "start": 30, - "end": 49, + "end": 50, "loc": { "start": { "line": 1, @@ -179,10 +175,9 @@ }, "end": { "line": 1, - "column": 49 + "column": 50 } }, - "static": false, "id": { "type": "Identifier", "start": 31, @@ -195,8 +190,7 @@ "end": { "line": 1, "column": 32 - }, - "identifierName": "b" + } }, "name": "b" }, @@ -232,8 +226,7 @@ }, "variance": null } - ], - "exact": false + ] } } }, @@ -242,7 +235,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 71e3447c35..41e59eda82 100644 --- a/test/fixtures/flow/type-annotations/42/expected.json +++ b/test/fixtures/flow/type-annotations/42/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 48 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -117,25 +116,6 @@ "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, @@ -177,8 +157,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -226,8 +205,7 @@ "end": { "line": 1, "column": 26 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -290,8 +268,7 @@ "end": { "line": 1, "column": 32 - }, - "identifierName": "Array" + } }, "name": "Array" } @@ -314,11 +291,26 @@ } } }, + "key": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "add" + }, "optional": false } ], - "indexers": [], - "exact": false + "indexers": [] } } }, @@ -327,7 +319,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 07ba5008e4..5c47531465 100644 --- a/test/fixtures/flow/type-annotations/43/expected.json +++ b/test/fixtures/flow/type-annotations/43/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 26 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -106,7 +105,7 @@ { "type": "ObjectTypeProperty", "start": 9, - "end": 23, + "end": 24, "loc": { "start": { "line": 1, @@ -114,28 +113,9 @@ }, "end": { "line": 1, - "column": 23 + "column": 24 } }, - "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, @@ -177,8 +157,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -210,8 +189,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "T" + } }, "name": "T" } @@ -248,8 +226,7 @@ "column": 13 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -280,18 +257,32 @@ "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": [], - "exact": false + "indexers": [] } } }, diff --git a/test/fixtures/flow/type-annotations/44/expected.json b/test/fixtures/flow/type-annotations/44/expected.json index 2859b99a3d..fe5e161b5b 100644 --- a/test/fixtures/flow/type-annotations/44/expected.json +++ b/test/fixtures/flow/type-annotations/44/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -145,8 +144,7 @@ "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 369cc5973e..b56df4cd7d 100644 --- a/test/fixtures/flow/type-annotations/45/expected.json +++ b/test/fixtures/flow/type-annotations/45/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -134,8 +132,7 @@ "column": 15 } }, - "name": "T", - "variance": null + "name": "T" } ] }, diff --git a/test/fixtures/flow/type-annotations/45/expected.lightscript.json b/test/fixtures/flow/type-annotations/45/expected.lightscript.json new file mode 100644 index 0000000000..4a7d8c2c1a --- /dev/null +++ b/test/fixtures/flow/type-annotations/45/expected.lightscript.json @@ -0,0 +1,167 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "ClassExpression", + "start": 4, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "T", + "variance": null + } + ] + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [] + } + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/46/expected.json b/test/fixtures/flow/type-annotations/46/expected.json index 22ae4951bf..e14dc6e612 100644 --- a/test/fixtures/flow/type-annotations/46/expected.json +++ b/test/fixtures/flow/type-annotations/46/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 1 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -134,8 +132,7 @@ "column": 15 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -151,8 +148,7 @@ "end": { "line": 1, "column": 28 - }, - "identifierName": "Bar" + } }, "name": "Bar" }, @@ -198,8 +194,7 @@ "end": { "line": 1, "column": 30 - }, - "identifierName": "T" + } }, "name": "T" } diff --git a/test/fixtures/flow/type-annotations/46/expected.lightscript.json b/test/fixtures/flow/type-annotations/46/expected.lightscript.json new file mode 100644 index 0000000000..20cf48c135 --- /dev/null +++ b/test/fixtures/flow/type-annotations/46/expected.lightscript.json @@ -0,0 +1,233 @@ +{ + "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": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "ClassExpression", + "start": 4, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "T", + "variance": null + } + ] + }, + "superClass": { + "type": "Identifier", + "start": 25, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 28 + }, + "identifierName": "Bar" + }, + "name": "Bar" + }, + "superTypeParameters": { + "type": "TypeParameterInstantiation", + "start": 28, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "params": [ + { + "type": "GenericTypeAnnotation", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "T" + }, + "name": "T" + } + } + ] + }, + "body": { + "type": "ClassBody", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [] + } + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/47/expected.json b/test/fixtures/flow/type-annotations/47/expected.json index 911bf4b32b..00836457fd 100644 --- a/test/fixtures/flow/type-annotations/47/expected.json +++ b/test/fixtures/flow/type-annotations/47/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -88,8 +87,7 @@ "column": 11 } }, - "name": "T", - "variance": null + "name": "T" } ] }, diff --git a/test/fixtures/flow/type-annotations/48/expected.json b/test/fixtures/flow/type-annotations/48/expected.json index aedd16db88..e47282901d 100644 --- a/test/fixtures/flow/type-annotations/48/expected.json +++ b/test/fixtures/flow/type-annotations/48/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -88,8 +87,7 @@ "column": 11 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -105,8 +103,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "Bar" + } }, "name": "Bar" }, @@ -152,8 +149,7 @@ "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 d75e33a263..caeb365866 100644 --- a/test/fixtures/flow/type-annotations/49/expected.json +++ b/test/fixtures/flow/type-annotations/49/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -88,8 +87,7 @@ "column": 11 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -119,8 +117,7 @@ "end": { "line": 1, "column": 26 - }, - "identifierName": "mixin" + } }, "name": "mixin" }, @@ -137,8 +134,7 @@ "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 17d938d5d6..f68cf9d341 100644 --- a/test/fixtures/flow/type-annotations/5/expected.json +++ b/test/fixtures/flow/type-annotations/5/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "untypedVal" + } }, "name": "untypedVal" }, @@ -92,8 +89,7 @@ "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 2682c49d27..31174046a3 100644 --- a/test/fixtures/flow/type-annotations/50/expected.json +++ b/test/fixtures/flow/type-annotations/50/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -88,8 +87,7 @@ "column": 11 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -123,7 +121,6 @@ "column": 45 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -137,11 +134,11 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "bar" + } }, "name": "bar" }, + "static": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", @@ -172,8 +169,7 @@ "column": 20 } }, - "name": "U", - "variance": null + "name": "U" } ] }, @@ -182,7 +178,6 @@ "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 333398285e..a17c526b21 100644 --- a/test/fixtures/flow/type-annotations/51/expected.json +++ b/test/fixtures/flow/type-annotations/51/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -89,7 +88,6 @@ "column": 26 } }, - "static": false, "computed": false, "key": { "type": "StringLiteral", @@ -111,6 +109,7 @@ }, "value": "bar" }, + "static": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", @@ -141,8 +140,7 @@ "column": 19 } }, - "name": "T", - "variance": null + "name": "T" } ] }, diff --git a/test/fixtures/flow/type-annotations/52/expected.json b/test/fixtures/flow/type-annotations/52/expected.json index ccd862000e..6a7b1c6f37 100644 --- a/test/fixtures/flow/type-annotations/52/expected.json +++ b/test/fixtures/flow/type-annotations/52/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 26 - }, - "identifierName": "requiredParam" + } }, "name": "requiredParam" }, @@ -92,8 +89,7 @@ "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 c07a57c007..92988c85ef 100644 --- a/test/fixtures/flow/type-annotations/53/expected.json +++ b/test/fixtures/flow/type-annotations/53/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -89,7 +88,6 @@ "column": 25 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,12 +101,11 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "prop1" + } }, "name": "prop1" }, - "variance": null, + "static": false, "typeAnnotation": { "type": "TypeAnnotation", "start": 17, @@ -155,7 +152,6 @@ "column": 39 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -169,12 +165,11 @@ "end": { "line": 1, "column": 31 - }, - "identifierName": "prop2" + } }, "name": "prop2" }, - "variance": null, + "static": false, "typeAnnotation": { "type": "TypeAnnotation", "start": 31, @@ -210,7 +205,7 @@ ] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 4090718b15..02529f9695 100644 --- a/test/fixtures/flow/type-annotations/54/expected.json +++ b/test/fixtures/flow/type-annotations/54/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "Foo" + } }, "name": "Foo" }, @@ -89,7 +88,6 @@ "column": 32 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -103,12 +101,11 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "prop1" + } }, "name": "prop1" }, - "variance": null, + "static": true, "typeAnnotation": { "type": "TypeAnnotation", "start": 24, @@ -155,7 +152,6 @@ "column": 46 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -169,12 +165,11 @@ "end": { "line": 1, "column": 38 - }, - "identifierName": "prop2" + } }, "name": "prop2" }, - "variance": null, + "static": false, "typeAnnotation": { "type": "TypeAnnotation", "start": 38, @@ -210,7 +205,7 @@ ] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 a80a013230..5bc636b4dc 100644 --- a/test/fixtures/flow/type-annotations/55/expected.json +++ b/test/fixtures/flow/type-annotations/55/expected.json @@ -69,8 +69,7 @@ "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 e21a5ba16d..91bd2b0584 100644 --- a/test/fixtures/flow/type-annotations/56/expected.json +++ b/test/fixtures/flow/type-annotations/56/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "Array" + } }, "name": "Array" }, @@ -89,7 +88,6 @@ "column": 46 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -103,11 +101,11 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "concat" + } }, "name": "concat" }, + "static": false, "kind": "method", "id": null, "generator": false, @@ -126,8 +124,7 @@ "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 263c1d403d..b151b8b6f8 100644 --- a/test/fixtures/flow/type-annotations/57/expected.json +++ b/test/fixtures/flow/type-annotations/57/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 35 - }, - "identifierName": "x" + } }, "name": "x", "typeAnnotation": { @@ -184,8 +183,7 @@ "end": { "line": 1, "column": 40 - }, - "identifierName": "fn" + } }, "name": "fn" } @@ -193,7 +191,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 04cfd23ca8..ffcb523252 100644 --- a/test/fixtures/flow/type-annotations/58/expected.json +++ b/test/fixtures/flow/type-annotations/58/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "x" + } }, "name": "x", "typeAnnotation": { @@ -128,8 +127,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "Y" + } }, "name": "Y" } @@ -149,8 +147,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "Y" + } }, "name": "Y" } @@ -158,7 +155,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 a91682b647..d512092524 100644 --- a/test/fixtures/flow/type-annotations/59/expected.json +++ b/test/fixtures/flow/type-annotations/59/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "x" + } }, "name": "x", "typeAnnotation": { @@ -143,8 +142,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "Y" + } }, "name": "Y" } @@ -181,8 +179,7 @@ "end": { "line": 1, "column": 28 - }, - "identifierName": "Y" + } }, "name": "Y" } @@ -190,7 +187,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 9e785ac1c7..9cfdcd0139 100644 --- a/test/fixtures/flow/type-annotations/6/expected.json +++ b/test/fixtures/flow/type-annotations/6/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "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 7bcec9cc23..c7c805bc0d 100644 --- a/test/fixtures/flow/type-annotations/60/expected.json +++ b/test/fixtures/flow/type-annotations/60/expected.json @@ -101,8 +101,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,13 +117,9 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "x" + } }, "name": "x" - }, - "extra": { - "shorthand": true } } ], @@ -161,7 +156,7 @@ { "type": "ObjectTypeProperty", "start": 10, - "end": 19, + "end": 20, "loc": { "start": { "line": 1, @@ -169,7 +164,7 @@ }, "end": { "line": 1, - "column": 19 + "column": 20 } }, "key": { @@ -184,13 +179,10 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "x" + } }, "name": "x" }, - "static": false, - "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 13, @@ -206,12 +198,11 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], - "indexers": [], - "exact": false + "indexers": [] } } }, @@ -259,8 +250,7 @@ "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 d67405b5b2..5745269b9c 100644 --- a/test/fixtures/flow/type-annotations/61/expected.json +++ b/test/fixtures/flow/type-annotations/61/expected.json @@ -101,8 +101,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -118,13 +117,9 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "x" + } }, "name": "x" - }, - "extra": { - "shorthand": true } } ], @@ -184,13 +179,10 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "x" + } }, "name": "x" }, - "static": false, - "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 13, @@ -206,12 +198,11 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], - "indexers": [], - "exact": false + "indexers": [] } } }, @@ -259,8 +250,7 @@ "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 b858b1634b..7201193e8a 100644 --- a/test/fixtures/flow/type-annotations/62/expected.json +++ b/test/fixtures/flow/type-annotations/62/expected.json @@ -84,8 +84,7 @@ "end": { "line": 1, "column": 6 - }, - "identifierName": "x" + } }, "name": "x" } @@ -162,8 +161,7 @@ "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 9317604671..085e483fb1 100644 --- a/test/fixtures/flow/type-annotations/63/expected.json +++ b/test/fixtures/flow/type-annotations/63/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -107,8 +106,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -124,13 +122,9 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "x" + } }, "name": "x" - }, - "extra": { - "shorthand": true } } ], @@ -167,7 +161,7 @@ { "type": "ObjectTypeProperty", "start": 20, - "end": 29, + "end": 30, "loc": { "start": { "line": 1, @@ -175,7 +169,7 @@ }, "end": { "line": 1, - "column": 29 + "column": 30 } }, "key": { @@ -190,13 +184,10 @@ "end": { "line": 1, "column": 21 - }, - "identifierName": "x" + } }, "name": "x" }, - "static": false, - "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 23, @@ -212,12 +203,11 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], - "indexers": [], - "exact": false + "indexers": [] } } } diff --git a/test/fixtures/flow/type-annotations/64/expected.json b/test/fixtures/flow/type-annotations/64/expected.json index fe08875e33..8c9d19d6c2 100644 --- a/test/fixtures/flow/type-annotations/64/expected.json +++ b/test/fixtures/flow/type-annotations/64/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "ArrayPattern", @@ -90,8 +88,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "x" + } }, "name": "x" } @@ -168,8 +165,7 @@ "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 4b88153abb..17d3f9e5c0 100644 --- a/test/fixtures/flow/type-annotations/65/expected.json +++ b/test/fixtures/flow/type-annotations/65/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "RestElement", @@ -89,8 +87,7 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "rest" + } }, "name": "rest" }, @@ -166,8 +163,7 @@ "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 e384b2d0cd..33bccbd102 100644 --- a/test/fixtures/flow/type-annotations/66/expected.json +++ b/test/fixtures/flow/type-annotations/66/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": false, - "async": false, "params": [ { "type": "RestElement", @@ -87,8 +86,7 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "rest" + } }, "name": "rest" }, @@ -164,8 +162,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "Array" + } }, "name": "Array" } @@ -191,8 +188,7 @@ "directives": [] }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/flow/type-annotations/67/expected.json b/test/fixtures/flow/type-annotations/67/expected.json index 5d9f3d2448..29c7ecb1b2 100644 --- a/test/fixtures/flow/type-annotations/67/expected.json +++ b/test/fixtures/flow/type-annotations/67/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -88,7 +87,6 @@ "column": 27 } }, - "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 12, @@ -122,7 +120,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [], "body": { "type": "Identifier", @@ -136,8 +133,7 @@ "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 68c74a61bf..433bc78a8f 100644 --- a/test/fixtures/flow/type-annotations/68/expected.json +++ b/test/fixtures/flow/type-annotations/68/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -88,41 +87,9 @@ "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", @@ -136,8 +103,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "bar" + } }, "name": "bar" } @@ -154,10 +120,39 @@ "end": { "line": 1, "column": 30 - }, - "identifierName": "bar" + } }, "name": "bar" + }, + "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 + } + } + } } } } diff --git a/test/fixtures/flow/type-annotations/69/expected.json b/test/fixtures/flow/type-annotations/69/expected.json index 9a862eea68..81386821a4 100644 --- a/test/fixtures/flow/type-annotations/69/expected.json +++ b/test/fixtures/flow/type-annotations/69/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -105,8 +104,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "foo" + } }, "name": "foo", "typeAnnotation": { @@ -150,8 +148,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "bar" + } }, "name": "bar" } @@ -170,8 +167,7 @@ "end": { "line": 1, "column": 35 - }, - "identifierName": "bar" + } }, "name": "bar", "typeAnnotation": { @@ -215,8 +211,7 @@ "end": { "line": 1, "column": 35 - }, - "identifierName": "foo" + } }, "name": "foo" } @@ -249,4 +244,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 3233cf98e6..6a7ceea68d 100644 --- a/test/fixtures/flow/type-annotations/7/expected.json +++ b/test/fixtures/flow/type-annotations/7/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "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 349a54e218..9efcc0ee81 100644 --- a/test/fixtures/flow/type-annotations/70/expected.json +++ b/test/fixtures/flow/type-annotations/70/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -135,8 +134,7 @@ "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 635549a0b6..cdb81eb204 100644 --- a/test/fixtures/flow/type-annotations/71/expected.json +++ b/test/fixtures/flow/type-annotations/71/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -135,8 +134,7 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "bar" + } }, "name": "bar" } @@ -153,8 +151,7 @@ "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 c43076a1e5..f6ceb4484c 100644 --- a/test/fixtures/flow/type-annotations/72/expected.json +++ b/test/fixtures/flow/type-annotations/72/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -88,7 +87,6 @@ "column": 28 } }, - "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 13, @@ -122,7 +120,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [], "body": { "type": "Identifier", @@ -136,14 +133,12 @@ "end": { "line": 1, "column": 28 - }, - "identifierName": "bar" + } }, "name": "bar" }, "extra": { - "parenthesized": true, - "parenStart": 10 + "parenthesized": true } } } diff --git a/test/fixtures/flow/type-annotations/73/expected.json b/test/fixtures/flow/type-annotations/73/expected.json index 84c65077ec..3b2f689738 100644 --- a/test/fixtures/flow/type-annotations/73/expected.json +++ b/test/fixtures/flow/type-annotations/73/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -88,41 +87,9 @@ "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", @@ -136,8 +103,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "bar" + } }, "name": "bar" } @@ -154,14 +120,42 @@ "end": { "line": 1, "column": 31 - }, - "identifierName": "bar" + } }, "name": "bar" }, + "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 + } + } + } + }, "extra": { - "parenthesized": true, - "parenStart": 10 + "parenthesized": true } } } diff --git a/test/fixtures/flow/type-annotations/74/expected.json b/test/fixtures/flow/type-annotations/74/expected.json index a3fcb6dbeb..2abdde67da 100644 --- a/test/fixtures/flow/type-annotations/74/expected.json +++ b/test/fixtures/flow/type-annotations/74/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -102,41 +101,9 @@ "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", @@ -150,8 +117,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "bar" + } }, "name": "bar" } @@ -168,14 +134,42 @@ "end": { "line": 1, "column": 32 - }, - "identifierName": "bar" + } }, "name": "bar" }, + "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 + } + } + } + }, "extra": { - "parenthesized": true, - "parenStart": 11 + "parenthesized": true } }, "typeAnnotation": { @@ -209,8 +203,7 @@ } }, "extra": { - "parenthesized": true, - "parenStart": 10 + "parenthesized": true } } } diff --git a/test/fixtures/flow/type-annotations/75/expected.json b/test/fixtures/flow/type-annotations/75/expected.json index 7c9d750b34..cf53aaad99 100644 --- a/test/fixtures/flow/type-annotations/75/expected.json +++ b/test/fixtures/flow/type-annotations/75/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -135,8 +134,7 @@ "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 0da85e881f..2201b81b00 100644 --- a/test/fixtures/flow/type-annotations/76/expected.json +++ b/test/fixtures/flow/type-annotations/76/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -135,8 +134,7 @@ "end": { "line": 1, "column": 21 - }, - "identifierName": "bar" + } }, "name": "bar" } @@ -153,8 +151,7 @@ "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 04a3bb7902..43b02e527c 100644 --- a/test/fixtures/flow/type-annotations/77/expected.json +++ b/test/fixtures/flow/type-annotations/77/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -149,8 +148,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "bar" + } }, "name": "bar" } @@ -167,8 +165,7 @@ "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 53f958f35d..eec39a30b0 100644 --- a/test/fixtures/flow/type-annotations/78/expected.json +++ b/test/fixtures/flow/type-annotations/78/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -117,13 +115,11 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "foo" + } }, "name": "foo", "extra": { - "parenthesized": true, - "parenStart": 16 + "parenthesized": true } }, "alternate": { @@ -138,8 +134,7 @@ "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 eac4bddf31..fe1dab6354 100644 --- a/test/fixtures/flow/type-annotations/79/expected.json +++ b/test/fixtures/flow/type-annotations/79/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -100,8 +99,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -119,41 +117,9 @@ "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", @@ -167,8 +133,7 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "foo" + } }, "name": "foo" } @@ -189,6 +154,36 @@ }, "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": { @@ -203,8 +198,7 @@ "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 2d082a8233..55750a0092 100644 --- a/test/fixtures/flow/type-annotations/8/expected.json +++ b/test/fixtures/flow/type-annotations/8/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "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 a86ca15185..5df2f5ec56 100644 --- a/test/fixtures/flow/type-annotations/80/expected.json +++ b/test/fixtures/flow/type-annotations/80/expected.json @@ -59,7 +59,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "RestElement", @@ -87,8 +86,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "rest" + } }, "name": "rest" }, @@ -164,8 +162,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "Array" + } }, "name": "Array" } @@ -185,18 +182,16 @@ "end": { "line": 1, "column": 33 - }, - "identifierName": "rest" + } }, "name": "rest" }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } ], "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 1dcedf1a3e..3c84d22193 100644 --- a/test/fixtures/flow/type-annotations/81/expected.json +++ b/test/fixtures/flow/type-annotations/81/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 34 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -189,8 +188,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "Array" + } }, "name": "Array" } @@ -209,8 +207,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "Map" + } }, "name": "Map" } @@ -222,7 +219,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 9ddf85cb5a..f7e3aa404c 100644 --- a/test/fixtures/flow/type-annotations/82/expected.json +++ b/test/fixtures/flow/type-annotations/82/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 33 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -189,8 +188,7 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "Array" + } }, "name": "Array" } @@ -209,8 +207,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "Map" + } }, "name": "Map" } @@ -222,7 +219,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 4a628f8b88..ec761b745f 100644 --- a/test/fixtures/flow/type-annotations/83/expected.json +++ b/test/fixtures/flow/type-annotations/83/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -124,7 +123,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 cc9842db23..72f1dcf9d6 100644 --- a/test/fixtures/flow/type-annotations/84/expected.json +++ b/test/fixtures/flow/type-annotations/84/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -139,7 +138,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 82341068bc..2ec29ac271 100644 --- a/test/fixtures/flow/type-annotations/85/expected.json +++ b/test/fixtures/flow/type-annotations/85/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -159,8 +158,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "Promise" + } }, "name": "Promise" } @@ -173,7 +171,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 63ccb81eb2..910267d15d 100644 --- a/test/fixtures/flow/type-annotations/86/expected.json +++ b/test/fixtures/flow/type-annotations/86/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 39 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -128,8 +127,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "rest" + } }, "name": "rest" }, @@ -192,8 +190,7 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "Array" + } }, "name": "Array" } @@ -223,7 +220,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 d6b70d48e8..fcb3f099e8 100644 --- a/test/fixtures/flow/type-annotations/87/expected.json +++ b/test/fixtures/flow/type-annotations/87/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 28 - }, - "identifierName": "identity" + } }, "name": "identity", "typeAnnotation": { @@ -130,8 +129,7 @@ "column": 16 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -162,8 +160,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -195,8 +192,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "T" + } }, "name": "T" } @@ -231,8 +227,7 @@ "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 e7495a1ba3..703ae28f97 100644 --- a/test/fixtures/flow/type-annotations/88/expected.json +++ b/test/fixtures/flow/type-annotations/88/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 38 - }, - "identifierName": "identity" + } }, "name": "identity", "typeAnnotation": { @@ -130,8 +129,7 @@ "column": 16 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -162,8 +160,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -195,8 +192,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "T" + } }, "name": "T" } @@ -229,8 +225,7 @@ "end": { "line": 1, "column": 28 - }, - "identifierName": "y" + } }, "name": "y" }, @@ -276,8 +271,7 @@ "end": { "line": 1, "column": 30 - }, - "identifierName": "T" + } }, "name": "T" } @@ -311,8 +305,7 @@ "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 8e0461be54..fafb7c0a97 100644 --- a/test/fixtures/flow/type-annotations/89/expected.json +++ b/test/fixtures/flow/type-annotations/89/expected.json @@ -69,8 +69,7 @@ "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 a966a64756..d2393788e5 100644 --- a/test/fixtures/flow/type-annotations/9/expected.json +++ b/test/fixtures/flow/type-annotations/9/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "foo" + } }, "name": "foo" }, "generator": false, "expression": false, - "async": false, "params": [ { "type": "Identifier", @@ -75,8 +73,7 @@ "end": { "line": 1, "column": 41 - }, - "identifierName": "callback" + } }, "name": "callback", "typeAnnotation": { @@ -134,8 +131,7 @@ "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 d098b0cce8..d18d05b185 100644 --- a/test/fixtures/flow/type-annotations/90/expected.json +++ b/test/fixtures/flow/type-annotations/90/expected.json @@ -69,8 +69,7 @@ "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 d92c31cc91..508d8b7fd6 100644 --- a/test/fixtures/flow/type-annotations/91/expected.json +++ b/test/fixtures/flow/type-annotations/91/expected.json @@ -69,12 +69,10 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "foo" + } }, "name": "foo" }, - "importKind": null, "local": { "type": "Identifier", "start": 13, @@ -87,8 +85,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "foo" + } }, "name": "foo" } @@ -119,12 +116,10 @@ "end": { "line": 1, "column": 21 - }, - "identifierName": "bar" + } }, "name": "bar" }, - "importKind": null, "local": { "type": "Identifier", "start": 18, @@ -137,8 +132,7 @@ "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 f655b4ac19..3bf07813d5 100644 --- a/test/fixtures/flow/type-annotations/92/expected.json +++ b/test/fixtures/flow/type-annotations/92/expected.json @@ -69,12 +69,10 @@ "end": { "line": 1, "column": 18 - }, - "identifierName": "foo" + } }, "name": "foo" }, - "importKind": null, "local": { "type": "Identifier", "start": 22, @@ -87,8 +85,7 @@ "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 f28a6ae4c4..588d644b5a 100644 --- a/test/fixtures/flow/type-annotations/93/expected.json +++ b/test/fixtures/flow/type-annotations/93/expected.json @@ -69,8 +69,7 @@ "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 75eb3f453a..71f88f5ecd 100644 --- a/test/fixtures/flow/type-annotations/94/expected.json +++ b/test/fixtures/flow/type-annotations/94/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 11 - }, - "identifierName": "type" + } }, "name": "type" } @@ -101,12 +100,10 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "foo" + } }, "name": "foo" }, - "importKind": null, "local": { "type": "Identifier", "start": 14, @@ -119,8 +116,7 @@ "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 ba8c5759bb..d90a424b63 100644 --- a/test/fixtures/flow/type-annotations/95/expected.json +++ b/test/fixtures/flow/type-annotations/95/expected.json @@ -69,8 +69,7 @@ "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 b102606c92..11ed46da39 100644 --- a/test/fixtures/flow/type-annotations/96/expected.json +++ b/test/fixtures/flow/type-annotations/96/expected.json @@ -69,8 +69,7 @@ "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 6021547089..4b3c3b2da9 100644 --- a/test/fixtures/flow/type-annotations/97/expected.json +++ b/test/fixtures/flow/type-annotations/97/expected.json @@ -86,8 +86,7 @@ "end": { "line": 1, "column": 3 - }, - "identifierName": "f" + } }, "name": "f" }, @@ -138,8 +137,7 @@ "column": 16 } }, - "name": "T", - "variance": null + "name": "T" } ] }, diff --git a/test/fixtures/flow/type-annotations/98/expected.json b/test/fixtures/flow/type-annotations/98/expected.json index 0b51971251..953654304c 100644 --- a/test/fixtures/flow/type-annotations/98/expected.json +++ b/test/fixtures/flow/type-annotations/98/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 57 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -106,7 +105,7 @@ { "type": "ObjectTypeProperty", "start": 8, - "end": 23, + "end": 24, "loc": { "start": { "line": 1, @@ -114,7 +113,7 @@ }, "end": { "line": 1, - "column": 23 + "column": 24 } }, "key": { @@ -129,13 +128,10 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "param1" + } }, "name": "param1" }, - "static": false, - "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 17, @@ -151,13 +147,13 @@ } } }, - "variance": null, - "optional": true + "optional": true, + "variance": null }, { "type": "ObjectTypeProperty", "start": 25, - "end": 39, + "end": 40, "loc": { "start": { "line": 1, @@ -165,7 +161,7 @@ }, "end": { "line": 1, - "column": 39 + "column": 40 } }, "key": { @@ -180,13 +176,10 @@ "end": { "line": 1, "column": 31 - }, - "identifierName": "param2" + } }, "name": "param2" }, - "static": false, - "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 33, @@ -202,13 +195,13 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null }, { "type": "ObjectTypeProperty", "start": 41, - "end": 55, + "end": 56, "loc": { "start": { "line": 1, @@ -216,7 +209,7 @@ }, "end": { "line": 1, - "column": 55 + "column": 56 } }, "key": { @@ -231,13 +224,10 @@ "end": { "line": 1, "column": 47 - }, - "identifierName": "param3" + } }, "name": "param3" }, - "static": false, - "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 49, @@ -253,12 +243,11 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], - "indexers": [], - "exact": false + "indexers": [] } } }, @@ -267,7 +256,7 @@ ], "kind": "var" } - ], - "directives": [] - } -} \ No newline at end of file + ] + }, + "comments": [] +} diff --git a/test/fixtures/flow/type-annotations/99/expected.json b/test/fixtures/flow/type-annotations/99/expected.json index ed05f4b8f0..1c35c17698 100644 --- a/test/fixtures/flow/type-annotations/99/expected.json +++ b/test/fixtures/flow/type-annotations/99/expected.json @@ -56,55 +56,6 @@ "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, @@ -122,8 +73,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -139,8 +89,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "bar" + } }, "name": "bar" } @@ -159,10 +108,58 @@ "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": [] - } -} \ No newline at end of file + }, + "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 10e6b1850a..cf9973aad7 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,7 +88,6 @@ "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 c60b595377..8c51c73f05 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": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "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 35d26afbfb..12bf9c1462 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,8 +69,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "f" + } }, "name": "f", "typeAnnotation": { @@ -88,7 +87,7 @@ } }, "typeAnnotation": { - "type": "ExistsTypeAnnotation", + "type": "ExistentialTypeParam", "start": 8, "end": 9, "loc": { @@ -118,7 +117,6 @@ "column": 38 } }, - "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 27, @@ -134,7 +132,7 @@ } }, "typeAnnotation": { - "type": "ExistsTypeAnnotation", + "type": "ExistentialTypeParam", "start": 30, "end": 31, "loc": { @@ -166,8 +164,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "x" + } }, "name": "x", "typeAnnotation": { @@ -216,7 +213,7 @@ "value": true }, { - "type": "ExistsTypeAnnotation", + "type": "ExistentialTypeParam", "start": 24, "end": 25, "loc": { @@ -260,4 +257,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 af0ae0e2bd..d9e6a9657d 100644 --- a/test/fixtures/flow/type-annotations/existential-type-param/expected.json +++ b/test/fixtures/flow/type-annotations/existential-type-param/expected.json @@ -54,8 +54,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "Maybe" + } }, "name": "Maybe" }, @@ -88,8 +87,7 @@ "column": 12 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -149,14 +147,13 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "T" + } }, "name": "T" } }, { - "type": "ExistsTypeAnnotation", + "type": "ExistentialTypeParam", "start": 26, "end": 27, "loc": { @@ -184,8 +181,7 @@ "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 e3fe56e9dc..21f2b225e8 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": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "start": 45, "end": 47, "loc": { @@ -89,14 +89,14 @@ "column": 6 } }, + "value": -1, "extra": { "rawValue": -1, "raw": "-1" - }, - "value": -1 + } }, { - "type": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "start": 52, "end": 53, "loc": { @@ -109,14 +109,14 @@ "column": 5 } }, + "value": 0, "extra": { "rawValue": 0, "raw": "0" - }, - "value": 0 + } }, { - "type": "NumberLiteralTypeAnnotation", + "type": "NumericLiteralTypeAnnotation", "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 cf8a9daf6e..7387d671c4 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,8 +71,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -94,7 +93,6 @@ } } } - ], - "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 f835d903ed..ee9953051b 100644 --- a/test/fixtures/flow/type-exports/interface/expected.json +++ b/test/fixtures/flow/type-exports/interface/expected.json @@ -71,8 +71,7 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -121,13 +120,10 @@ "end": { "line": 1, "column": 24 - }, - "identifierName": "p" + } }, "name": "p" }, - "static": false, - "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 26, @@ -143,12 +139,11 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], - "indexers": [], - "exact": false + "indexers": [] } } }, @@ -210,8 +205,7 @@ "end": { "line": 2, "column": 20 - }, - "identifierName": "bar" + } }, "name": "bar" }, @@ -244,8 +238,7 @@ "column": 22 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -293,13 +286,10 @@ "end": { "line": 2, "column": 27 - }, - "identifierName": "p" + } }, "name": "p" }, - "static": false, - "kind": "init", "value": { "type": "GenericTypeAnnotation", "start": 65, @@ -327,18 +317,16 @@ "end": { "line": 2, "column": 30 - }, - "identifierName": "T" + } }, "name": "T" } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], - "indexers": [], - "exact": false + "indexers": [] } } }, @@ -360,4 +348,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 79e5af591c..583326b8a1 100644 --- a/test/fixtures/flow/type-exports/specifier-from/expected.json +++ b/test/fixtures/flow/type-exports/specifier-from/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -86,8 +85,7 @@ "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 7715724c0d..37900069e8 100644 --- a/test/fixtures/flow/type-exports/specifier/expected.json +++ b/test/fixtures/flow/type-exports/specifier/expected.json @@ -42,6 +42,7 @@ "column": 20 } }, + "exportKind": "type", "specifiers": [ { "type": "ExportSpecifier", @@ -69,8 +70,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "foo" + } }, "name": "foo" }, @@ -86,18 +86,15 @@ "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 deleted file mode 100644 index f27ba81379..0000000000 --- a/test/fixtures/flow/type-generics/1/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 40dcb01fe0..0000000000 --- a/test/fixtures/flow/type-generics/1/expected.json +++ /dev/null @@ -1,346 +0,0 @@ -{ - "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 deleted file mode 100644 index e3a4739249..0000000000 --- a/test/fixtures/flow/type-generics/2/actual.js +++ /dev/null @@ -1,2 +0,0 @@ -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 deleted file mode 100644 index 07043bb8c9..0000000000 --- a/test/fixtures/flow/type-generics/2/expected.json +++ /dev/null @@ -1,340 +0,0 @@ -{ - "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 b88c7b544c..7b9b6309f8 100644 --- a/test/fixtures/flow/type-grouping/1/expected.json +++ b/test/fixtures/flow/type-grouping/1/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -109,7 +108,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 9e84a8c5c1..60fb976af8 100644 --- a/test/fixtures/flow/type-grouping/2/expected.json +++ b/test/fixtures/flow/type-grouping/2/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 36 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -177,7 +176,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 fe1a494b08..a51a1dce92 100644 --- a/test/fixtures/flow/type-grouping/3/expected.json +++ b/test/fixtures/flow/type-grouping/3/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 31 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -173,7 +172,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 817a0c95f3..3a2c2d5359 100644 --- a/test/fixtures/flow/type-grouping/4/expected.json +++ b/test/fixtures/flow/type-grouping/4/expected.json @@ -69,8 +69,7 @@ "end": { "line": 1, "column": 17 - }, - "identifierName": "a" + } }, "name": "a", "typeAnnotation": { @@ -128,8 +127,7 @@ "end": { "line": 1, "column": 16 - }, - "identifierName": "A" + } }, "name": "A" } @@ -142,7 +140,7 @@ ], "kind": "var" } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 6c0fc4995b..7b3d80f439 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 af41bafe4d..2b23f221b3 100644 --- a/test/fixtures/flow/type-imports/import-type/expected.json +++ b/test/fixtures/flow/type-imports/import-type/expected.json @@ -144,7 +144,6 @@ }, "name": "named" }, - "importKind": null, "local": { "type": "Identifier", "start": 39, @@ -264,7 +263,6 @@ }, "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 357be6ee1e..5040de57dc 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,8 +110,7 @@ "column": 2 } }, - "name": "T", - "variance": null + "name": "T" } ] } @@ -162,8 +161,7 @@ "end": { "line": 2, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" } @@ -217,8 +215,7 @@ "column": 2 } }, - "name": "T", - "variance": null + "name": "T" } ] } @@ -269,8 +266,7 @@ "end": { "line": 3, "column": 13 - }, - "identifierName": "x" + } }, "name": "x", "typeAnnotation": { @@ -354,8 +350,7 @@ "column": 2 } }, - "name": "T", - "variance": null + "name": "T" } ] } @@ -406,8 +401,7 @@ "end": { "line": 4, "column": 13 - }, - "identifierName": "x" + } }, "name": "x", "typeAnnotation": { @@ -524,8 +518,7 @@ "column": 2 } }, - "name": "T", - "variance": null + "name": "T" } ] } @@ -534,4 +527,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 357be6ee1e..5040de57dc 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,8 +110,7 @@ "column": 2 } }, - "name": "T", - "variance": null + "name": "T" } ] } @@ -162,8 +161,7 @@ "end": { "line": 2, "column": 5 - }, - "identifierName": "x" + } }, "name": "x" } @@ -217,8 +215,7 @@ "column": 2 } }, - "name": "T", - "variance": null + "name": "T" } ] } @@ -269,8 +266,7 @@ "end": { "line": 3, "column": 13 - }, - "identifierName": "x" + } }, "name": "x", "typeAnnotation": { @@ -354,8 +350,7 @@ "column": 2 } }, - "name": "T", - "variance": null + "name": "T" } ] } @@ -406,8 +401,7 @@ "end": { "line": 4, "column": 13 - }, - "identifierName": "x" + } }, "name": "x", "typeAnnotation": { @@ -524,8 +518,7 @@ "column": 2 } }, - "name": "T", - "variance": null + "name": "T" } ] } @@ -534,4 +527,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 a836b16d41..6e0dc70ef3 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,7 +89,6 @@ "column": 16 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -108,6 +107,7 @@ }, "name": "foobar" }, + "static": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", @@ -138,8 +138,7 @@ "column": 10 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -180,7 +179,6 @@ "column": 16 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -199,6 +197,7 @@ }, "name": "delete" }, + "static": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", @@ -229,8 +228,7 @@ "column": 10 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -271,7 +269,6 @@ "column": 15 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -290,6 +287,7 @@ }, "name": "yield" }, + "static": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", @@ -320,8 +318,7 @@ "column": 9 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -362,7 +359,6 @@ "column": 12 } }, - "static": false, "computed": false, "key": { "type": "Identifier", @@ -381,6 +377,7 @@ }, "name": "do" }, + "static": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", @@ -411,8 +408,7 @@ "column": 6 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -453,7 +449,6 @@ "column": 23 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -472,6 +467,7 @@ }, "name": "foobar" }, + "static": true, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", @@ -502,8 +498,7 @@ "column": 17 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -544,7 +539,6 @@ "column": 23 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -563,6 +557,7 @@ }, "name": "delete" }, + "static": true, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", @@ -593,8 +588,7 @@ "column": 17 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -635,7 +629,6 @@ "column": 22 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -654,6 +647,7 @@ }, "name": "yield" }, + "static": true, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", @@ -684,8 +678,7 @@ "column": 16 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -726,7 +719,6 @@ "column": 19 } }, - "static": true, "computed": false, "key": { "type": "Identifier", @@ -745,6 +737,7 @@ }, "name": "do" }, + "static": true, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", @@ -775,8 +768,7 @@ "column": 13 } }, - "name": "T", - "variance": null + "name": "T" } ] }, 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 c70f16d94e..9c4ed2864e 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": 37, + "end": 38, "loc": { "start": { "line": 2, @@ -89,28 +89,9 @@ }, "end": { "line": 2, - "column": 19 + "column": 20 } }, - "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, @@ -156,8 +137,7 @@ "column": 10 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -177,12 +157,30 @@ } } }, + "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": 58, + "end": 59, "loc": { "start": { "line": 3, @@ -190,28 +188,9 @@ }, "end": { "line": 3, - "column": 19 + "column": 20 } }, - "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, @@ -257,8 +236,7 @@ "column": 10 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -278,12 +256,30 @@ } } }, + "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": 78, + "end": 79, "loc": { "start": { "line": 4, @@ -291,28 +287,9 @@ }, "end": { "line": 4, - "column": 18 + "column": 19 } }, - "key": { - "type": "Identifier", - "start": 62, - "end": 67, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "yield" - }, - "name": "yield" - }, - "static": false, - "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 62, @@ -358,8 +335,7 @@ "column": 9 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -379,12 +355,30 @@ } } }, + "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": 95, + "end": 96, "loc": { "start": { "line": 5, @@ -392,28 +386,9 @@ }, "end": { "line": 5, - "column": 15 + "column": 16 } }, - "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, @@ -459,8 +434,7 @@ "column": 6 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -480,12 +454,30 @@ } } }, + "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": 123, + "end": 124, "loc": { "start": { "line": 6, @@ -493,28 +485,9 @@ }, "end": { "line": 6, - "column": 26 + "column": 27 } }, - "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, @@ -560,8 +533,7 @@ "column": 17 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -581,12 +553,30 @@ } } }, + "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": 151, + "end": 152, "loc": { "start": { "line": 7, @@ -594,28 +584,9 @@ }, "end": { "line": 7, - "column": 26 + "column": 27 } }, - "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, @@ -661,8 +632,7 @@ "column": 17 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -682,12 +652,30 @@ } } }, + "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": 178, + "end": 179, "loc": { "start": { "line": 8, @@ -695,28 +683,9 @@ }, "end": { "line": 8, - "column": 25 + "column": 26 } }, - "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, @@ -762,8 +731,7 @@ "column": 16 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -783,12 +751,30 @@ } } }, + "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": 202, + "end": 203, "loc": { "start": { "line": 9, @@ -796,28 +782,9 @@ }, "end": { "line": 9, - "column": 22 + "column": 23 } }, - "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, @@ -863,8 +830,7 @@ "column": 13 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -884,6 +850,24 @@ } } }, + "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 1bc3f578c1..7fe3231b43 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": 41, + "end": 42, "loc": { "start": { "line": 2, @@ -89,28 +89,9 @@ }, "end": { "line": 2, - "column": 19 + "column": 20 } }, - "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, @@ -156,8 +137,7 @@ "column": 10 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -177,12 +157,30 @@ } } }, + "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": 62, + "end": 63, "loc": { "start": { "line": 3, @@ -190,28 +188,9 @@ }, "end": { "line": 3, - "column": 19 + "column": 20 } }, - "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, @@ -257,8 +236,7 @@ "column": 10 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -278,12 +256,30 @@ } } }, + "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": 82, + "end": 83, "loc": { "start": { "line": 4, @@ -291,28 +287,9 @@ }, "end": { "line": 4, - "column": 18 + "column": 19 } }, - "key": { - "type": "Identifier", - "start": 66, - "end": 71, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "yield" - }, - "name": "yield" - }, - "static": false, - "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 66, @@ -358,8 +335,7 @@ "column": 9 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -379,12 +355,30 @@ } } }, + "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": 99, + "end": 100, "loc": { "start": { "line": 5, @@ -392,28 +386,9 @@ }, "end": { "line": 5, - "column": 15 + "column": 16 } }, - "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, @@ -459,8 +434,7 @@ "column": 6 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -480,6 +454,24 @@ } } }, + "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 56cf6e37d7..65e1d32891 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": "ExistsTypeAnnotation", + "type": "ExistentialTypeParam", "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 new file mode 100644 index 0000000000..65e1d32891 --- /dev/null +++ b/test/fixtures/flow/type-parameter-declaration/default/expected.lightscript.json @@ -0,0 +1,3329 @@ +{ + "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 42e5d3ce8b..f0c82175f1 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": 33, + "end": 34, "loc": { "start": { "line": 2, @@ -89,28 +89,9 @@ }, "end": { "line": 2, - "column": 19 + "column": 20 } }, - "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, @@ -156,8 +137,7 @@ "column": 10 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -177,12 +157,30 @@ } } }, + "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": 54, + "end": 55, "loc": { "start": { "line": 3, @@ -190,28 +188,9 @@ }, "end": { "line": 3, - "column": 19 + "column": 20 } }, - "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, @@ -257,8 +236,7 @@ "column": 10 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -278,12 +256,30 @@ } } }, + "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": 74, + "end": 75, "loc": { "start": { "line": 4, @@ -291,28 +287,9 @@ }, "end": { "line": 4, - "column": 18 + "column": 19 } }, - "key": { - "type": "Identifier", - "start": 58, - "end": 63, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "yield" - }, - "name": "yield" - }, - "static": false, - "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 58, @@ -358,8 +335,7 @@ "column": 9 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -379,12 +355,30 @@ } } }, + "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": 91, + "end": 92, "loc": { "start": { "line": 5, @@ -392,28 +386,9 @@ }, "end": { "line": 5, - "column": 15 + "column": 16 } }, - "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, @@ -459,8 +434,7 @@ "column": 6 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -480,6 +454,24 @@ } } }, + "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 07d8e1ebe8..801f8ff09c 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,8 +258,7 @@ "column": 10 } }, - "name": "T", - "variance": null + "name": "T" } ] } 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 c89615b382..f57adb86f2 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,8 +175,7 @@ "column": 10 } }, - "name": "T", - "variance": null + "name": "T" } ] } @@ -267,8 +266,7 @@ "column": 10 } }, - "name": "T", - "variance": null + "name": "T" } ] } @@ -359,8 +357,7 @@ "column": 9 } }, - "name": "T", - "variance": null + "name": "T" } ] } @@ -451,8 +448,7 @@ "column": 6 } }, - "name": "T", - "variance": null + "name": "T" } ] } 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 5847ba7708..2d85dca630 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": 30, + "end": 31, "loc": { "start": { "line": 2, @@ -87,28 +87,9 @@ }, "end": { "line": 2, - "column": 19 + "column": 20 } }, - "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, @@ -154,8 +135,7 @@ "column": 10 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -175,12 +155,30 @@ } } }, + "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": 51, + "end": 52, "loc": { "start": { "line": 3, @@ -188,28 +186,9 @@ }, "end": { "line": 3, - "column": 19 + "column": 20 } }, - "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, @@ -255,8 +234,7 @@ "column": 10 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -276,12 +254,30 @@ } } }, + "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": 71, + "end": 72, "loc": { "start": { "line": 4, @@ -289,28 +285,9 @@ }, "end": { "line": 4, - "column": 18 + "column": 19 } }, - "key": { - "type": "Identifier", - "start": 55, - "end": 60, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "yield" - }, - "name": "yield" - }, - "static": false, - "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 55, @@ -356,8 +333,7 @@ "column": 9 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -377,12 +353,30 @@ } } }, + "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": 88, + "end": 89, "loc": { "start": { "line": 5, @@ -390,28 +384,9 @@ }, "end": { "line": 5, - "column": 15 + "column": 16 } }, - "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, @@ -457,8 +432,7 @@ "column": 6 } }, - "name": "T", - "variance": null + "name": "T" } ] }, @@ -478,6 +452,24 @@ } } }, + "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 a73129c312..87ffc46fab 100644 --- a/test/fixtures/flow/typecasts/1/expected.json +++ b/test/fixtures/flow/typecasts/1/expected.json @@ -68,8 +68,7 @@ "end": { "line": 1, "column": 4 - }, - "identifierName": "xxx" + } }, "name": "xxx" }, @@ -104,8 +103,7 @@ } }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/flow/typecasts/2/expected.json b/test/fixtures/flow/typecasts/2/expected.json index e41a4f7b34..7f2c10a412 100644 --- a/test/fixtures/flow/typecasts/2/expected.json +++ b/test/fixtures/flow/typecasts/2/expected.json @@ -100,8 +100,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "xxx" + } }, "name": "xxx" }, @@ -155,8 +154,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "yyy" + } }, "name": "yyy" }, @@ -216,7 +214,7 @@ { "type": "ObjectTypeProperty", "start": 24, - "end": 35, + "end": 36, "loc": { "start": { "line": 1, @@ -224,7 +222,7 @@ }, "end": { "line": 1, - "column": 35 + "column": 36 } }, "key": { @@ -239,13 +237,10 @@ "end": { "line": 1, "column": 27 - }, - "identifierName": "xxx" + } }, "name": "xxx" }, - "static": false, - "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 29, @@ -261,8 +256,8 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null }, { "type": "ObjectTypeProperty", @@ -290,13 +285,10 @@ "end": { "line": 1, "column": 40 - }, - "identifierName": "yyy" + } }, "name": "yyy" }, - "static": false, - "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 42, @@ -312,17 +304,15 @@ } } }, - "variance": null, - "optional": false + "optional": false, + "variance": null } ], - "indexers": [], - "exact": false + "indexers": [] } }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/flow/typecasts/3/expected.json b/test/fixtures/flow/typecasts/3/expected.json index b47396af29..ff1d6fa436 100644 --- a/test/fixtures/flow/typecasts/3/expected.json +++ b/test/fixtures/flow/typecasts/3/expected.json @@ -73,7 +73,6 @@ "id": null, "generator": false, "expression": true, - "async": false, "params": [ { "type": "Identifier", @@ -87,8 +86,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "xxx" + } }, "name": "xxx" } @@ -119,8 +117,7 @@ "end": { "line": 1, "column": 13 - }, - "identifierName": "xxx" + } }, "name": "xxx" }, @@ -202,8 +199,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "xxx" + } }, "name": "xxx" }, @@ -245,8 +241,7 @@ } }, "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/flow/typecasts/4/expected.json b/test/fixtures/flow/typecasts/4/expected.json index 9253542842..3fab1290ea 100644 --- a/test/fixtures/flow/typecasts/4/expected.json +++ b/test/fixtures/flow/typecasts/4/expected.json @@ -83,8 +83,7 @@ "end": { "line": 1, "column": 5 - }, - "identifierName": "xxx" + } }, "name": "xxx" }, @@ -119,8 +118,7 @@ } }, "extra": { - "parenthesized": true, - "parenStart": 1 + "parenthesized": true } }, { @@ -149,8 +147,7 @@ "end": { "line": 1, "column": 20 - }, - "identifierName": "yyy" + } }, "name": "yyy" }, @@ -185,14 +182,12 @@ } }, "extra": { - "parenthesized": true, - "parenStart": 16 + "parenthesized": true } } ], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } } } diff --git a/test/fixtures/jsx/basic/1/expected.json b/test/fixtures/jsx/basic/1/expected.json index 74febd56c0..cc297bc62f 100644 --- a/test/fixtures/jsx/basic/1/expected.json +++ b/test/fixtures/jsx/basic/1/expected.json @@ -93,7 +93,7 @@ "children": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 04d9debf7f..28fdb031d2 100644 --- a/test/fixtures/jsx/basic/11/expected.json +++ b/test/fixtures/jsx/basic/11/expected.json @@ -135,10 +135,7 @@ "column": 18 } }, - "extra": { - "rawValue": "@test content", - "raw": "@test content" - }, + "extra": null, "value": "@test content" } ] diff --git a/test/fixtures/jsx/basic/12/expected.json b/test/fixtures/jsx/basic/12/expected.json index 3dfab62bd7..6fd2dafebd 100644 --- a/test/fixtures/jsx/basic/12/expected.json +++ b/test/fixtures/jsx/basic/12/expected.json @@ -185,10 +185,7 @@ "column": 35 } }, - "extra": { - "rawValue": "7x invalid-js-identifier", - "raw": "7x invalid-js-identifier" - }, + "extra": null, "value": "7x invalid-js-identifier" } ] diff --git a/test/fixtures/jsx/basic/13/expected.json b/test/fixtures/jsx/basic/13/expected.json index 63dd742439..33e3801372 100644 --- a/test/fixtures/jsx/basic/13/expected.json +++ b/test/fixtures/jsx/basic/13/expected.json @@ -149,7 +149,8 @@ "selfClosing": true }, "closingElement": null, - "children": [] + "children": [], + "extra": null } }, { @@ -275,13 +276,11 @@ "column": 50 } }, - "extra": { - "rawValue": "monkeys /> gorillas", - "raw": "monkeys /> gorillas" - }, + "extra": null, "value": "monkeys /> gorillas" } - ] + ], + "extra": null } } ], diff --git a/test/fixtures/jsx/basic/14/expected.json b/test/fixtures/jsx/basic/14/expected.json index 397403e48f..283763cbac 100644 --- a/test/fixtures/jsx/basic/14/expected.json +++ b/test/fixtures/jsx/basic/14/expected.json @@ -185,7 +185,7 @@ "children": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 2ac2b7f338..7fc17dcca5 100644 --- a/test/fixtures/jsx/basic/15/expected.json +++ b/test/fixtures/jsx/basic/15/expected.json @@ -247,7 +247,7 @@ "children": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 c3124de3ee..d5331fba92 100644 --- a/test/fixtures/jsx/basic/16/expected.json +++ b/test/fixtures/jsx/basic/16/expected.json @@ -106,8 +106,7 @@ "closingElement": null, "children": [], "extra": { - "parenthesized": true, - "parenStart": 0 + "parenthesized": true } }, "operator": "<", @@ -123,8 +122,7 @@ "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 f6d8f748c1..cf55b33ede 100644 --- a/test/fixtures/jsx/basic/17/expected.json +++ b/test/fixtures/jsx/basic/17/expected.json @@ -97,8 +97,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "props" + } }, "name": "props" } @@ -126,7 +125,7 @@ "children": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 30be28155d..643ebce2f5 100644 --- a/test/fixtures/jsx/basic/18/expected.json +++ b/test/fixtures/jsx/basic/18/expected.json @@ -97,8 +97,7 @@ "end": { "line": 1, "column": 14 - }, - "identifierName": "props" + } }, "name": "props" } @@ -147,10 +146,7 @@ "column": 32 } }, - "extra": { - "rawValue": "attribute", - "raw": "\"attribute\"" - }, + "extra": null, "value": "attribute" } } diff --git a/test/fixtures/jsx/basic/19/expected.json b/test/fixtures/jsx/basic/19/expected.json index eb742ee767..e9df7bec55 100644 --- a/test/fixtures/jsx/basic/19/expected.json +++ b/test/fixtures/jsx/basic/19/expected.json @@ -115,10 +115,7 @@ "column": 18 } }, - "extra": { - "rawValue": "leading", - "raw": "\"leading\"" - }, + "extra": null, "value": "leading" } }, @@ -166,10 +163,7 @@ "column": 35 } }, - "extra": { - "rawValue": "attribute", - "raw": "\"attribute\"" - }, + "extra": null, "value": "attribute" } }, @@ -199,8 +193,7 @@ "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 971d21320c..ba17f6adcf 100644 --- a/test/fixtures/jsx/basic/2/expected.json +++ b/test/fixtures/jsx/basic/2/expected.json @@ -188,7 +188,7 @@ "children": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 aa201aac33..67be9032eb 100644 --- a/test/fixtures/jsx/basic/20/expected.json +++ b/test/fixtures/jsx/basic/20/expected.json @@ -155,8 +155,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "aa" + } }, "name": "aa" }, @@ -172,8 +171,7 @@ "end": { "line": 1, "column": 12 - }, - "identifierName": "bb" + } }, "name": "bb" }, @@ -191,8 +189,7 @@ "end": { "line": 1, "column": 15 - }, - "identifierName": "cc" + } }, "name": "cc" }, @@ -284,8 +281,7 @@ "end": { "line": 1, "column": 23 - }, - "identifierName": "bb" + } }, "name": "bb" }, @@ -301,8 +297,7 @@ "end": { "line": 1, "column": 26 - }, - "identifierName": "cc" + } }, "name": "cc" }, @@ -320,8 +315,7 @@ "end": { "line": 1, "column": 29 - }, - "identifierName": "dd" + } }, "name": "dd" }, @@ -499,8 +493,7 @@ "end": { "line": 1, "column": 39 - }, - "identifierName": "aa" + } }, "name": "aa" }, @@ -516,8 +509,7 @@ "end": { "line": 1, "column": 41 - }, - "identifierName": "b" + } }, "name": "b" }, @@ -529,7 +521,7 @@ ] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 2fa06f64c8..8a6cfbda2c 100644 --- a/test/fixtures/jsx/basic/21/expected.json +++ b/test/fixtures/jsx/basic/21/expected.json @@ -97,8 +97,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "c" + } }, "name": "c" } @@ -168,10 +167,7 @@ "column": 13 } }, - "extra": { - "rawValue": " ", - "raw": " " - }, + "extra": null, "value": " " }, { @@ -200,8 +196,7 @@ "end": { "line": 1, "column": 25 - }, - "identifierName": "children" + } }, "name": "children" } @@ -232,8 +227,7 @@ "end": { "line": 1, "column": 28 - }, - "identifierName": "a" + } }, "name": "a" } @@ -264,8 +258,7 @@ "end": { "line": 1, "column": 34 - }, - "identifierName": "b" + } }, "name": "b" } @@ -275,5 +268,6 @@ } ], "directives": [] - } -} \ No newline at end of file + }, + "comments": [] +} diff --git a/test/fixtures/jsx/basic/3/expected.json b/test/fixtures/jsx/basic/3/expected.json index e1b54a6b01..a5cebe4764 100644 --- a/test/fixtures/jsx/basic/3/expected.json +++ b/test/fixtures/jsx/basic/3/expected.json @@ -146,10 +146,7 @@ "column": 14 } }, - "extra": { - "rawValue": "bar", - "raw": "\"bar\"" - }, + "extra": null, "value": "bar" } } @@ -218,10 +215,7 @@ "column": 16 } }, - "extra": { - "rawValue": " ", - "raw": " " - }, + "extra": null, "value": " " }, { @@ -250,8 +244,7 @@ "end": { "line": 1, "column": 22 - }, - "identifierName": "value" + } }, "name": "value" } @@ -270,10 +263,7 @@ "column": 24 } }, - "extra": { - "rawValue": " ", - "raw": " " - }, + "extra": null, "value": " " }, { diff --git a/test/fixtures/jsx/basic/4/expected.json b/test/fixtures/jsx/basic/4/expected.json index f0f895006b..1c24bbb736 100644 --- a/test/fixtures/jsx/basic/4/expected.json +++ b/test/fixtures/jsx/basic/4/expected.json @@ -181,10 +181,7 @@ "column": 16 } }, - "extra": { - "rawValue": " ", - "raw": "\" \"" - }, + "extra": null, "value": " " } }, @@ -232,10 +229,7 @@ "column": 26 } }, - "extra": { - "rawValue": "&", - "raw": "\"&\"" - }, + "extra": null, "value": "&" } }, @@ -283,10 +277,7 @@ "column": 37 } }, - "extra": { - "rawValue": "&r;", - "raw": "\"&r;\"" - }, + "extra": null, "value": "&r;" } } diff --git a/test/fixtures/jsx/basic/5/expected.json b/test/fixtures/jsx/basic/5/expected.json index 31316dc183..a9db746b35 100644 --- a/test/fixtures/jsx/basic/5/expected.json +++ b/test/fixtures/jsx/basic/5/expected.json @@ -93,7 +93,7 @@ "children": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 98750bdb3f..94b18bbb71 100644 --- a/test/fixtures/jsx/basic/6/expected.json +++ b/test/fixtures/jsx/basic/6/expected.json @@ -123,7 +123,7 @@ "children": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 95d6016840..154626c2da 100644 --- a/test/fixtures/jsx/basic/7/expected.json +++ b/test/fixtures/jsx/basic/7/expected.json @@ -115,10 +115,7 @@ "column": 22 } }, - "extra": { - "rawValue": "&&", - "raw": "\"&&\"" - }, + "extra": null, "value": "&&" } } @@ -187,10 +184,7 @@ "column": 0 } }, - "extra": { - "rawValue": "\nbar\nbaz\n", - "raw": "\nbar\nbaz\n" - }, + "extra": null, "value": "\nbar\nbaz\n" } ] diff --git a/test/fixtures/jsx/basic/8/expected.json b/test/fixtures/jsx/basic/8/expected.json index 695a507bb4..06bfadfee7 100644 --- a/test/fixtures/jsx/basic/8/expected.json +++ b/test/fixtures/jsx/basic/8/expected.json @@ -141,8 +141,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "x" + } }, "name": "x" }, @@ -272,7 +271,7 @@ "children": [] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 120125cf19..73e695d2a6 100644 --- a/test/fixtures/jsx/basic/asi/expected.json +++ b/test/fixtures/jsx/basic/asi/expected.json @@ -54,14 +54,12 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "x" + } }, "name": "x" }, "generator": false, "expression": false, - "async": false, "params": [], "body": { "type": "BlockStatement", @@ -119,8 +117,7 @@ "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 816a67616f..157403e9bf 100644 --- a/test/fixtures/jsx/basic/empty-expression-container/expected.json +++ b/test/fixtures/jsx/basic/empty-expression-container/expected.json @@ -137,18 +137,7 @@ }, "expression": { "type": "JSXEmptyExpression", - "start": 4, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 4 - } - } + "loc": {} } } ] diff --git a/test/fixtures/jsx/basic/entity/expected.json b/test/fixtures/jsx/basic/entity/expected.json index e95455df4c..69f4b59ea6 100644 --- a/test/fixtures/jsx/basic/entity/expected.json +++ b/test/fixtures/jsx/basic/entity/expected.json @@ -135,10 +135,7 @@ "column": 12 } }, - "extra": { - "rawValue": "💩", - "raw": "💩" - }, + "extra": null, "value": "💩" } ] diff --git a/test/fixtures/jsx/basic/keyword-tag/expected.json b/test/fixtures/jsx/basic/keyword-tag/expected.json index a3131a33e9..310e29dd35 100644 --- a/test/fixtures/jsx/basic/keyword-tag/expected.json +++ b/test/fixtures/jsx/basic/keyword-tag/expected.json @@ -123,7 +123,6 @@ "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 e16d5de485..9070b5a80f 100644 --- a/test/fixtures/jsx/basic/namespace-tag/expected.json +++ b/test/fixtures/jsx/basic/namespace-tag/expected.json @@ -281,7 +281,6 @@ "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 50a5f67c5a..8ddb29c276 100644 --- a/test/fixtures/jsx/basic/nonentity-decimal/expected.json +++ b/test/fixtures/jsx/basic/nonentity-decimal/expected.json @@ -135,10 +135,7 @@ "column": 11 } }, - "extra": { - "rawValue": "f4a9;", - "raw": "f4a9;" - }, + "extra": null, "value": "f4a9;" } ] diff --git a/test/fixtures/jsx/basic/nonentity/expected.json b/test/fixtures/jsx/basic/nonentity/expected.json index 9b6cf134af..7d91ec929e 100644 --- a/test/fixtures/jsx/basic/nonentity/expected.json +++ b/test/fixtures/jsx/basic/nonentity/expected.json @@ -135,10 +135,7 @@ "column": 12 } }, - "extra": { - "rawValue": "g4q9;", - "raw": "g4q9;" - }, + "extra": null, "value": "g4q9;" } ] diff --git a/test/fixtures/jsx/basic/yield-tag/expected.json b/test/fixtures/jsx/basic/yield-tag/expected.json index 3cb2a5908c..79a13273e6 100644 --- a/test/fixtures/jsx/basic/yield-tag/expected.json +++ b/test/fixtures/jsx/basic/yield-tag/expected.json @@ -1,199 +1,198 @@ { - "type": "File", + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "program": { + "type": "Program", "start": 0, "end": 35, "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } }, - "program": { - "type": "Program", + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", "start": 0, "end": 35, "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 11, + "loc": { "start": { - "line": 1, - "column": 0 + "line": 1, + "column": 9 }, "end": { - "line": 3, - "column": 1 + "line": 1, + "column": 11 } + }, + "name": "it" }, - "sourceType": "script", - "body": [ + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ { - "type": "FunctionDeclaration", - "start": 0, - "end": 35, + "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": 1, - "column": 0 + "line": 2, + "column": 10 }, "end": { - "line": 3, - "column": 1 + "line": 2, + "column": 17 } - }, - "id": { - "type": "Identifier", - "start": 9, - "end": 11, + }, + "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": 1, - "column": 9 + "line": 2, + "column": 11 }, "end": { - "line": 1, - "column": 11 - }, - "identifierName": "it" + "line": 2, + "column": 12 + } + }, + "name": "a" }, - "name": "it" - }, - "generator": true, - "expression": false, - "async": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 13, - "end": 35, + "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": 1, - "column": 13 + "line": 2, + "column": 15 }, "end": { - "line": 3, - "column": 1 - } - }, - "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": [] - } - } + "line": 2, + "column": 16 } - ], - "directives": [] + }, + "name": "a" + } + }, + "children": [] } + } } - ], - "directives": [] - } -} \ No newline at end of file + ], + "directives": [] + } + } + ], + "directives": [] + }, + "comments": [] +} diff --git a/test/fixtures/jsx/regression/1/expected.json b/test/fixtures/jsx/regression/1/expected.json index aadc50ad85..568a15f9e9 100644 --- a/test/fixtures/jsx/regression/1/expected.json +++ b/test/fixtures/jsx/regression/1/expected.json @@ -135,10 +135,7 @@ "column": 7 } }, - "extra": { - "rawValue": "foo ", - "raw": "foo " - }, + "extra": null, "value": "foo " }, { @@ -214,10 +211,7 @@ "column": 21 } }, - "extra": { - "rawValue": "test", - "raw": "\"test\"" - }, + "extra": null, "value": "test" } } @@ -286,10 +280,7 @@ "column": 26 } }, - "extra": { - "rawValue": " bar", - "raw": " bar" - }, + "extra": null, "value": " bar" } ] @@ -308,10 +299,7 @@ "column": 34 } }, - "extra": { - "rawValue": " baz", - "raw": " baz" - }, + "extra": null, "value": " baz" } ] diff --git a/test/fixtures/jsx/regression/2/expected.json b/test/fixtures/jsx/regression/2/expected.json index 33898ea946..4983e54932 100644 --- a/test/fixtures/jsx/regression/2/expected.json +++ b/test/fixtures/jsx/regression/2/expected.json @@ -190,8 +190,7 @@ "end": { "line": 1, "column": 19 - }, - "identifierName": "test" + } }, "name": "test" } @@ -222,7 +221,7 @@ ] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 e952ae4a2b..d4081dc212 100644 --- a/test/fixtures/jsx/regression/3/expected.json +++ b/test/fixtures/jsx/regression/3/expected.json @@ -179,8 +179,7 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "a" + } }, "name": "a" }, @@ -196,13 +195,9 @@ "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 4479b6debd..6e86caee9b 100644 --- a/test/fixtures/jsx/regression/4/expected.json +++ b/test/fixtures/jsx/regression/4/expected.json @@ -135,10 +135,7 @@ "column": 10 } }, - "extra": { - "rawValue": "/text", - "raw": "/text" - }, + "extra": null, "value": "/text" } ] diff --git a/test/fixtures/jsx/regression/5/expected.json b/test/fixtures/jsx/regression/5/expected.json index 5e8ebf8b82..aaf2e26a1d 100644 --- a/test/fixtures/jsx/regression/5/expected.json +++ b/test/fixtures/jsx/regression/5/expected.json @@ -147,8 +147,7 @@ "end": { "line": 1, "column": 7 - }, - "identifierName": "a" + } }, "name": "a" } @@ -179,8 +178,7 @@ "end": { "line": 1, "column": 10 - }, - "identifierName": "b" + } }, "name": "b" } @@ -188,7 +186,7 @@ ] } } - ], - "directives": [] - } + ] + }, + "comments": [] } \ 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 acd021ff39..44b08551ed 100644 --- a/test/fixtures/jsx/regression/6/expected.json +++ b/test/fixtures/jsx/regression/6/expected.json @@ -115,10 +115,7 @@ "column": 18 } }, - "extra": { - "rawValue": "leading", - "raw": "\"leading\"" - }, + "extra": null, "value": "leading" } }, @@ -148,8 +145,7 @@ "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 fc8f6720e2..d82ea9606a 100644 --- a/test/fixtures/jsx/regression/7/expected.json +++ b/test/fixtures/jsx/regression/7/expected.json @@ -115,10 +115,7 @@ "column": 15 } }, - "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\"" - }, + "extra": null, "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 3f7dd61fd2..eeb0a95cc9 100644 --- a/test/fixtures/jsx/regression/issue-2083/expected.json +++ b/test/fixtures/jsx/regression/issue-2083/expected.json @@ -122,8 +122,7 @@ "closingElement": null, "children": [], "extra": { - "parenthesized": true, - "parenStart": 7 + "parenthesized": true } }, "alternate": { diff --git a/test/fixtures/jsx/regression/issue-2114/expected.json b/test/fixtures/jsx/regression/issue-2114/expected.json index 6abcb37004..15b1d87259 100644 --- a/test/fixtures/jsx/regression/issue-2114/expected.json +++ b/test/fixtures/jsx/regression/issue-2114/expected.json @@ -115,10 +115,7 @@ "column": 43 } }, - "extra": { - "rawValue": "^([\\w\\.\\-]+\\s)*[\\w\\.\\-]+\\s?$", - "raw": "\"^([\\w\\.\\-]+\\s)*[\\w\\.\\-]+\\s?$\"" - }, + "extra": null, "value": "^([\\w\\.\\-]+\\s)*[\\w\\.\\-]+\\s?$" } } diff --git a/test/fixtures/jsx/regression/nbsp/actual.js b/test/fixtures/jsx/regression/nbsp/actual.js deleted file mode 100644 index e6b2eb47be..0000000000 --- a/test/fixtures/jsx/regression/nbsp/actual.js +++ /dev/null @@ -1 +0,0 @@ -
 
diff --git a/test/fixtures/jsx/regression/nbsp/expected.json b/test/fixtures/jsx/regression/nbsp/expected.json deleted file mode 100644 index 32e90c742f..0000000000 --- a/test/fixtures/jsx/regression/nbsp/expected.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "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 new file mode 100644 index 0000000000..7aeab8e0ec --- /dev/null +++ b/test/fixtures/jsx/regression/test-star-option/actual.js @@ -0,0 +1,4 @@ +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 new file mode 100644 index 0000000000..1d0e4b71f8 --- /dev/null +++ b/test/fixtures/jsx/regression/test-star-option/expected.json @@ -0,0 +1,277 @@ +{ + "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 new file mode 100644 index 0000000000..2f56a201da --- /dev/null +++ b/test/fixtures/jsx/regression/test-star-option/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["*"] +} diff --git a/test/fixtures/lightscript/arrow-expressions/fat-async-no-paren-white/actual.js b/test/fixtures/lightscript/arrow-expressions/fat-async-no-paren-white/actual.js new file mode 100644 index 0000000000..22f5ffb162 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/fat-async-no-paren-white/actual.js @@ -0,0 +1,3 @@ +a = b =/> + await b + b 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 new file mode 100644 index 0000000000..9cbde09c08 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/fat-async-no-paren-white/expected.json @@ -0,0 +1,223 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "ArrowFunctionExpression", + "start": 4, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": true, + "params": [ + { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + } + ], + "skinny": false, + "body": { + "type": "BlockStatement", + "start": 6, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "expression": { + "type": "AwaitExpression", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "argument": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "b" + }, + "name": "b" + } + } + }, + { + "type": "ExpressionStatement", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "expression": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-expressions/fat-async-no-paren/actual.js b/test/fixtures/lightscript/arrow-expressions/fat-async-no-paren/actual.js new file mode 100644 index 0000000000..f157751c24 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/fat-async-no-paren/actual.js @@ -0,0 +1 @@ +a = b =/> await b 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 new file mode 100644 index 0000000000..607ddfb0bc --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/fat-async-no-paren/expected.json @@ -0,0 +1,155 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "ArrowFunctionExpression", + "start": 4, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": null, + "generator": false, + "expression": true, + "async": true, + "params": [ + { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + } + ], + "skinny": false, + "body": { + "type": "AwaitExpression", + "start": 10, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "argument": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "b" + }, + "name": "b" + } + } + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-expressions/fat-async/actual.js b/test/fixtures/lightscript/arrow-expressions/fat-async/actual.js new file mode 100644 index 0000000000..756dbc0565 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/fat-async/actual.js @@ -0,0 +1 @@ +() =/> await x diff --git a/test/fixtures/lightscript/arrow-expressions/fat-async/expected.json b/test/fixtures/lightscript/arrow-expressions/fat-async/expected.json new file mode 100644 index 0000000000..e07c8f25cc --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/fat-async/expected.json @@ -0,0 +1,102 @@ +{ + "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": "ArrowFunctionExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "async": true, + "skinny": false, + "id": null, + "generator": false, + "expression": true, + "params": [], + "body": { + "type": "AwaitExpression", + "start": 7, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "argument": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "x" + }, + "name": "x" + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-expressions/fat-class-expr/actual.js b/test/fixtures/lightscript/arrow-expressions/fat-class-expr/actual.js new file mode 100644 index 0000000000..c8b010804c --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/fat-class-expr/actual.js @@ -0,0 +1 @@ +x = arg => class X {} diff --git a/test/fixtures/lightscript/arrow-expressions/fat-class-expr/expected.json b/test/fixtures/lightscript/arrow-expressions/fat-class-expr/expected.json new file mode 100644 index 0000000000..8f6a32cf56 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/fat-class-expr/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": "VariableDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "ArrowFunctionExpression", + "start": 4, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "arg" + }, + "name": "arg" + } + ], + "skinny": false, + "body": { + "type": "ClassExpression", + "start": 11, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "X" + }, + "name": "X" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "body": [] + } + } + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-expressions/first-line-string/actual.js b/test/fixtures/lightscript/arrow-expressions/first-line-string/actual.js new file mode 100644 index 0000000000..450791220f --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/first-line-string/actual.js @@ -0,0 +1,2 @@ +() => + "hello world" diff --git a/test/fixtures/lightscript/arrow-expressions/first-line-string/expected.json b/test/fixtures/lightscript/arrow-expressions/first-line-string/expected.json new file mode 100644 index 0000000000..e03f24e204 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/first-line-string/expected.json @@ -0,0 +1,126 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": false, + "body": { + "type": "BlockStatement", + "start": 3, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 8, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "expression": { + "type": "StringLiteral", + "start": 8, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "extra": { + "rawValue": "hello world", + "raw": "\"hello world\"" + }, + "value": "hello world" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-expressions/malformed-old-async-double/actual.js b/test/fixtures/lightscript/arrow-expressions/malformed-old-async-double/actual.js new file mode 100644 index 0000000000..9e350433d4 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/malformed-old-async-double/actual.js @@ -0,0 +1 @@ +async () =/> await x diff --git a/test/fixtures/lightscript/arrow-expressions/malformed-old-async-double/options.json b/test/fixtures/lightscript/arrow-expressions/malformed-old-async-double/options.json new file mode 100644 index 0000000000..c2cbda0c15 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/malformed-old-async-double/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Can't use async with lightscript arrows. (1:0)" +} diff --git a/test/fixtures/lightscript/arrow-expressions/no-parens-assign/actual.js b/test/fixtures/lightscript/arrow-expressions/no-parens-assign/actual.js new file mode 100644 index 0000000000..a8eeb88645 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/no-parens-assign/actual.js @@ -0,0 +1 @@ +x = => 1 diff --git a/test/fixtures/lightscript/arrow-expressions/no-parens-assign/expected.json b/test/fixtures/lightscript/arrow-expressions/no-parens-assign/expected.json new file mode 100644 index 0000000000..1b6da391b0 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/no-parens-assign/expected.json @@ -0,0 +1,128 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "ArrowFunctionExpression", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [], + "skinny": false, + "body": { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-expressions/no-parens-call/actual.js b/test/fixtures/lightscript/arrow-expressions/no-parens-call/actual.js new file mode 100644 index 0000000000..390b47c517 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/no-parens-call/actual.js @@ -0,0 +1,3 @@ +f(a + => 1 +) diff --git a/test/fixtures/lightscript/arrow-expressions/no-parens-call/expected.json b/test/fixtures/lightscript/arrow-expressions/no-parens-call/expected.json new file mode 100644 index 0000000000..6be44171a2 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/no-parens-call/expected.json @@ -0,0 +1,141 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "f" + }, + "name": "f" + }, + "arguments": [ + { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "ArrowFunctionExpression", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [], + "skinny": false, + "body": { + "type": "NumericLiteral", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-expressions/no-parens/actual.js b/test/fixtures/lightscript/arrow-expressions/no-parens/actual.js new file mode 100644 index 0000000000..c062b018b6 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/no-parens/actual.js @@ -0,0 +1 @@ +-> 1 diff --git a/test/fixtures/lightscript/arrow-expressions/no-parens/expected.json b/test/fixtures/lightscript/arrow-expressions/no-parens/expected.json new file mode 100644 index 0000000000..253652191d --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/no-parens/expected.json @@ -0,0 +1,90 @@ +{ + "type": "File", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "NumericLiteral", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-expressions/old-async/actual.js b/test/fixtures/lightscript/arrow-expressions/old-async/actual.js new file mode 100644 index 0000000000..299759a3f1 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/old-async/actual.js @@ -0,0 +1 @@ +async () => await x diff --git a/test/fixtures/lightscript/arrow-expressions/old-async/expected.json b/test/fixtures/lightscript/arrow-expressions/old-async/expected.json new file mode 100644 index 0000000000..3b0ea8801c --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/old-async/expected.json @@ -0,0 +1,102 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": null, + "generator": false, + "expression": true, + "async": true, + "params": [], + "skinny": false, + "body": { + "type": "AwaitExpression", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "argument": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "x" + }, + "name": "x" + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-expressions/oneline-stmt/actual.js b/test/fixtures/lightscript/arrow-expressions/oneline-stmt/actual.js new file mode 100644 index 0000000000..09dd16ccc3 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/oneline-stmt/actual.js @@ -0,0 +1 @@ +-> throw new Error diff --git a/test/fixtures/lightscript/arrow-expressions/oneline-stmt/expected.json b/test/fixtures/lightscript/arrow-expressions/oneline-stmt/expected.json new file mode 100644 index 0000000000..7282b6c1c6 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/oneline-stmt/expected.json @@ -0,0 +1,139 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "body": [ + { + "type": "ThrowStatement", + "start": 3, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "argument": { + "type": "NewExpression", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "callee": { + "type": "Identifier", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "Error" + }, + "name": "Error" + }, + "arguments": [] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-expressions/return-obj-firstline/actual.js b/test/fixtures/lightscript/arrow-expressions/return-obj-firstline/actual.js new file mode 100644 index 0000000000..b3dc550499 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/return-obj-firstline/actual.js @@ -0,0 +1,2 @@ +a => + { 'a': a } diff --git a/test/fixtures/lightscript/arrow-expressions/return-obj-firstline/expected.json b/test/fixtures/lightscript/arrow-expressions/return-obj-firstline/expected.json new file mode 100644 index 0000000000..4122975ab6 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/return-obj-firstline/expected.json @@ -0,0 +1,196 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + } + ], + "skinny": false, + "body": { + "type": "BlockStatement", + "start": 2, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 7, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 7, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "StringLiteral", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "extra": { + "rawValue": "a", + "raw": "'a'" + }, + "value": "a" + }, + "value": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + } + } + ] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-expressions/skinny-async/actual.js b/test/fixtures/lightscript/arrow-expressions/skinny-async/actual.js new file mode 100644 index 0000000000..0c5537d1d6 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/skinny-async/actual.js @@ -0,0 +1 @@ +() -/> await x diff --git a/test/fixtures/lightscript/arrow-expressions/skinny-async/expected.json b/test/fixtures/lightscript/arrow-expressions/skinny-async/expected.json new file mode 100644 index 0000000000..a54e1cc114 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/skinny-async/expected.json @@ -0,0 +1,102 @@ +{ + "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": "ArrowFunctionExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "async": true, + "skinny": true, + "id": null, + "generator": false, + "expression": true, + "params": [], + "body": { + "type": "AwaitExpression", + "start": 7, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "argument": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "x" + }, + "name": "x" + } + } + } + } + ], + "directives": [] + } +} diff --git a/test/fixtures/lightscript/arrow-expressions/skinny-curly/actual.js b/test/fixtures/lightscript/arrow-expressions/skinny-curly/actual.js new file mode 100644 index 0000000000..a6dc2fe41b --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/skinny-curly/actual.js @@ -0,0 +1,3 @@ +() -> { + x +} diff --git a/test/fixtures/lightscript/arrow-expressions/skinny-curly/expected.json b/test/fixtures/lightscript/arrow-expressions/skinny-curly/expected.json new file mode 100644 index 0000000000..0505dbb550 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/skinny-curly/expected.json @@ -0,0 +1,123 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 6, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "expression": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [], + "extra": { + "curly": true + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-expressions/skinny-double/actual.js b/test/fixtures/lightscript/arrow-expressions/skinny-double/actual.js new file mode 100644 index 0000000000..8ee35e0c47 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/skinny-double/actual.js @@ -0,0 +1 @@ +f() -> -> x diff --git a/test/fixtures/lightscript/arrow-expressions/skinny-double/expected.json b/test/fixtures/lightscript/arrow-expressions/skinny-double/expected.json new file mode 100644 index 0000000000..07ebac842e --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/skinny-double/expected.json @@ -0,0 +1,109 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "expression": true, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "ArrowFunctionExpression", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-expressions/skinny-oneline-stmt-semi/actual.js b/test/fixtures/lightscript/arrow-expressions/skinny-oneline-stmt-semi/actual.js new file mode 100644 index 0000000000..077bb60c5c --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/skinny-oneline-stmt-semi/actual.js @@ -0,0 +1 @@ +-> for idx i in Array(1): i; after() diff --git a/test/fixtures/lightscript/arrow-expressions/skinny-oneline-stmt-semi/expected.json b/test/fixtures/lightscript/arrow-expressions/skinny-oneline-stmt-semi/expected.json new file mode 100644 index 0000000000..82c109f5e3 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/skinny-oneline-stmt-semi/expected.json @@ -0,0 +1,257 @@ +{ + "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": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [ + { + "type": "ForInArrayStatement", + "start": 3, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "idx": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "i" + }, + "name": "i" + }, + "body": { + "type": "ExpressionStatement", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "expression": { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + }, + "identifierName": "i" + }, + "name": "i" + } + }, + "array": { + "type": "CallExpression", + "start": 16, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "callee": { + "type": "Identifier", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "Array" + }, + "name": "Array" + }, + "arguments": [ + { + "type": "NumericLiteral", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + }, + { + "type": "ExpressionStatement", + "start": 29, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "CallExpression", + "start": 29, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "callee": { + "type": "Identifier", + "start": 29, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 34 + }, + "identifierName": "after" + }, + "name": "after" + }, + "arguments": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-expressions/skinny-oneline-stmt/actual.js b/test/fixtures/lightscript/arrow-expressions/skinny-oneline-stmt/actual.js new file mode 100644 index 0000000000..e3e948d845 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/skinny-oneline-stmt/actual.js @@ -0,0 +1 @@ +-> for idx i in Array(1): i diff --git a/test/fixtures/lightscript/arrow-expressions/skinny-oneline-stmt/expected.json b/test/fixtures/lightscript/arrow-expressions/skinny-oneline-stmt/expected.json new file mode 100644 index 0000000000..bd37695194 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/skinny-oneline-stmt/expected.json @@ -0,0 +1,209 @@ +{ + "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": "ArrowFunctionExpression", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "body": [ + { + "type": "ForInArrayStatement", + "start": 3, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "idx": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "i" + }, + "name": "i" + }, + "body": { + "type": "ExpressionStatement", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + }, + "identifierName": "i" + }, + "name": "i" + } + }, + "array": { + "type": "CallExpression", + "start": 16, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "callee": { + "type": "Identifier", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "Array" + }, + "name": "Array" + }, + "arguments": [ + { + "type": "NumericLiteral", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-expressions/skinny-oneline/actual.js b/test/fixtures/lightscript/arrow-expressions/skinny-oneline/actual.js new file mode 100644 index 0000000000..e166de7f48 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/skinny-oneline/actual.js @@ -0,0 +1 @@ +() -> x diff --git a/test/fixtures/lightscript/arrow-expressions/skinny-oneline/expected.json b/test/fixtures/lightscript/arrow-expressions/skinny-oneline/expected.json new file mode 100644 index 0000000000..93dd410dca --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/skinny-oneline/expected.json @@ -0,0 +1,87 @@ +{ + "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": "ArrowFunctionExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "x" + }, + "name": "x" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-expressions/skinny-white/actual.js b/test/fixtures/lightscript/arrow-expressions/skinny-white/actual.js new file mode 100644 index 0000000000..6936e200fd --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/skinny-white/actual.js @@ -0,0 +1,2 @@ +() -> + x diff --git a/test/fixtures/lightscript/arrow-expressions/skinny-white/expected.json b/test/fixtures/lightscript/arrow-expressions/skinny-white/expected.json new file mode 100644 index 0000000000..f9b5059a8c --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/skinny-white/expected.json @@ -0,0 +1,123 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 3, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "expression": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-expressions/stmt-call/actual.js b/test/fixtures/lightscript/arrow-expressions/stmt-call/actual.js new file mode 100644 index 0000000000..ffd457e110 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/stmt-call/actual.js @@ -0,0 +1 @@ +(-> throw new Error)() diff --git a/test/fixtures/lightscript/arrow-expressions/stmt-call/expected.json b/test/fixtures/lightscript/arrow-expressions/stmt-call/expected.json new file mode 100644 index 0000000000..86e6952484 --- /dev/null +++ b/test/fixtures/lightscript/arrow-expressions/stmt-call/expected.json @@ -0,0 +1,159 @@ +{ + "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": "CallExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "callee": { + "type": "ArrowFunctionExpression", + "start": 1, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 1, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [ + { + "type": "ThrowStatement", + "start": 4, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "argument": { + "type": "NewExpression", + "start": 10, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "callee": { + "type": "Identifier", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "Error" + }, + "name": "Error" + }, + "arguments": [] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + }, + "arguments": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-methods/class-fat-arrow-oneline/actual.js b/test/fixtures/lightscript/arrow-methods/class-fat-arrow-oneline/actual.js new file mode 100644 index 0000000000..d6ea4b417a --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-fat-arrow-oneline/actual.js @@ -0,0 +1,3 @@ +class X { + method() => a +} diff --git a/test/fixtures/lightscript/arrow-methods/class-fat-arrow-oneline/expected.json b/test/fixtures/lightscript/arrow-methods/class-fat-arrow-oneline/expected.json new file mode 100644 index 0000000000..057362ff47 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-fat-arrow-oneline/expected.json @@ -0,0 +1,142 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 27, + "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 + }, + "identifierName": "X" + }, + "name": "X" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 12, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "method" + }, + "name": "method" + }, + "static": false, + "kind": "method", + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [], + "skinny": false, + "body": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "a" + }, + "name": "a" + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-methods/class-fat-arrow/actual.js b/test/fixtures/lightscript/arrow-methods/class-fat-arrow/actual.js new file mode 100644 index 0000000000..be19c1697c --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-fat-arrow/actual.js @@ -0,0 +1,5 @@ +class X { + method() => + a + b +} diff --git a/test/fixtures/lightscript/arrow-methods/class-fat-arrow/expected.json b/test/fixtures/lightscript/arrow-methods/class-fat-arrow/expected.json new file mode 100644 index 0000000000..97448a8046 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-fat-arrow/expected.json @@ -0,0 +1,210 @@ +{ + "type": "File", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "X" + }, + "name": "X" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 12, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "method" + }, + "name": "method" + }, + "static": false, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": false, + "body": { + "type": "BlockStatement", + "start": 21, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + { + "type": "ExpressionStatement", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-methods/class-fat-void/actual.js b/test/fixtures/lightscript/arrow-methods/class-fat-void/actual.js new file mode 100644 index 0000000000..6ebcecbd40 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-fat-void/actual.js @@ -0,0 +1,5 @@ +class X { + method(): void => + a + b +} diff --git a/test/fixtures/lightscript/arrow-methods/class-fat-void/expected.json b/test/fixtures/lightscript/arrow-methods/class-fat-void/expected.json new file mode 100644 index 0000000000..3caf8e3b0b --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-fat-void/expected.json @@ -0,0 +1,240 @@ +{ + "type": "File", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "X" + }, + "name": "X" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 12, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "method" + }, + "name": "method" + }, + "static": false, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "returnType": { + "type": "TypeAnnotation", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "typeAnnotation": { + "type": "VoidTypeAnnotation", + "start": 22, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 16 + } + } + } + }, + "skinny": false, + "body": { + "type": "BlockStatement", + "start": 27, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + { + "type": "ExpressionStatement", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-methods/class-get-malformed-async/actual.js b/test/fixtures/lightscript/arrow-methods/class-get-malformed-async/actual.js new file mode 100644 index 0000000000..508e94649b --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-get-malformed-async/actual.js @@ -0,0 +1,3 @@ +class X { + get method() -/> await a +} diff --git a/test/fixtures/lightscript/arrow-methods/class-get-malformed-async/options.json b/test/fixtures/lightscript/arrow-methods/class-get-malformed-async/options.json new file mode 100644 index 0000000000..42a9334774 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-get-malformed-async/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Can only use -> with getters & setters. (2:2)" +} diff --git a/test/fixtures/lightscript/arrow-methods/class-get-malformed-fat-arrow/actual.js b/test/fixtures/lightscript/arrow-methods/class-get-malformed-fat-arrow/actual.js new file mode 100644 index 0000000000..18edff3f53 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-get-malformed-fat-arrow/actual.js @@ -0,0 +1,3 @@ +class X { + get method() => 1 +} diff --git a/test/fixtures/lightscript/arrow-methods/class-get-malformed-fat-arrow/options.json b/test/fixtures/lightscript/arrow-methods/class-get-malformed-fat-arrow/options.json new file mode 100644 index 0000000000..42a9334774 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-get-malformed-fat-arrow/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Can only use -> with getters & setters. (2:2)" +} diff --git a/test/fixtures/lightscript/arrow-methods/class-get-malformed-generator/actual.js b/test/fixtures/lightscript/arrow-methods/class-get-malformed-generator/actual.js new file mode 100644 index 0000000000..a035c9f207 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-get-malformed-generator/actual.js @@ -0,0 +1,3 @@ +class X { + get method() -*> await a +} diff --git a/test/fixtures/lightscript/arrow-methods/class-get-malformed-generator/options.json b/test/fixtures/lightscript/arrow-methods/class-get-malformed-generator/options.json new file mode 100644 index 0000000000..42a9334774 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-get-malformed-generator/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Can only use -> with getters & setters. (2:2)" +} diff --git a/test/fixtures/lightscript/arrow-methods/class-get-malformed-one-param/actual.js b/test/fixtures/lightscript/arrow-methods/class-get-malformed-one-param/actual.js new file mode 100644 index 0000000000..be64acf3c3 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-get-malformed-one-param/actual.js @@ -0,0 +1,4 @@ +class X { + get method(x) -> + x +} diff --git a/test/fixtures/flow/object-types/invalid-getter-param-count/options.json b/test/fixtures/lightscript/arrow-methods/class-get-malformed-one-param/options.json similarity index 100% rename from test/fixtures/flow/object-types/invalid-getter-param-count/options.json rename to test/fixtures/lightscript/arrow-methods/class-get-malformed-one-param/options.json diff --git a/test/fixtures/lightscript/arrow-methods/class-get-malformed-two-params/actual.js b/test/fixtures/lightscript/arrow-methods/class-get-malformed-two-params/actual.js new file mode 100644 index 0000000000..a4dbb67332 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-get-malformed-two-params/actual.js @@ -0,0 +1,4 @@ +class X { + get method(x, y) -> + x + y +} diff --git a/test/fixtures/lightscript/arrow-methods/class-get-malformed-two-params/options.json b/test/fixtures/lightscript/arrow-methods/class-get-malformed-two-params/options.json new file mode 100644 index 0000000000..8694117aee --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-get-malformed-two-params/options.json @@ -0,0 +1,3 @@ +{ + "throws": "getter should have no params (2:2)" +} diff --git a/test/fixtures/lightscript/arrow-methods/class-get/actual.js b/test/fixtures/lightscript/arrow-methods/class-get/actual.js new file mode 100644 index 0000000000..ca7e1acd66 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-get/actual.js @@ -0,0 +1,5 @@ +class X { + get method() -> + a + b +} diff --git a/test/fixtures/lightscript/arrow-methods/class-get/expected.json b/test/fixtures/lightscript/arrow-methods/class-get/expected.json new file mode 100644 index 0000000000..1e822c8d52 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-get/expected.json @@ -0,0 +1,210 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "X" + }, + "name": "X" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 12, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 16, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "method" + }, + "name": "method" + }, + "static": false, + "kind": "get", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 25, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + { + "type": "ExpressionStatement", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-methods/class-malformed-async-fat-arrow/actual.js b/test/fixtures/lightscript/arrow-methods/class-malformed-async-fat-arrow/actual.js new file mode 100644 index 0000000000..416e37e01b --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-malformed-async-fat-arrow/actual.js @@ -0,0 +1,3 @@ +class X { + async method() => await a +} diff --git a/test/fixtures/lightscript/arrow-methods/class-malformed-async-fat-arrow/options.json b/test/fixtures/lightscript/arrow-methods/class-malformed-async-fat-arrow/options.json new file mode 100644 index 0000000000..c60643caca --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-malformed-async-fat-arrow/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Can't use async with lightscript arrows. (2:2)" +} diff --git a/test/fixtures/lightscript/arrow-methods/class-malformed-async-skinny-arrow/actual.js b/test/fixtures/lightscript/arrow-methods/class-malformed-async-skinny-arrow/actual.js new file mode 100644 index 0000000000..9b51886768 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-malformed-async-skinny-arrow/actual.js @@ -0,0 +1,3 @@ +class X { + async method() -> await a +} diff --git a/test/fixtures/lightscript/arrow-methods/class-malformed-async-skinny-arrow/options.json b/test/fixtures/lightscript/arrow-methods/class-malformed-async-skinny-arrow/options.json new file mode 100644 index 0000000000..c60643caca --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-malformed-async-skinny-arrow/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Can't use async with lightscript arrows. (2:2)" +} diff --git a/test/fixtures/lightscript/arrow-methods/class-malformed-generator-arrow/actual.js b/test/fixtures/lightscript/arrow-methods/class-malformed-generator-arrow/actual.js new file mode 100644 index 0000000000..a0f135e337 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-malformed-generator-arrow/actual.js @@ -0,0 +1,3 @@ +class X { + *method() -> yield a +} diff --git a/test/fixtures/lightscript/arrow-methods/class-malformed-generator-arrow/options.json b/test/fixtures/lightscript/arrow-methods/class-malformed-generator-arrow/options.json new file mode 100644 index 0000000000..dfa9a7cab7 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-malformed-generator-arrow/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Can't declare generators with arrows; try -*> instead. (2:2)" +} diff --git a/test/fixtures/lightscript/arrow-methods/class-multi-arrow/actual.js b/test/fixtures/lightscript/arrow-methods/class-multi-arrow/actual.js new file mode 100644 index 0000000000..6e4a75aba0 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-multi-arrow/actual.js @@ -0,0 +1,7 @@ +class X { + method1() => a + method2() -> + a + b + method3() -> a +} diff --git a/test/fixtures/lightscript/arrow-methods/class-multi-arrow/expected.json b/test/fixtures/lightscript/arrow-methods/class-multi-arrow/expected.json new file mode 100644 index 0000000000..7e8c6f7187 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-multi-arrow/expected.json @@ -0,0 +1,326 @@ +{ + "type": "File", + "start": 0, + "end": 72, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 72, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 72, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "X" + }, + "name": "X" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 72, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 12, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "method1" + }, + "name": "method1" + }, + "static": false, + "kind": "method", + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [], + "skinny": false, + "body": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 16 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + { + "type": "ClassMethod", + "start": 29, + "end": 53, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 29, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 9 + }, + "identifierName": "method2" + }, + "name": "method2" + }, + "static": false, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 39, + "end": 53, + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 46, + "end": 47, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 46, + "end": 47, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + { + "type": "ExpressionStatement", + "start": 52, + "end": 53, + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 52, + "end": 53, + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + }, + { + "type": "ClassMethod", + "start": 56, + "end": 70, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 16 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 56, + "end": 63, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 9 + }, + "identifierName": "method3" + }, + "name": "method3" + }, + "static": false, + "kind": "method", + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "Identifier", + "start": 69, + "end": 70, + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 16 + }, + "identifierName": "a" + }, + "name": "a" + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-methods/class-set-malformed-async/actual.js b/test/fixtures/lightscript/arrow-methods/class-set-malformed-async/actual.js new file mode 100644 index 0000000000..ba0e38d10f --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-set-malformed-async/actual.js @@ -0,0 +1,3 @@ +class X { + set method() -/> await a +} diff --git a/test/fixtures/lightscript/arrow-methods/class-set-malformed-async/options.json b/test/fixtures/lightscript/arrow-methods/class-set-malformed-async/options.json new file mode 100644 index 0000000000..42a9334774 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-set-malformed-async/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Can only use -> with getters & setters. (2:2)" +} diff --git a/test/fixtures/lightscript/arrow-methods/class-set-malformed-fat-arrow/actual.js b/test/fixtures/lightscript/arrow-methods/class-set-malformed-fat-arrow/actual.js new file mode 100644 index 0000000000..a08008e31d --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-set-malformed-fat-arrow/actual.js @@ -0,0 +1,3 @@ +class X { + set method() => 1 +} diff --git a/test/fixtures/lightscript/arrow-methods/class-set-malformed-fat-arrow/options.json b/test/fixtures/lightscript/arrow-methods/class-set-malformed-fat-arrow/options.json new file mode 100644 index 0000000000..42a9334774 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-set-malformed-fat-arrow/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Can only use -> with getters & setters. (2:2)" +} diff --git a/test/fixtures/lightscript/arrow-methods/class-set-malformed-generator/actual.js b/test/fixtures/lightscript/arrow-methods/class-set-malformed-generator/actual.js new file mode 100644 index 0000000000..a19ccee9fc --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-set-malformed-generator/actual.js @@ -0,0 +1,3 @@ +class X { + set method() -*> await a +} diff --git a/test/fixtures/lightscript/arrow-methods/class-set-malformed-generator/options.json b/test/fixtures/lightscript/arrow-methods/class-set-malformed-generator/options.json new file mode 100644 index 0000000000..42a9334774 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-set-malformed-generator/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Can only use -> with getters & setters. (2:2)" +} diff --git a/test/fixtures/lightscript/arrow-methods/class-set-malformed-no-params/actual.js b/test/fixtures/lightscript/arrow-methods/class-set-malformed-no-params/actual.js new file mode 100644 index 0000000000..2694b2260d --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-set-malformed-no-params/actual.js @@ -0,0 +1,4 @@ +class X { + set method() -> + this.x = x +} diff --git a/test/fixtures/flow/object-types/invalid-setter-param-count/options.json b/test/fixtures/lightscript/arrow-methods/class-set-malformed-no-params/options.json similarity index 100% rename from test/fixtures/flow/object-types/invalid-setter-param-count/options.json rename to test/fixtures/lightscript/arrow-methods/class-set-malformed-no-params/options.json diff --git a/test/fixtures/lightscript/arrow-methods/class-set-malformed-two-params/actual.js b/test/fixtures/lightscript/arrow-methods/class-set-malformed-two-params/actual.js new file mode 100644 index 0000000000..f146df8af7 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-set-malformed-two-params/actual.js @@ -0,0 +1,4 @@ +class X { + set method(x, y) -> + this.x = x +} diff --git a/test/fixtures/lightscript/arrow-methods/class-set-malformed-two-params/options.json b/test/fixtures/lightscript/arrow-methods/class-set-malformed-two-params/options.json new file mode 100644 index 0000000000..8ea95ab888 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-set-malformed-two-params/options.json @@ -0,0 +1,3 @@ +{ + "throws": "setter should have exactly one param (2:2)" +} diff --git a/test/fixtures/lightscript/arrow-methods/class-set/actual.js b/test/fixtures/lightscript/arrow-methods/class-set/actual.js new file mode 100644 index 0000000000..af633e1bc0 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-set/actual.js @@ -0,0 +1,4 @@ +class X { + set method(x) -> + this.x = x +} diff --git a/test/fixtures/lightscript/arrow-methods/class-set/expected.json b/test/fixtures/lightscript/arrow-methods/class-set/expected.json new file mode 100644 index 0000000000..37ee7c2a63 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-set/expected.json @@ -0,0 +1,261 @@ +{ + "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": "ClassDeclaration", + "start": 0, + "end": 45, + "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": "X" + }, + "name": "X" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 12, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 16, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "method" + }, + "name": "method" + }, + "static": false, + "kind": "set", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 14 + }, + "identifierName": "x" + }, + "name": "x" + } + ], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 26, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 33, + "end": 43, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 33, + "end": 43, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "operator": "=", + "left": { + "type": "MemberExpression", + "start": 33, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "object": { + "type": "ThisExpression", + "start": 33, + "end": 37, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 8 + } + } + }, + "property": { + "type": "Identifier", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + }, + "computed": false + }, + "right": { + "type": "Identifier", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 14 + }, + "identifierName": "x" + }, + "name": "x" + }, + "isNowAssign": false + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-methods/class-skinny-oneline-stmt/actual.js b/test/fixtures/lightscript/arrow-methods/class-skinny-oneline-stmt/actual.js new file mode 100644 index 0000000000..cb3da60fc2 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-skinny-oneline-stmt/actual.js @@ -0,0 +1,2 @@ +class X: + method() -> for idx i in Array(10): i diff --git a/test/fixtures/lightscript/arrow-methods/class-skinny-oneline-stmt/expected.json b/test/fixtures/lightscript/arrow-methods/class-skinny-oneline-stmt/expected.json new file mode 100644 index 0000000000..014ef59011 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-skinny-oneline-stmt/expected.json @@ -0,0 +1,264 @@ +{ + "type": "File", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 39 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 39 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 39 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "X" + }, + "name": "X" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 7, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 2, + "column": 39 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 11, + "end": 48, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 39 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 11, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "method" + }, + "name": "method" + }, + "static": false, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 20, + "end": 48, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 39 + } + }, + "body": [ + { + "type": "ForInArrayStatement", + "start": 23, + "end": 48, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 39 + } + }, + "idx": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 23 + }, + "identifierName": "i" + }, + "name": "i" + }, + "body": { + "type": "ExpressionStatement", + "start": 47, + "end": 48, + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 2, + "column": 39 + } + }, + "expression": { + "type": "Identifier", + "start": 47, + "end": 48, + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 2, + "column": 39 + }, + "identifierName": "i" + }, + "name": "i" + } + }, + "array": { + "type": "CallExpression", + "start": 36, + "end": 45, + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 36 + } + }, + "callee": { + "type": "Identifier", + "start": 36, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 32 + }, + "identifierName": "Array" + }, + "name": "Array" + }, + "arguments": [ + { + "type": "NumericLiteral", + "start": 42, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 33 + }, + "end": { + "line": 2, + "column": 35 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + ] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-methods/class-static-async/actual.js b/test/fixtures/lightscript/arrow-methods/class-static-async/actual.js new file mode 100644 index 0000000000..a1786fa32b --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-static-async/actual.js @@ -0,0 +1,3 @@ +class X { + static method() -/> await a +} diff --git a/test/fixtures/lightscript/arrow-methods/class-static-async/expected.json b/test/fixtures/lightscript/arrow-methods/class-static-async/expected.json new file mode 100644 index 0000000000..13229f1e2f --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-static-async/expected.json @@ -0,0 +1,157 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 41, + "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 + }, + "identifierName": "X" + }, + "name": "X" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 12, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 19, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "method" + }, + "name": "method" + }, + "static": true, + "kind": "method", + "id": null, + "generator": false, + "expression": true, + "async": true, + "params": [], + "skinny": true, + "body": { + "type": "AwaitExpression", + "start": 32, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "argument": { + "type": "Identifier", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 28 + }, + "end": { + "line": 2, + "column": 29 + }, + "identifierName": "a" + }, + "name": "a" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-methods/class-static-generator/actual.js b/test/fixtures/lightscript/arrow-methods/class-static-generator/actual.js new file mode 100644 index 0000000000..6f5a328dfc --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-static-generator/actual.js @@ -0,0 +1,3 @@ +class X { + static method() -*> yield a +} diff --git a/test/fixtures/lightscript/arrow-methods/class-static-generator/expected.json b/test/fixtures/lightscript/arrow-methods/class-static-generator/expected.json new file mode 100644 index 0000000000..66b0174816 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-static-generator/expected.json @@ -0,0 +1,158 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 41, + "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 + }, + "identifierName": "X" + }, + "name": "X" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 12, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 19, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "method" + }, + "name": "method" + }, + "static": true, + "kind": "method", + "id": null, + "generator": true, + "expression": true, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "YieldExpression", + "start": 32, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "delegate": false, + "argument": { + "type": "Identifier", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 28 + }, + "end": { + "line": 2, + "column": 29 + }, + "identifierName": "a" + }, + "name": "a" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-methods/class-static-void/actual.js b/test/fixtures/lightscript/arrow-methods/class-static-void/actual.js new file mode 100644 index 0000000000..9e3668fd2b --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-static-void/actual.js @@ -0,0 +1,3 @@ +class X { + static method(): void -> 1 +} diff --git a/test/fixtures/lightscript/arrow-methods/class-static-void/expected.json b/test/fixtures/lightscript/arrow-methods/class-static-void/expected.json new file mode 100644 index 0000000000..1aa284c395 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/class-static-void/expected.json @@ -0,0 +1,175 @@ +{ + "type": "File", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 40, + "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 + }, + "identifierName": "X" + }, + "name": "X" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 12, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 19, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "method" + }, + "name": "method" + }, + "static": true, + "kind": "method", + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [], + "returnType": { + "type": "TypeAnnotation", + "start": 27, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "typeAnnotation": { + "type": "VoidTypeAnnotation", + "start": 29, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 23 + } + } + } + }, + "skinny": true, + "body": { + "type": "NumericLiteral", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-methods/obj-async-arrow/actual.js b/test/fixtures/lightscript/arrow-methods/obj-async-arrow/actual.js new file mode 100644 index 0000000000..85c7713747 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/obj-async-arrow/actual.js @@ -0,0 +1,3 @@ +x = { + method() -/> await a +} diff --git a/test/fixtures/lightscript/arrow-methods/obj-async-arrow/expected.json b/test/fixtures/lightscript/arrow-methods/obj-async-arrow/expected.json new file mode 100644 index 0000000000..7ece17f88a --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/obj-async-arrow/expected.json @@ -0,0 +1,175 @@ +{ + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "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": 30, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 8, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "method" + }, + "name": "method" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": true, + "async": true, + "params": [], + "skinny": true, + "body": { + "type": "AwaitExpression", + "start": 21, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "argument": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 22 + }, + "identifierName": "a" + }, + "name": "a" + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-methods/obj-commaless-oneline/actual.js b/test/fixtures/lightscript/arrow-methods/obj-commaless-oneline/actual.js new file mode 100644 index 0000000000..68080e6130 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/obj-commaless-oneline/actual.js @@ -0,0 +1,4 @@ +x = { + method1() -> a + c +} diff --git a/test/fixtures/lightscript/arrow-methods/obj-commaless-oneline/expected.json b/test/fixtures/lightscript/arrow-methods/obj-commaless-oneline/expected.json new file mode 100644 index 0000000000..ecdec18825 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/obj-commaless-oneline/expected.json @@ -0,0 +1,215 @@ +{ + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "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": 28, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 8, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "method1" + }, + "name": "method1" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 16 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + { + "type": "ObjectProperty", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "c" + }, + "name": "c" + }, + "value": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "c" + }, + "name": "c" + }, + "extra": { + "shorthand": true + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-methods/obj-commaless/actual.js b/test/fixtures/lightscript/arrow-methods/obj-commaless/actual.js new file mode 100644 index 0000000000..4204d05f3b --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/obj-commaless/actual.js @@ -0,0 +1,9 @@ +x = { + method1() -> + a + b + method2() -> + a + b + c +} diff --git a/test/fixtures/lightscript/arrow-methods/obj-commaless/expected.json b/test/fixtures/lightscript/arrow-methods/obj-commaless/expected.json new file mode 100644 index 0000000000..16a3d43b23 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/obj-commaless/expected.json @@ -0,0 +1,410 @@ +{ + "type": "File", + "start": 0, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "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": 65, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 8, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "method1" + }, + "name": "method1" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 18, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + { + "type": "ExpressionStatement", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + }, + { + "type": "ObjectMethod", + "start": 35, + "end": 59, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 35, + "end": 42, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 9 + }, + "identifierName": "method2" + }, + "name": "method2" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 45, + "end": 59, + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 52, + "end": 53, + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 52, + "end": 53, + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + { + "type": "ExpressionStatement", + "start": 58, + "end": 59, + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 58, + "end": 59, + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + }, + { + "type": "ObjectProperty", + "start": 62, + "end": 63, + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 3 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 62, + "end": 63, + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 3 + }, + "identifierName": "c" + }, + "name": "c" + }, + "value": { + "type": "Identifier", + "start": 62, + "end": 63, + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 3 + }, + "identifierName": "c" + }, + "name": "c" + }, + "extra": { + "shorthand": true + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-methods/obj-computed-void/actual.js b/test/fixtures/lightscript/arrow-methods/obj-computed-void/actual.js new file mode 100644 index 0000000000..82c9d92a63 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/obj-computed-void/actual.js @@ -0,0 +1,5 @@ +x = { + ['method'](): void -> + a + b +} diff --git a/test/fixtures/lightscript/arrow-methods/obj-computed-void/expected.json b/test/fixtures/lightscript/arrow-methods/obj-computed-void/expected.json new file mode 100644 index 0000000000..3977b1c8da --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/obj-computed-void/expected.json @@ -0,0 +1,261 @@ +{ + "type": "File", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "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": 43, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 8, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "method": true, + "shorthand": false, + "computed": true, + "key": { + "type": "StringLiteral", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "extra": { + "rawValue": "method", + "raw": "'method'" + }, + "value": "method" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "returnType": { + "type": "TypeAnnotation", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "typeAnnotation": { + "type": "VoidTypeAnnotation", + "start": 22, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 20 + } + } + } + }, + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 27, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + { + "type": "ExpressionStatement", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-methods/obj-get/actual.js b/test/fixtures/lightscript/arrow-methods/obj-get/actual.js new file mode 100644 index 0000000000..cd083e1b5e --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/obj-get/actual.js @@ -0,0 +1,5 @@ +x = { + get method() -> + a + b +} diff --git a/test/fixtures/lightscript/arrow-methods/obj-get/expected.json b/test/fixtures/lightscript/arrow-methods/obj-get/expected.json new file mode 100644 index 0000000000..63862cf2fc --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/obj-get/expected.json @@ -0,0 +1,233 @@ +{ + "type": "File", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "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": 37, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 8, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "method" + }, + "name": "method" + }, + "kind": "get", + "variance": null, + "variancePos": 12, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 21, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + { + "type": "ExpressionStatement", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-methods/obj-malformed-async-old/actual.js b/test/fixtures/lightscript/arrow-methods/obj-malformed-async-old/actual.js new file mode 100644 index 0000000000..a9f1dbeb70 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/obj-malformed-async-old/actual.js @@ -0,0 +1,3 @@ +x = { + async method() -> await a +} diff --git a/test/fixtures/lightscript/arrow-methods/obj-malformed-async-old/options.json b/test/fixtures/lightscript/arrow-methods/obj-malformed-async-old/options.json new file mode 100644 index 0000000000..c60643caca --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/obj-malformed-async-old/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Can't use async with lightscript arrows. (2:2)" +} diff --git a/test/fixtures/lightscript/arrow-methods/obj-malformed-oneline/actual.js b/test/fixtures/lightscript/arrow-methods/obj-malformed-oneline/actual.js new file mode 100644 index 0000000000..4115f7d42f --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/obj-malformed-oneline/actual.js @@ -0,0 +1 @@ +x = { method1() -> a b } diff --git a/test/fixtures/lightscript/arrow-methods/obj-malformed-oneline/options.json b/test/fixtures/lightscript/arrow-methods/obj-malformed-oneline/options.json new file mode 100644 index 0000000000..d7a55069fc --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/obj-malformed-oneline/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected , (1:21)" +} diff --git a/test/fixtures/lightscript/arrow-methods/obj-oneline/actual.js b/test/fixtures/lightscript/arrow-methods/obj-oneline/actual.js new file mode 100644 index 0000000000..2b92a1ef22 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/obj-oneline/actual.js @@ -0,0 +1 @@ +x = { method1() -> a, b } diff --git a/test/fixtures/lightscript/arrow-methods/obj-oneline/expected.json b/test/fixtures/lightscript/arrow-methods/obj-oneline/expected.json new file mode 100644 index 0000000000..0e9dade2d1 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/obj-oneline/expected.json @@ -0,0 +1,215 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "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": 25, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "method1" + }, + "name": "method1" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + { + "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": "b" + }, + "name": "b" + }, + "value": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "b" + }, + "name": "b" + }, + "extra": { + "shorthand": true + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-methods/obj-set/actual.js b/test/fixtures/lightscript/arrow-methods/obj-set/actual.js new file mode 100644 index 0000000000..76806af83a --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/obj-set/actual.js @@ -0,0 +1,4 @@ +x = { + set method(y) -> + this.y = y +} diff --git a/test/fixtures/lightscript/arrow-methods/obj-set/expected.json b/test/fixtures/lightscript/arrow-methods/obj-set/expected.json new file mode 100644 index 0000000000..3e70ac7227 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/obj-set/expected.json @@ -0,0 +1,284 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "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": 41, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 8, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "method" + }, + "name": "method" + }, + "kind": "set", + "variance": null, + "variancePos": 12, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 14 + }, + "identifierName": "y" + }, + "name": "y" + } + ], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 22, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 29, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 29, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "operator": "=", + "left": { + "type": "MemberExpression", + "start": 29, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "object": { + "type": "ThisExpression", + "start": 29, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 8 + } + } + }, + "property": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + }, + "identifierName": "y" + }, + "name": "y" + }, + "computed": false + }, + "right": { + "type": "Identifier", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 14 + }, + "identifierName": "y" + }, + "name": "y" + }, + "isNowAssign": false + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-methods/obj-skinny-oneline-stmt/actual.js b/test/fixtures/lightscript/arrow-methods/obj-skinny-oneline-stmt/actual.js new file mode 100644 index 0000000000..b3aa470902 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/obj-skinny-oneline-stmt/actual.js @@ -0,0 +1,3 @@ +x = { + method() -> for idx i in Array(10): i +} diff --git a/test/fixtures/lightscript/arrow-methods/obj-skinny-oneline-stmt/expected.json b/test/fixtures/lightscript/arrow-methods/obj-skinny-oneline-stmt/expected.json new file mode 100644 index 0000000000..7e36959deb --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/obj-skinny-oneline-stmt/expected.json @@ -0,0 +1,285 @@ +{ + "type": "File", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "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": 47, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 8, + "end": 45, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 39 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "method" + }, + "name": "method" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 17, + "end": 45, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 39 + } + }, + "body": [ + { + "type": "ForInArrayStatement", + "start": 20, + "end": 45, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 39 + } + }, + "idx": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 23 + }, + "identifierName": "i" + }, + "name": "i" + }, + "body": { + "type": "ExpressionStatement", + "start": 44, + "end": 45, + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 2, + "column": 39 + } + }, + "expression": { + "type": "Identifier", + "start": 44, + "end": 45, + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 2, + "column": 39 + }, + "identifierName": "i" + }, + "name": "i" + } + }, + "array": { + "type": "CallExpression", + "start": 33, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 36 + } + }, + "callee": { + "type": "Identifier", + "start": 33, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 32 + }, + "identifierName": "Array" + }, + "name": "Array" + }, + "arguments": [ + { + "type": "NumericLiteral", + "start": 39, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 33 + }, + "end": { + "line": 2, + "column": 35 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + ] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-methods/obj-skinny-void/actual.js b/test/fixtures/lightscript/arrow-methods/obj-skinny-void/actual.js new file mode 100644 index 0000000000..aed0423fc2 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/obj-skinny-void/actual.js @@ -0,0 +1,5 @@ +x = { + method(): void -> + a + b +} diff --git a/test/fixtures/lightscript/arrow-methods/obj-skinny-void/expected.json b/test/fixtures/lightscript/arrow-methods/obj-skinny-void/expected.json new file mode 100644 index 0000000000..15ed89696b --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/obj-skinny-void/expected.json @@ -0,0 +1,258 @@ +{ + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "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": 39, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 8, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "method" + }, + "name": "method" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "returnType": { + "type": "TypeAnnotation", + "start": 16, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "typeAnnotation": { + "type": "VoidTypeAnnotation", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 16 + } + } + } + }, + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 23, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + { + "type": "ExpressionStatement", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/arrow-methods/obj-skinny/actual.js b/test/fixtures/lightscript/arrow-methods/obj-skinny/actual.js new file mode 100644 index 0000000000..7fd5fd57fe --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/obj-skinny/actual.js @@ -0,0 +1,5 @@ +x = { + method() -> + a + b +} diff --git a/test/fixtures/lightscript/arrow-methods/obj-skinny/expected.json b/test/fixtures/lightscript/arrow-methods/obj-skinny/expected.json new file mode 100644 index 0000000000..c2675f7c22 --- /dev/null +++ b/test/fixtures/lightscript/arrow-methods/obj-skinny/expected.json @@ -0,0 +1,228 @@ +{ + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "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": 33, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 8, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "method" + }, + "name": "method" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 17, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + { + "type": "ExpressionStatement", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/auto-const/array/actual.js b/test/fixtures/lightscript/auto-const/array/actual.js new file mode 100644 index 0000000000..13befc5d05 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/array/actual.js @@ -0,0 +1 @@ +[a, b] = [] diff --git a/test/fixtures/lightscript/auto-const/array/expected.json b/test/fixtures/lightscript/auto-const/array/expected.json new file mode 100644 index 0000000000..674b84d960 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/array/expected.json @@ -0,0 +1,137 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "ArrayPattern", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + } + ] + }, + "init": { + "type": "ArrayExpression", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "elements": [] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/auto-const/basic-colon-equals/actual.js b/test/fixtures/lightscript/auto-const/basic-colon-equals/actual.js new file mode 100644 index 0000000000..2d76abaa89 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/basic-colon-equals/actual.js @@ -0,0 +1 @@ +x = 42 diff --git a/test/fixtures/lightscript/auto-const/basic-colon-equals/expected.json b/test/fixtures/lightscript/auto-const/basic-colon-equals/expected.json new file mode 100644 index 0000000000..5d4bfe5765 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/basic-colon-equals/expected.json @@ -0,0 +1,107 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "NumericLiteral", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/auto-const/basic-typed/actual.js b/test/fixtures/lightscript/auto-const/basic-typed/actual.js new file mode 100644 index 0000000000..4da543ae31 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/basic-typed/actual.js @@ -0,0 +1 @@ +a: number = 3 diff --git a/test/fixtures/lightscript/auto-const/basic-typed/expected.json b/test/fixtures/lightscript/auto-const/basic-typed/expected.json new file mode 100644 index 0000000000..d1ea12a1ab --- /dev/null +++ b/test/fixtures/lightscript/auto-const/basic-typed/expected.json @@ -0,0 +1,137 @@ +{ + "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 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "a" + }, + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 3, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 9 + } + } + } + } + }, + "init": { + "type": "NumericLiteral", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/auto-const/export-object/actual.js b/test/fixtures/lightscript/auto-const/export-object/actual.js new file mode 100644 index 0000000000..4c236d52fb --- /dev/null +++ b/test/fixtures/lightscript/auto-const/export-object/actual.js @@ -0,0 +1 @@ +export {x} = {} diff --git a/test/fixtures/lightscript/auto-const/export-object/expected.json b/test/fixtures/lightscript/auto-const/export-object/expected.json new file mode 100644 index 0000000000..2de0157c7b --- /dev/null +++ b/test/fixtures/lightscript/auto-const/export-object/expected.json @@ -0,0 +1,173 @@ +{ + "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": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 7, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": { + "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": "x" + }, + "name": "x" + }, + "value": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "x" + }, + "name": "x" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": { + "type": "ObjectExpression", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "properties": [] + } + } + ], + "kind": "const" + }, + "exportKind": "value" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2017/async-functions/export-arrow/options.json b/test/fixtures/lightscript/auto-const/export-object/options.json similarity index 100% rename from test/fixtures/es2017/async-functions/export-arrow/options.json rename to test/fixtures/lightscript/auto-const/export-object/options.json diff --git a/test/fixtures/lightscript/auto-const/export-typed-array/actual.js b/test/fixtures/lightscript/auto-const/export-typed-array/actual.js new file mode 100644 index 0000000000..f85796c7bf --- /dev/null +++ b/test/fixtures/lightscript/auto-const/export-typed-array/actual.js @@ -0,0 +1 @@ +export [x, y]: A = [] diff --git a/test/fixtures/lightscript/auto-const/export-typed-array/expected.json b/test/fixtures/lightscript/auto-const/export-typed-array/expected.json new file mode 100644 index 0000000000..ec7e6c4264 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/export-typed-array/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 7, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "ArrayPattern", + "start": 7, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "x" + }, + "name": "x" + }, + { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "y" + }, + "name": "y" + } + ], + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "A" + }, + "name": "A" + } + } + } + }, + "init": { + "type": "ArrayExpression", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "elements": [] + } + } + ], + "kind": "const" + }, + "exportKind": "value" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2017/async-functions/export/options.json b/test/fixtures/lightscript/auto-const/export-typed-array/options.json similarity index 100% rename from test/fixtures/es2017/async-functions/export/options.json rename to test/fixtures/lightscript/auto-const/export-typed-array/options.json diff --git a/test/fixtures/lightscript/auto-const/export-typed-object/actual.js b/test/fixtures/lightscript/auto-const/export-typed-object/actual.js new file mode 100644 index 0000000000..f4fd2a49a3 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/export-typed-object/actual.js @@ -0,0 +1 @@ +export {x, y}: A = {} diff --git a/test/fixtures/lightscript/auto-const/export-typed-object/expected.json b/test/fixtures/lightscript/auto-const/export-typed-object/expected.json new file mode 100644 index 0000000000..6b95e19407 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/export-typed-object/expected.json @@ -0,0 +1,276 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 7, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "ObjectPattern", + "start": 7, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "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": "x" + }, + "name": "x" + }, + "value": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "x" + }, + "name": "x" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "y" + }, + "name": "y" + }, + "value": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "y" + }, + "name": "y" + }, + "extra": { + "shorthand": true + } + } + ], + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "A" + }, + "name": "A" + } + } + } + }, + "init": { + "type": "ObjectExpression", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "properties": [] + } + } + ], + "kind": "const" + }, + "exportKind": "value" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/decorators/export-decorators-on-class/options.json b/test/fixtures/lightscript/auto-const/export-typed-object/options.json similarity index 100% rename from test/fixtures/experimental/decorators/export-decorators-on-class/options.json rename to test/fixtures/lightscript/auto-const/export-typed-object/options.json diff --git a/test/fixtures/lightscript/auto-const/export-typed/actual.js b/test/fixtures/lightscript/auto-const/export-typed/actual.js new file mode 100644 index 0000000000..436def1591 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/export-typed/actual.js @@ -0,0 +1 @@ +export x: number = 42 diff --git a/test/fixtures/lightscript/auto-const/export-typed/expected.json b/test/fixtures/lightscript/auto-const/export-typed/expected.json new file mode 100644 index 0000000000..2c819cc0da --- /dev/null +++ b/test/fixtures/lightscript/auto-const/export-typed/expected.json @@ -0,0 +1,152 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 7, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 7, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "x" + }, + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 8, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 10, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 16 + } + } + } + } + }, + "init": { + "type": "NumericLiteral", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ], + "kind": "const" + }, + "exportKind": "value" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/auto-const/export-typed/options.json b/test/fixtures/lightscript/auto-const/export-typed/options.json new file mode 100644 index 0000000000..2104ca4328 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/export-typed/options.json @@ -0,0 +1,3 @@ +{ + "sourceType": "module" +} diff --git a/test/fixtures/lightscript/auto-const/export-with-extensions/actual.js b/test/fixtures/lightscript/auto-const/export-with-extensions/actual.js new file mode 100644 index 0000000000..f3436753d6 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/export-with-extensions/actual.js @@ -0,0 +1 @@ +export x = 42 diff --git a/test/fixtures/lightscript/auto-const/export-with-extensions/expected.json b/test/fixtures/lightscript/auto-const/export-with-extensions/expected.json new file mode 100644 index 0000000000..ae7d0223e2 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/export-with-extensions/expected.json @@ -0,0 +1,122 @@ +{ + "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": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "NumericLiteral", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ], + "kind": "const" + }, + "exportKind": "value" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/auto-const/export-with-extensions/options.json b/test/fixtures/lightscript/auto-const/export-with-extensions/options.json new file mode 100644 index 0000000000..24849d4304 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/export-with-extensions/options.json @@ -0,0 +1,4 @@ +{ + "sourceType": "module", + "plugins": ["lightscript", "exportExtensions", "flow"] +} diff --git a/test/fixtures/lightscript/auto-const/export/actual.js b/test/fixtures/lightscript/auto-const/export/actual.js new file mode 100644 index 0000000000..f3436753d6 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/export/actual.js @@ -0,0 +1 @@ +export x = 42 diff --git a/test/fixtures/lightscript/auto-const/export/expected.json b/test/fixtures/lightscript/auto-const/export/expected.json new file mode 100644 index 0000000000..ae7d0223e2 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/export/expected.json @@ -0,0 +1,122 @@ +{ + "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": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "NumericLiteral", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ], + "kind": "const" + }, + "exportKind": "value" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/auto-const/export/options.json b/test/fixtures/lightscript/auto-const/export/options.json new file mode 100644 index 0000000000..2104ca4328 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/export/options.json @@ -0,0 +1,3 @@ +{ + "sourceType": "module" +} diff --git a/test/fixtures/lightscript/auto-const/multicond-multiline-if-assign/actual.js b/test/fixtures/lightscript/auto-const/multicond-multiline-if-assign/actual.js new file mode 100644 index 0000000000..4036da3cce --- /dev/null +++ b/test/fixtures/lightscript/auto-const/multicond-multiline-if-assign/actual.js @@ -0,0 +1,4 @@ +if cond1 and + cond2 and + cond3: + b = c diff --git a/test/fixtures/lightscript/auto-const/multicond-multiline-if-assign/expected.json b/test/fixtures/lightscript/auto-const/multicond-multiline-if-assign/expected.json new file mode 100644 index 0000000000..3aae2d3eed --- /dev/null +++ b/test/fixtures/lightscript/auto-const/multicond-multiline-if-assign/expected.json @@ -0,0 +1,224 @@ +{ + "type": "File", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "test": { + "type": "LogicalExpression", + "start": 3, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "left": { + "type": "LogicalExpression", + "start": 3, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "left": { + "type": "Identifier", + "start": 3, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "cond1" + }, + "name": "cond1" + }, + "operator": "&&", + "right": { + "type": "Identifier", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "cond2" + }, + "name": "cond2" + } + }, + "operator": "&&", + "right": { + "type": "Identifier", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 7 + }, + "identifierName": "cond3" + }, + "name": "cond3" + } + }, + "consequent": { + "type": "BlockStatement", + "start": 32, + "end": 43, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 38, + "end": 43, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 38, + "end": 43, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + }, + "init": { + "type": "Identifier", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + }, + "identifierName": "c" + }, + "name": "c" + } + } + ] + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/auto-const/multicond-oneline-if-member/actual.js b/test/fixtures/lightscript/auto-const/multicond-oneline-if-member/actual.js new file mode 100644 index 0000000000..3641b67c33 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/multicond-oneline-if-member/actual.js @@ -0,0 +1,3 @@ +if cond1 and + cond2 and + cond3: A.B = c diff --git a/test/fixtures/lightscript/auto-const/multicond-oneline-if-member/expected.json b/test/fixtures/lightscript/auto-const/multicond-oneline-if-member/expected.json new file mode 100644 index 0000000000..0746f87140 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/multicond-oneline-if-member/expected.json @@ -0,0 +1,232 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "test": { + "type": "LogicalExpression", + "start": 3, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "left": { + "type": "LogicalExpression", + "start": 3, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "left": { + "type": "Identifier", + "start": 3, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "cond1" + }, + "name": "cond1" + }, + "operator": "&&", + "right": { + "type": "Identifier", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "cond2" + }, + "name": "cond2" + } + }, + "operator": "&&", + "right": { + "type": "Identifier", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 7 + }, + "identifierName": "cond3" + }, + "name": "cond3" + } + }, + "consequent": { + "type": "ExpressionStatement", + "start": 34, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 34, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "operator": "=", + "left": { + "type": "MemberExpression", + "start": 34, + "end": 37, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 12 + } + }, + "object": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + }, + "identifierName": "A" + }, + "name": "A" + }, + "property": { + "type": "Identifier", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 3, + "column": 11 + }, + "end": { + "line": 3, + "column": 12 + }, + "identifierName": "B" + }, + "name": "B" + }, + "computed": false + }, + "right": { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 16 + }, + "identifierName": "c" + }, + "name": "c" + }, + "isNowAssign": false + } + }, + "alternate": null + } + ], + "directives": [] + } +} diff --git a/test/fixtures/lightscript/auto-const/multicond-oneline-if-now/actual.js b/test/fixtures/lightscript/auto-const/multicond-oneline-if-now/actual.js new file mode 100644 index 0000000000..7b515f69fa --- /dev/null +++ b/test/fixtures/lightscript/auto-const/multicond-oneline-if-now/actual.js @@ -0,0 +1,3 @@ +if cond1 and + cond2 and + cond3: now b = c diff --git a/test/fixtures/lightscript/auto-const/multicond-oneline-if-now/expected.json b/test/fixtures/lightscript/auto-const/multicond-oneline-if-now/expected.json new file mode 100644 index 0000000000..cc2d7fc5e5 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/multicond-oneline-if-now/expected.json @@ -0,0 +1,199 @@ +{ + "type": "File", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 18 + } + }, + "test": { + "type": "LogicalExpression", + "start": 3, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "left": { + "type": "LogicalExpression", + "start": 3, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "left": { + "type": "Identifier", + "start": 3, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "cond1" + }, + "name": "cond1" + }, + "operator": "&&", + "right": { + "type": "Identifier", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "cond2" + }, + "name": "cond2" + } + }, + "operator": "&&", + "right": { + "type": "Identifier", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 7 + }, + "identifierName": "cond3" + }, + "name": "cond3" + } + }, + "consequent": { + "type": "ExpressionStatement", + "start": 34, + "end": 43, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 18 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 34, + "end": 43, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 18 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 14 + }, + "identifierName": "b" + }, + "name": "b" + }, + "right": { + "type": "Identifier", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 3, + "column": 17 + }, + "end": { + "line": 3, + "column": 18 + }, + "identifierName": "c" + }, + "name": "c" + }, + "isNowAssign": true + } + }, + "alternate": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/auto-const/not-newline-colon-const/actual.js b/test/fixtures/lightscript/auto-const/not-newline-colon-const/actual.js new file mode 100644 index 0000000000..cf6f70d032 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/not-newline-colon-const/actual.js @@ -0,0 +1 @@ +x; a = 1 diff --git a/test/fixtures/lightscript/auto-const/not-newline-colon-const/expected.json b/test/fixtures/lightscript/auto-const/not-newline-colon-const/expected.json new file mode 100644 index 0000000000..0784086d85 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/not-newline-colon-const/expected.json @@ -0,0 +1,139 @@ +{ + "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": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + { + "type": "VariableDeclaration", + "start": 3, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 3, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/auto-const/not-newline-object-malformed-unfortunate/actual.js b/test/fixtures/lightscript/auto-const/not-newline-object-malformed-unfortunate/actual.js new file mode 100644 index 0000000000..cb098de665 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/not-newline-object-malformed-unfortunate/actual.js @@ -0,0 +1 @@ +x; {a, b} = {} diff --git a/test/fixtures/lightscript/auto-const/not-newline-object-malformed-unfortunate/options.json b/test/fixtures/lightscript/auto-const/not-newline-object-malformed-unfortunate/options.json new file mode 100644 index 0000000000..89bfc2d73f --- /dev/null +++ b/test/fixtures/lightscript/auto-const/not-newline-object-malformed-unfortunate/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:10)" +} diff --git a/test/fixtures/lightscript/auto-const/not-newline-typed/actual.js b/test/fixtures/lightscript/auto-const/not-newline-typed/actual.js new file mode 100644 index 0000000000..5afae90d4a --- /dev/null +++ b/test/fixtures/lightscript/auto-const/not-newline-typed/actual.js @@ -0,0 +1 @@ +x; a: A = 1 diff --git a/test/fixtures/lightscript/auto-const/not-newline-typed/expected.json b/test/fixtures/lightscript/auto-const/not-newline-typed/expected.json new file mode 100644 index 0000000000..0ebaa38228 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/not-newline-typed/expected.json @@ -0,0 +1,187 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + { + "type": "VariableDeclaration", + "start": 3, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 3, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 3, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "a" + }, + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + } + } + } + }, + "init": { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/auto-const/object/actual.js b/test/fixtures/lightscript/auto-const/object/actual.js new file mode 100644 index 0000000000..8c9cb4f288 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/object/actual.js @@ -0,0 +1 @@ +{a, b} = {} diff --git a/test/fixtures/lightscript/auto-const/object/expected.json b/test/fixtures/lightscript/auto-const/object/expected.json new file mode 100644 index 0000000000..e32de2d43c --- /dev/null +++ b/test/fixtures/lightscript/auto-const/object/expected.json @@ -0,0 +1,213 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "ObjectPattern", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "a" + }, + "name": "a" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + }, + "value": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": { + "type": "ObjectExpression", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "properties": [] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/auto-const/onecond-oneline-if-member/actual.js b/test/fixtures/lightscript/auto-const/onecond-oneline-if-member/actual.js new file mode 100644 index 0000000000..14a1853374 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/onecond-oneline-if-member/actual.js @@ -0,0 +1,2 @@ +if + cond: A.B = c diff --git a/test/fixtures/lightscript/auto-const/onecond-oneline-if-member/options.json b/test/fixtures/lightscript/auto-const/onecond-oneline-if-member/options.json new file mode 100644 index 0000000000..56350acd23 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/onecond-oneline-if-member/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Illegal newline. (1:2)" +} diff --git a/test/fixtures/lightscript/auto-const/typed-object/actual.js b/test/fixtures/lightscript/auto-const/typed-object/actual.js new file mode 100644 index 0000000000..e6a99b3ec3 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/typed-object/actual.js @@ -0,0 +1 @@ +{a, b}: A = {} diff --git a/test/fixtures/lightscript/auto-const/typed-object/expected.json b/test/fixtures/lightscript/auto-const/typed-object/expected.json new file mode 100644 index 0000000000..0885136bfa --- /dev/null +++ b/test/fixtures/lightscript/auto-const/typed-object/expected.json @@ -0,0 +1,261 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "ObjectPattern", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "a" + }, + "name": "a" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + }, + "value": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + }, + "extra": { + "shorthand": true + } + } + ], + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "A" + }, + "name": "A" + } + } + } + }, + "init": { + "type": "ObjectExpression", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "properties": [] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/auto-const/typed-qualified/actual.js b/test/fixtures/lightscript/auto-const/typed-qualified/actual.js new file mode 100644 index 0000000000..9d753ccf13 --- /dev/null +++ b/test/fixtures/lightscript/auto-const/typed-qualified/actual.js @@ -0,0 +1 @@ +a: A.A = {} diff --git a/test/fixtures/lightscript/auto-const/typed-qualified/expected.json b/test/fixtures/lightscript/auto-const/typed-qualified/expected.json new file mode 100644 index 0000000000..cb103c6e2f --- /dev/null +++ b/test/fixtures/lightscript/auto-const/typed-qualified/expected.json @@ -0,0 +1,183 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "a" + }, + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 3, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "typeParameters": null, + "id": { + "type": "QualifiedTypeIdentifier", + "start": 3, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "qualification": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "A" + }, + "name": "A" + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "A" + }, + "name": "A" + } + } + } + } + }, + "init": { + "type": "ObjectExpression", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "properties": [] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/arr-basic/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-basic/actual.js new file mode 100644 index 0000000000..fc0a1a3983 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-basic/actual.js @@ -0,0 +1,2 @@ +a +[b] diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/arr-basic/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-basic/expected.json new file mode 100644 index 0000000000..2e7e34cab7 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-basic/expected.json @@ -0,0 +1,115 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + { + "type": "ExpressionStatement", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 2 + }, + "identifierName": "b" + }, + "name": "b" + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-1/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-1/actual.js new file mode 100644 index 0000000000..7c909d22ec --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-1/actual.js @@ -0,0 +1,2 @@ + a + [b] diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-1/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-1/expected.json new file mode 100644 index 0000000000..6bb1e9e2ef --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-1/expected.json @@ -0,0 +1,115 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + { + "type": "ExpressionStatement", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + }, + "identifierName": "b" + }, + "name": "b" + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-2/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-2/actual.js new file mode 100644 index 0000000000..f0e0da88f5 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-2/actual.js @@ -0,0 +1,2 @@ + a + [b] diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-2/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-2/expected.json new file mode 100644 index 0000000000..5c31dcbb3d --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-2/expected.json @@ -0,0 +1,115 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + { + "type": "ExpressionStatement", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-3-unfortunate/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-3-unfortunate/actual.js new file mode 100644 index 0000000000..341b34fde5 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-3-unfortunate/actual.js @@ -0,0 +1,2 @@ + a + [b] diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-3-unfortunate/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-3-unfortunate/expected.json new file mode 100644 index 0000000000..0678ddcd20 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-3-unfortunate/expected.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "expression": { + "type": "MemberExpression", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "object": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "a" + }, + "name": "a" + }, + "property": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "b" + }, + "name": "b" + }, + "computed": true + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-4/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-4/actual.js new file mode 100644 index 0000000000..d814cd0569 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-4/actual.js @@ -0,0 +1,2 @@ + a + [b] diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-4/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-4/expected.json new file mode 100644 index 0000000000..33fabeb8c5 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-4/expected.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 2, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "expression": { + "type": "MemberExpression", + "start": 2, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "object": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "b" + }, + "name": "b" + }, + "computed": true + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-5/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-5/actual.js new file mode 100644 index 0000000000..b3254e00cb --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-5/actual.js @@ -0,0 +1,2 @@ + a + b + [b] diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-5/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-5/expected.json new file mode 100644 index 0000000000..6c0ad6e06d --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-funny-indent-5/expected.json @@ -0,0 +1,132 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 2, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 2, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "left": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "operator": "+", + "right": { + "type": "MemberExpression", + "start": 8, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "object": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "b" + }, + "name": "b" + }, + "property": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "b" + }, + "name": "b" + }, + "computed": true + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/arr-indented-subscript-multiline/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-indented-subscript-multiline/actual.js new file mode 100644 index 0000000000..ec028ff2b2 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-indented-subscript-multiline/actual.js @@ -0,0 +1,6 @@ +a + .b + [c] + .d() + [e] +[f] diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/arr-indented-subscript-multiline/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-indented-subscript-multiline/expected.json new file mode 100644 index 0000000000..3f39676f58 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-indented-subscript-multiline/expected.json @@ -0,0 +1,263 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "object": { + "type": "CallExpression", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "callee": { + "type": "MemberExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 4 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "property": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + }, + "identifierName": "b" + }, + "name": "b" + }, + "computed": false + }, + "property": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 4 + }, + "identifierName": "c" + }, + "name": "c" + }, + "computed": true + }, + "property": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 4, + "column": 3 + }, + "end": { + "line": 4, + "column": 4 + }, + "identifierName": "d" + }, + "name": "d" + }, + "computed": false + }, + "arguments": [] + }, + "property": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 6 + }, + "identifierName": "e" + }, + "name": "e" + }, + "computed": true + } + }, + { + "type": "ExpressionStatement", + "start": 28, + "end": 31, + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 28, + "end": 31, + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 6, + "column": 1 + }, + "end": { + "line": 6, + "column": 2 + }, + "identifierName": "f" + }, + "name": "f" + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/arr-indented-subscript/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-indented-subscript/actual.js new file mode 100644 index 0000000000..c33c51acd2 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-indented-subscript/actual.js @@ -0,0 +1,2 @@ +a + [b] diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/arr-indented-subscript/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-indented-subscript/expected.json new file mode 100644 index 0000000000..e3b156e813 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/arr-indented-subscript/expected.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "property": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + }, + "identifierName": "b" + }, + "name": "b" + }, + "computed": true + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/arrow-newline/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/arrow-newline/actual.js new file mode 100644 index 0000000000..5be06da6be --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/arrow-newline/actual.js @@ -0,0 +1,2 @@ +(x) +=> 1 diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/arrow-newline/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/arrow-newline/expected.json new file mode 100644 index 0000000000..c9d418defe --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/arrow-newline/expected.json @@ -0,0 +1,126 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "x" + }, + "name": "x", + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + }, + { + "type": "ExpressionStatement", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [], + "skinny": false, + "body": { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/calls-arrow/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/calls-arrow/actual.js new file mode 100644 index 0000000000..792394c5a9 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/calls-arrow/actual.js @@ -0,0 +1,2 @@ +a +(b) => b diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/calls-arrow/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/calls-arrow/expected.json new file mode 100644 index 0000000000..e7dccdd156 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/calls-arrow/expected.json @@ -0,0 +1,137 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + { + "type": "ExpressionStatement", + "start": 2, + "end": 10, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 2, + "end": 10, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 2 + }, + "identifierName": "b" + }, + "name": "b" + } + ], + "skinny": false, + "body": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "b" + }, + "name": "b" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/calls-basic/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/calls-basic/actual.js new file mode 100644 index 0000000000..6a92098cf3 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/calls-basic/actual.js @@ -0,0 +1,2 @@ +a +(b) diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/calls-basic/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/calls-basic/expected.json new file mode 100644 index 0000000000..ce1664b8de --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/calls-basic/expected.json @@ -0,0 +1,102 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + { + "type": "ExpressionStatement", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "expression": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 2 + }, + "identifierName": "b" + }, + "name": "b", + "extra": { + "parenthesized": true, + "parenStart": 2 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/calls-indented/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/calls-indented/actual.js new file mode 100644 index 0000000000..7f78eea49b --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/calls-indented/actual.js @@ -0,0 +1,2 @@ +a + (b) diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/calls-indented/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/calls-indented/expected.json new file mode 100644 index 0000000000..52371d966c --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/calls-indented/expected.json @@ -0,0 +1,102 @@ +{ + "type": "File", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + { + "type": "ExpressionStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + }, + "identifierName": "b" + }, + "name": "b", + "extra": { + "parenthesized": true, + "parenStart": 4 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/dot-access/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/dot-access/actual.js new file mode 100644 index 0000000000..332dc8225c --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/dot-access/actual.js @@ -0,0 +1,2 @@ +a +.b diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/dot-access/options.json b/test/fixtures/lightscript/automatic-semicolon-insertion/dot-access/options.json new file mode 100644 index 0000000000..15b72fccd0 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/dot-access/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Indentation required. (2:0)" +} diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/index-dot-access-indented/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/index-dot-access-indented/actual.js new file mode 100644 index 0000000000..0c26bad655 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/index-dot-access-indented/actual.js @@ -0,0 +1,2 @@ +a + .0 diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/index-dot-access-indented/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/index-dot-access-indented/expected.json new file mode 100644 index 0000000000..af55904438 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/index-dot-access-indented/expected.json @@ -0,0 +1,102 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "property": { + "type": "NumericLiteral", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + "computed": true + } + } + ], + "directives": [] + } +} diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/index-dot-access-not-indented-decimal/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/index-dot-access-not-indented-decimal/actual.js new file mode 100644 index 0000000000..beb929fd9f --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/index-dot-access-not-indented-decimal/actual.js @@ -0,0 +1,2 @@ +a +.0 diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/index-dot-access-not-indented-decimal/options.json b/test/fixtures/lightscript/automatic-semicolon-insertion/index-dot-access-not-indented-decimal/options.json new file mode 100644 index 0000000000..81e6f85e6e --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/index-dot-access-not-indented-decimal/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Either indent for array access or use a leading zero for a decimal. (2:0)" +} diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-1/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-1/actual.js new file mode 100644 index 0000000000..67fbf1ded9 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-1/actual.js @@ -0,0 +1,6 @@ +blah = 1 + +
+
hi
+
hello
+
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 new file mode 100644 index 0000000000..2d4e2da3a3 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-1/expected.json @@ -0,0 +1,450 @@ +{ + "type": "File", + "start": 0, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "blah" + }, + "name": "blah" + }, + "init": { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ] + }, + { + "type": "ExpressionStatement", + "start": 10, + "end": 57, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 6, + "column": 6 + } + }, + "expression": { + "type": "JSXElement", + "start": 10, + "end": 57, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 6, + "column": 6 + } + }, + "openingElement": { + "type": "JSXOpeningElement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "name": "div" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 51, + "end": 57, + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 6 + } + }, + "name": { + "type": "JSXIdentifier", + "start": 53, + "end": 56, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "name": "div" + } + }, + "children": [ + { + "type": "JSXText", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 4, + "column": 2 + } + }, + "extra": null, + "value": "\n " + }, + { + "type": "JSXElement", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 15 + } + }, + "openingElement": { + "type": "JSXOpeningElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 4, + "column": 3 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "name": "div" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 25, + "end": 31, + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 15 + } + }, + "name": { + "type": "JSXIdentifier", + "start": 27, + "end": 30, + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "name": "div" + } + }, + "children": [ + { + "type": "JSXText", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "extra": null, + "value": "hi" + } + ] + }, + { + "type": "JSXText", + "start": 31, + "end": 34, + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 5, + "column": 2 + } + }, + "extra": null, + "value": "\n " + }, + { + "type": "JSXElement", + "start": 34, + "end": 50, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 18 + } + }, + "openingElement": { + "type": "JSXOpeningElement", + "start": 34, + "end": 39, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 35, + "end": 38, + "loc": { + "start": { + "line": 5, + "column": 3 + }, + "end": { + "line": 5, + "column": 6 + } + }, + "name": "div" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 44, + "end": 50, + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 18 + } + }, + "name": { + "type": "JSXIdentifier", + "start": 46, + "end": 49, + "loc": { + "start": { + "line": 5, + "column": 14 + }, + "end": { + "line": 5, + "column": 17 + } + }, + "name": "div" + } + }, + "children": [ + { + "type": "JSXText", + "start": 39, + "end": 44, + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 5, + "column": 12 + } + }, + "extra": null, + "value": "hello" + } + ] + }, + { + "type": "JSXText", + "start": 50, + "end": 51, + "loc": { + "start": { + "line": 5, + "column": 18 + }, + "end": { + "line": 6, + "column": 0 + } + }, + "extra": null, + "value": "\n" + } + ] + } + } + ], + "directives": [] + } +} diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-2/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-2/actual.js new file mode 100644 index 0000000000..d51065e1aa --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-2/actual.js @@ -0,0 +1,2 @@ +blah = 1 + < div diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-2/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-2/expected.json new file mode 100644 index 0000000000..20c87b8dc7 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-2/expected.json @@ -0,0 +1,140 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "blah" + }, + "name": "blah" + }, + "init": { + "type": "BinaryExpression", + "start": 7, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "left": { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "operator": "<", + "right": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "div" + }, + "name": "div" + } + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-3/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-3/actual.js new file mode 100644 index 0000000000..82a607954f --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-3/actual.js @@ -0,0 +1,2 @@ +blah = 1 + <= div diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-3/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-3/expected.json new file mode 100644 index 0000000000..5df0af1b8d --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-3/expected.json @@ -0,0 +1,140 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "blah" + }, + "name": "blah" + }, + "init": { + "type": "BinaryExpression", + "start": 7, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "left": { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "operator": "<=", + "right": { + "type": "Identifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "div" + }, + "name": "div" + } + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-4/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-4/actual.js new file mode 100644 index 0000000000..112b2e6b34 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-4/actual.js @@ -0,0 +1,4 @@ +
+
hi
+
hello
+
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 new file mode 100644 index 0000000000..08abe59e17 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-4/expected.json @@ -0,0 +1,377 @@ +{ + "type": "File", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "expression": { + "type": "JSXElement", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "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": 41, + "end": 47, + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "name": { + "type": "JSXIdentifier", + "start": 43, + "end": 46, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "name": "div" + } + }, + "children": [ + { + "type": "JSXText", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "extra": null, + "value": "\n " + }, + { + "type": "JSXElement", + "start": 8, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "openingElement": { + "type": "JSXOpeningElement", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "name": "div" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 15, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "name": { + "type": "JSXIdentifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "name": "div" + } + }, + "children": [ + { + "type": "JSXText", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "extra": null, + "value": "hi" + } + ] + }, + { + "type": "JSXText", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "extra": null, + "value": "\n " + }, + { + "type": "JSXElement", + "start": 24, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 18 + } + }, + "openingElement": { + "type": "JSXOpeningElement", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 25, + "end": 28, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "name": "div" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 34, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 18 + } + }, + "name": { + "type": "JSXIdentifier", + "start": 36, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "name": "div" + } + }, + "children": [ + { + "type": "JSXText", + "start": 29, + "end": 34, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 12 + } + }, + "extra": null, + "value": "hello" + } + ] + }, + { + "type": "JSXText", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 18 + }, + "end": { + "line": 4, + "column": 0 + } + }, + "extra": null, + "value": "\n" + } + ] + } + } + ], + "directives": [] + } +} diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-self-closing/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-self-closing/actual.js new file mode 100644 index 0000000000..860471c4a4 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-self-closing/actual.js @@ -0,0 +1,2 @@ + \ 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 new file mode 100644 index 0000000000..a9db746b35 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-self-closing/expected.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "expression": { + "type": "JSXElement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "a" + }, + "selfClosing": true + }, + "closingElement": null, + "children": [] + } + } + ] + }, + "comments": [] +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/named-arrow-newline/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/named-arrow-newline/actual.js new file mode 100644 index 0000000000..3149910f70 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/named-arrow-newline/actual.js @@ -0,0 +1,2 @@ +f(x) +=> 1 diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/named-arrow-newline/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/named-arrow-newline/expected.json new file mode 100644 index 0000000000..eadbc65dc8 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/named-arrow-newline/expected.json @@ -0,0 +1,156 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "f" + }, + "name": "f" + }, + "arguments": [ + { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + } + ] + } + }, + { + "type": "ExpressionStatement", + "start": 5, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 5, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [], + "skinny": false, + "body": { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/new/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/new/actual.js new file mode 100644 index 0000000000..b9801e8573 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/new/actual.js @@ -0,0 +1,2 @@ +new X +(() -> return) diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/new/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/new/expected.json new file mode 100644 index 0000000000..a2967bd0f9 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/new/expected.json @@ -0,0 +1,159 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "callee": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "X" + }, + "name": "X" + }, + "arguments": [] + } + }, + { + "type": "ExpressionStatement", + "start": 6, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 7, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 10, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 13, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "argument": null + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "extra": { + "parenthesized": true, + "parenStart": 6 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/op-division-bottom-no-space/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/op-division-bottom-no-space/actual.js new file mode 100644 index 0000000000..72ef819dbf --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/op-division-bottom-no-space/actual.js @@ -0,0 +1,2 @@ +1 +/1 diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/op-division-bottom-no-space/options.json b/test/fixtures/lightscript/automatic-semicolon-insertion/op-division-bottom-no-space/options.json new file mode 100644 index 0000000000..a28037852c --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/op-division-bottom-no-space/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unterminated regular expression (if you wanted division, add a space after the '/'). (2:1)" +} diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/op-division-bottom-space/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/op-division-bottom-space/actual.js new file mode 100644 index 0000000000..c4d937d069 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/op-division-bottom-space/actual.js @@ -0,0 +1,2 @@ +1 +/ 1 diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/op-division-bottom-space/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/op-division-bottom-space/expected.json new file mode 100644 index 0000000000..4e43d52f65 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/op-division-bottom-space/expected.json @@ -0,0 +1,105 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "left": { + "type": "NumericLiteral", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "operator": "/", + "right": { + "type": "NumericLiteral", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/op-minus-bottom-no-space/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/op-minus-bottom-no-space/actual.js new file mode 100644 index 0000000000..94d36aad18 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/op-minus-bottom-no-space/actual.js @@ -0,0 +1,2 @@ +1 +-1 diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/op-minus-bottom-no-space/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/op-minus-bottom-no-space/expected.json new file mode 100644 index 0000000000..792ad51064 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/op-minus-bottom-no-space/expected.json @@ -0,0 +1,124 @@ +{ + "type": "File", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "ExpressionStatement", + "start": 2, + "end": 4, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "expression": { + "type": "UnaryExpression", + "start": 2, + "end": 4, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "operator": "-", + "prefix": true, + "argument": { + "type": "NumericLiteral", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "extra": { + "parenthesizedArgument": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/op-minus-bottom-space/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/op-minus-bottom-space/actual.js new file mode 100644 index 0000000000..954f870b3d --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/op-minus-bottom-space/actual.js @@ -0,0 +1,2 @@ +1 +- 1 diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/op-minus-bottom-space/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/op-minus-bottom-space/expected.json new file mode 100644 index 0000000000..43caff45b4 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/op-minus-bottom-space/expected.json @@ -0,0 +1,105 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "left": { + "type": "NumericLiteral", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "operator": "-", + "right": { + "type": "NumericLiteral", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/op-minus-top/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/op-minus-top/actual.js new file mode 100644 index 0000000000..433cda14b5 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/op-minus-top/actual.js @@ -0,0 +1,2 @@ +1 - +1 diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/op-minus-top/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/op-minus-top/expected.json new file mode 100644 index 0000000000..632bd7a429 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/op-minus-top/expected.json @@ -0,0 +1,105 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "left": { + "type": "NumericLiteral", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "operator": "-", + "right": { + "type": "NumericLiteral", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/op-times-bottom-no-space/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/op-times-bottom-no-space/actual.js new file mode 100644 index 0000000000..8c86224b96 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/op-times-bottom-no-space/actual.js @@ -0,0 +1,2 @@ +1 +*1 diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/op-times-bottom-no-space/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/op-times-bottom-no-space/expected.json new file mode 100644 index 0000000000..314b77e731 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/op-times-bottom-no-space/expected.json @@ -0,0 +1,105 @@ +{ + "type": "File", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "left": { + "type": "NumericLiteral", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "operator": "*", + "right": { + "type": "NumericLiteral", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/regexp-false-oneline/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/regexp-false-oneline/actual.js new file mode 100644 index 0000000000..fcadf4d53e --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/regexp-false-oneline/actual.js @@ -0,0 +1 @@ +a /1/g diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/regexp-false-oneline/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/regexp-false-oneline/expected.json new file mode 100644 index 0000000000..649583d987 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/regexp-false-oneline/expected.json @@ -0,0 +1,135 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "operator": "/", + "right": { + "type": "NumericLiteral", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + "operator": "/", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "g" + }, + "name": "g" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/regexp-literal-escaped-space/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/regexp-literal-escaped-space/actual.js new file mode 100644 index 0000000000..6a2241d660 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/regexp-literal-escaped-space/actual.js @@ -0,0 +1 @@ +/\ 1/g diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/regexp-literal-escaped-space/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/regexp-literal-escaped-space/expected.json new file mode 100644 index 0000000000..4fd2152f02 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/regexp-literal-escaped-space/expected.json @@ -0,0 +1,69 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "RegExpLiteral", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "raw": "/\\ 1/g" + }, + "pattern": "\\ 1", + "flags": "g" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/regexp-literal-starts-with-space/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/regexp-literal-starts-with-space/actual.js new file mode 100644 index 0000000000..8735a60756 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/regexp-literal-starts-with-space/actual.js @@ -0,0 +1 @@ +/ 1/g diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/regexp-literal-starts-with-space/options.json b/test/fixtures/lightscript/automatic-semicolon-insertion/regexp-literal-starts-with-space/options.json new file mode 100644 index 0000000000..e53256699a --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/regexp-literal-starts-with-space/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Regex literals cannot start with a space in lightscript; try '\\s' or '\\ ' instead. (1:1)" +} diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/regexp-literal/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/regexp-literal/actual.js new file mode 100644 index 0000000000..2dbfe460e8 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/regexp-literal/actual.js @@ -0,0 +1,2 @@ +a +/1/g diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/regexp-literal/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/regexp-literal/expected.json new file mode 100644 index 0000000000..e9e03368f8 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/regexp-literal/expected.json @@ -0,0 +1,101 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + { + "type": "ExpressionStatement", + "start": 2, + "end": 6, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "expression": { + "type": "RegExpLiteral", + "start": 2, + "end": 6, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "extra": { + "raw": "/1/g" + }, + "pattern": "1", + "flags": "g" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/tagged-template-newline/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/tagged-template-newline/actual.js new file mode 100644 index 0000000000..d941c04bb9 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/tagged-template-newline/actual.js @@ -0,0 +1,2 @@ +hello +`world` diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/tagged-template-newline/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/tagged-template-newline/expected.json new file mode 100644 index 0000000000..8542fae75b --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/tagged-template-newline/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "hello" + }, + "name": "hello" + } + }, + { + "type": "ExpressionStatement", + "start": 6, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 6, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 7, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "value": { + "raw": "world", + "cooked": "world" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/tagged-template-no-newline/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/tagged-template-no-newline/actual.js new file mode 100644 index 0000000000..4003c28c8d --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/tagged-template-no-newline/actual.js @@ -0,0 +1,2 @@ +hello` +world` diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/tagged-template-no-newline/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/tagged-template-no-newline/expected.json new file mode 100644 index 0000000000..6034481f20 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/tagged-template-no-newline/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 5, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "value": { + "raw": "\nworld", + "cooked": "\nworld" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/unary-no-space/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/unary-no-space/actual.js new file mode 100644 index 0000000000..556cf174d8 --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/unary-no-space/actual.js @@ -0,0 +1 @@ ++1 diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/unary-no-space/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/unary-no-space/expected.json new file mode 100644 index 0000000000..f92bb91c9e --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/unary-no-space/expected.json @@ -0,0 +1,89 @@ +{ + "type": "File", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "UnaryExpression", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "operator": "+", + "prefix": true, + "argument": { + "type": "NumericLiteral", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "extra": { + "parenthesizedArgument": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/unary-with-space/actual.js b/test/fixtures/lightscript/automatic-semicolon-insertion/unary-with-space/actual.js new file mode 100644 index 0000000000..c6c5b4231c --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/unary-with-space/actual.js @@ -0,0 +1 @@ ++ 1 diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/unary-with-space/options.json b/test/fixtures/lightscript/automatic-semicolon-insertion/unary-with-space/options.json new file mode 100644 index 0000000000..7d72c34d9c --- /dev/null +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/unary-with-space/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unary +/- cannot be followed by a space in lightscript. (1:0)" +} diff --git a/test/fixtures/lightscript/await-arrow/arrow-fn-oneline/actual.js b/test/fixtures/lightscript/await-arrow/arrow-fn-oneline/actual.js new file mode 100644 index 0000000000..23be42e5fc --- /dev/null +++ b/test/fixtures/lightscript/await-arrow/arrow-fn-oneline/actual.js @@ -0,0 +1 @@ +f() -/> <- x diff --git a/test/fixtures/lightscript/await-arrow/arrow-fn-oneline/expected.json b/test/fixtures/lightscript/await-arrow/arrow-fn-oneline/expected.json new file mode 100644 index 0000000000..a6f30b4f33 --- /dev/null +++ b/test/fixtures/lightscript/await-arrow/arrow-fn-oneline/expected.json @@ -0,0 +1,139 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "expression": false, + "async": true, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "AwaitExpression", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "argument": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "x" + }, + "name": "x" + } + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/await-arrow/arrow-fn-safe-oneline/actual.js b/test/fixtures/lightscript/await-arrow/arrow-fn-safe-oneline/actual.js new file mode 100644 index 0000000000..8d6b0a7111 --- /dev/null +++ b/test/fixtures/lightscript/await-arrow/arrow-fn-safe-oneline/actual.js @@ -0,0 +1 @@ +f() -/> + [ x, y = 1 ] <- fetch() diff --git a/test/fixtures/lightscript/await-arrow/assign-arr/expected.json b/test/fixtures/lightscript/await-arrow/assign-arr/expected.json new file mode 100644 index 0000000000..735465fcc7 --- /dev/null +++ b/test/fixtures/lightscript/await-arrow/assign-arr/expected.json @@ -0,0 +1,260 @@ +{ + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "expression": false, + "async": true, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 4, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 10, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 10, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "id": { + "type": "ArrayPattern", + "start": 10, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + { + "type": "AssignmentPattern", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "left": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "y" + }, + "name": "y" + }, + "right": { + "type": "NumericLiteral", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "isNowAssign": false + } + ] + }, + "init": { + "type": "AwaitExpression", + "start": 23, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "argument": { + "type": "CallExpression", + "start": 26, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "callee": { + "type": "Identifier", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 23 + }, + "identifierName": "fetch" + }, + "name": "fetch" + }, + "arguments": [] + } + } + } + ] + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/await-arrow/assign-obj/actual.js b/test/fixtures/lightscript/await-arrow/assign-obj/actual.js new file mode 100644 index 0000000000..8741167afc --- /dev/null +++ b/test/fixtures/lightscript/await-arrow/assign-obj/actual.js @@ -0,0 +1,2 @@ +a() -/> + { x, y = 1 } <- fetch() diff --git a/test/fixtures/lightscript/await-arrow/assign-obj/expected.json b/test/fixtures/lightscript/await-arrow/assign-obj/expected.json new file mode 100644 index 0000000000..d848e3e47b --- /dev/null +++ b/test/fixtures/lightscript/await-arrow/assign-obj/expected.json @@ -0,0 +1,335 @@ +{ + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "expression": false, + "async": true, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 4, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 10, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 10, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "id": { + "type": "ObjectPattern", + "start": 10, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "value": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "y" + }, + "name": "y" + }, + "value": { + "type": "AssignmentPattern", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "left": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "y" + }, + "name": "y" + }, + "right": { + "type": "NumericLiteral", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": { + "type": "AwaitExpression", + "start": 23, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "argument": { + "type": "CallExpression", + "start": 26, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "callee": { + "type": "Identifier", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 23 + }, + "identifierName": "fetch" + }, + "name": "fetch" + }, + "arguments": [] + } + } + } + ] + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/await-arrow/assign-return/actual.js b/test/fixtures/lightscript/await-arrow/assign-return/actual.js new file mode 100644 index 0000000000..81706ec965 --- /dev/null +++ b/test/fixtures/lightscript/await-arrow/assign-return/actual.js @@ -0,0 +1,3 @@ +a() -/> + x = y + <- x diff --git a/test/fixtures/lightscript/await-arrow/assign-return/expected.json b/test/fixtures/lightscript/await-arrow/assign-return/expected.json new file mode 100644 index 0000000000..9be422a329 --- /dev/null +++ b/test/fixtures/lightscript/await-arrow/assign-return/expected.json @@ -0,0 +1,206 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "expression": false, + "async": true, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "y" + }, + "name": "y" + } + } + ] + }, + { + "type": "ExpressionStatement", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "expression": { + "type": "AwaitExpression", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "argument": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 6 + }, + "identifierName": "x" + }, + "name": "x" + } + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/await-arrow/assign/actual.js b/test/fixtures/lightscript/await-arrow/assign/actual.js new file mode 100644 index 0000000000..a40e46c2e7 --- /dev/null +++ b/test/fixtures/lightscript/await-arrow/assign/actual.js @@ -0,0 +1,2 @@ +a() -/> + x <- fetch() diff --git a/test/fixtures/lightscript/await-arrow/assign/expected.json b/test/fixtures/lightscript/await-arrow/assign/expected.json new file mode 100644 index 0000000000..49bb298581 --- /dev/null +++ b/test/fixtures/lightscript/await-arrow/assign/expected.json @@ -0,0 +1,190 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "expression": false, + "async": true, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 10, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 10, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "AwaitExpression", + "start": 12, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "argument": { + "type": "CallExpression", + "start": 15, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "callee": { + "type": "Identifier", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "fetch" + }, + "name": "fetch" + }, + "arguments": [] + } + } + } + ] + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/await-arrow/let-assign-typed/actual.js b/test/fixtures/lightscript/await-arrow/let-assign-typed/actual.js new file mode 100644 index 0000000000..6b79da8284 --- /dev/null +++ b/test/fixtures/lightscript/await-arrow/let-assign-typed/actual.js @@ -0,0 +1,2 @@ +a() -/> + let x: string <- fetch() diff --git a/test/fixtures/lightscript/await-arrow/let-assign-typed/expected.json b/test/fixtures/lightscript/await-arrow/let-assign-typed/expected.json new file mode 100644 index 0000000000..3cb4f90f77 --- /dev/null +++ b/test/fixtures/lightscript/await-arrow/let-assign-typed/expected.json @@ -0,0 +1,220 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "expression": false, + "async": true, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 4, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 10, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 14, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "id": { + "type": "Identifier", + "start": 14, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 15 + } + } + } + } + }, + "init": { + "type": "AwaitExpression", + "start": 24, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "argument": { + "type": "CallExpression", + "start": 27, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "callee": { + "type": "Identifier", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 24 + }, + "identifierName": "fetch" + }, + "name": "fetch" + }, + "arguments": [] + } + } + } + ], + "kind": "let" + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/await-arrow/let-assign/actual.js b/test/fixtures/lightscript/await-arrow/let-assign/actual.js new file mode 100644 index 0000000000..c1e70ea6ad --- /dev/null +++ b/test/fixtures/lightscript/await-arrow/let-assign/actual.js @@ -0,0 +1,2 @@ +a() -/> + let x <- fetch() diff --git a/test/fixtures/lightscript/await-arrow/let-assign/expected.json b/test/fixtures/lightscript/await-arrow/let-assign/expected.json new file mode 100644 index 0000000000..b0c4f2ec48 --- /dev/null +++ b/test/fixtures/lightscript/await-arrow/let-assign/expected.json @@ -0,0 +1,190 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "expression": false, + "async": true, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 4, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 10, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 14, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "AwaitExpression", + "start": 16, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "argument": { + "type": "CallExpression", + "start": 19, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "callee": { + "type": "Identifier", + "start": 19, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 16 + }, + "identifierName": "fetch" + }, + "name": "fetch" + }, + "arguments": [] + } + } + } + ], + "kind": "let" + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/await-arrow/let-safe-assign-typed/actual.js b/test/fixtures/lightscript/await-arrow/let-safe-assign-typed/actual.js new file mode 100644 index 0000000000..ebb517041a --- /dev/null +++ b/test/fixtures/lightscript/await-arrow/let-safe-assign-typed/actual.js @@ -0,0 +1,2 @@ +a() -/> + let x: AsyncResult + let x + now x <- fetch() diff --git a/test/fixtures/lightscript/await-arrow/now-assign/expected.json b/test/fixtures/lightscript/await-arrow/now-assign/expected.json new file mode 100644 index 0000000000..bcf2977fe2 --- /dev/null +++ b/test/fixtures/lightscript/await-arrow/now-assign/expected.json @@ -0,0 +1,207 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "expression": false, + "async": true, + "params": [ + { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + } + ], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 5, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 11, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 11, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "operator": "<-", + "left": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "AwaitExpression", + "start": 17, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "argument": { + "type": "CallExpression", + "start": 20, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "callee": { + "type": "Identifier", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 16 + }, + "identifierName": "fetch" + }, + "name": "fetch" + }, + "arguments": [] + } + }, + "isNowAssign": true + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/await-arrow/prop-assign/actual.js b/test/fixtures/lightscript/await-arrow/prop-assign/actual.js new file mode 100644 index 0000000000..94cc9c9bc6 --- /dev/null +++ b/test/fixtures/lightscript/await-arrow/prop-assign/actual.js @@ -0,0 +1,2 @@ +a() -/> + x.y <- fetch() diff --git a/test/fixtures/lightscript/await-arrow/prop-assign/expected.json b/test/fixtures/lightscript/await-arrow/prop-assign/expected.json new file mode 100644 index 0000000000..106970a2b5 --- /dev/null +++ b/test/fixtures/lightscript/await-arrow/prop-assign/expected.json @@ -0,0 +1,221 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "expression": false, + "async": true, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 4, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 10, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 10, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "operator": "<-", + "left": { + "type": "MemberExpression", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "object": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + }, + "property": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + }, + "computed": false + }, + "right": { + "type": "AwaitExpression", + "start": 14, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "argument": { + "type": "CallExpression", + "start": 17, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "callee": { + "type": "Identifier", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 14 + }, + "identifierName": "fetch" + }, + "name": "fetch" + }, + "arguments": [] + } + } + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/await-arrow/safe-assign-arr-malformed/actual.js b/test/fixtures/lightscript/await-arrow/safe-assign-arr-malformed/actual.js new file mode 100644 index 0000000000..85c307f524 --- /dev/null +++ b/test/fixtures/lightscript/await-arrow/safe-assign-arr-malformed/actual.js @@ -0,0 +1,2 @@ +a() -/> + [ x, y = 1 ] + { x, y = 1 } + x + + <- fetch() diff --git a/test/fixtures/lightscript/await-arrow/statement/expected.json b/test/fixtures/lightscript/await-arrow/statement/expected.json new file mode 100644 index 0000000000..f682dcf223 --- /dev/null +++ b/test/fixtures/lightscript/await-arrow/statement/expected.json @@ -0,0 +1,155 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "expression": false, + "async": true, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 4, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 10, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "expression": { + "type": "AwaitExpression", + "start": 10, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "argument": { + "type": "CallExpression", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "callee": { + "type": "Identifier", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "fetch" + }, + "name": "fetch" + }, + "arguments": [] + } + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/await-arrow/typed-assign/actual.js b/test/fixtures/lightscript/await-arrow/typed-assign/actual.js new file mode 100644 index 0000000000..2f74bafc49 --- /dev/null +++ b/test/fixtures/lightscript/await-arrow/typed-assign/actual.js @@ -0,0 +1,2 @@ +a() -/> + x: string <- fetch() diff --git a/test/fixtures/lightscript/await-arrow/typed-assign/expected.json b/test/fixtures/lightscript/await-arrow/typed-assign/expected.json new file mode 100644 index 0000000000..3859f1092c --- /dev/null +++ b/test/fixtures/lightscript/await-arrow/typed-assign/expected.json @@ -0,0 +1,220 @@ +{ + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "expression": false, + "async": true, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 4, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 10, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 10, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 11, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 13, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 11 + } + } + } + } + }, + "init": { + "type": "AwaitExpression", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "argument": { + "type": "CallExpression", + "start": 23, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "callee": { + "type": "Identifier", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 20 + }, + "identifierName": "fetch" + }, + "name": "fetch" + }, + "arguments": [] + } + } + } + ] + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/await-arrow/typed-safe-assign/actual.js b/test/fixtures/lightscript/await-arrow/typed-safe-assign/actual.js new file mode 100644 index 0000000000..e8758bd57c --- /dev/null +++ b/test/fixtures/lightscript/await-arrow/typed-safe-assign/actual.js @@ -0,0 +1,2 @@ +a() -/> + x: AsyncResult + a = 1 + ;{ + a = 2 + } + a diff --git a/test/fixtures/lightscript/blocks/anonymous-blocks/expected.json b/test/fixtures/lightscript/blocks/anonymous-blocks/expected.json new file mode 100644 index 0000000000..8ee602ab4c --- /dev/null +++ b/test/fixtures/lightscript/blocks/anonymous-blocks/expected.json @@ -0,0 +1,285 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 5, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 10, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ] + }, + { + "type": "BlockStatement", + "start": 19, + "end": 34, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "NumericLiteral", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ] + } + ], + "directives": [], + "extra": { + "curly": true + } + }, + { + "type": "ExpressionStatement", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "expression": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} diff --git a/test/fixtures/lightscript/blocks/broken-curly-blocks/actual.js b/test/fixtures/lightscript/blocks/broken-curly-blocks/actual.js new file mode 100644 index 0000000000..ab65ffc8e6 --- /dev/null +++ b/test/fixtures/lightscript/blocks/broken-curly-blocks/actual.js @@ -0,0 +1,4 @@ +if (true) +{ + 1 + 1 +} diff --git a/test/fixtures/lightscript/blocks/broken-curly-blocks/options.json b/test/fixtures/lightscript/blocks/broken-curly-blocks/options.json new file mode 100644 index 0000000000..951efd6fb4 --- /dev/null +++ b/test/fixtures/lightscript/blocks/broken-curly-blocks/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (3:4)" +} diff --git a/test/fixtures/lightscript/blocks/inconsistent-function-blocks-unfortunate/actual.js b/test/fixtures/lightscript/blocks/inconsistent-function-blocks-unfortunate/actual.js new file mode 100644 index 0000000000..70053d58c6 --- /dev/null +++ b/test/fixtures/lightscript/blocks/inconsistent-function-blocks-unfortunate/actual.js @@ -0,0 +1,4 @@ +function shouldBeBroken() +{ + 1 + 1 +} diff --git a/test/fixtures/lightscript/blocks/inconsistent-function-blocks-unfortunate/expected.json b/test/fixtures/lightscript/blocks/inconsistent-function-blocks-unfortunate/expected.json new file mode 100644 index 0000000000..bb8b255523 --- /dev/null +++ b/test/fixtures/lightscript/blocks/inconsistent-function-blocks-unfortunate/expected.json @@ -0,0 +1,162 @@ +{ + "type": "File", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "shouldBeBroken" + }, + "name": "shouldBeBroken" + }, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 26, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 30, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 30, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "left": { + "type": "NumericLiteral", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ], + "directives": [], + "extra": { + "curly": true + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/arr-basic/actual.js b/test/fixtures/lightscript/commaless/arr-basic/actual.js new file mode 100644 index 0000000000..26baef1d8b --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-basic/actual.js @@ -0,0 +1,4 @@ +[ + 1 + 2 +] diff --git a/test/fixtures/lightscript/commaless/arr-basic/expected.json b/test/fixtures/lightscript/commaless/arr-basic/expected.json new file mode 100644 index 0000000000..4565bab48d --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-basic/expected.json @@ -0,0 +1,106 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/arr-expr-multiline-1-unfortunate/actual.js b/test/fixtures/lightscript/commaless/arr-expr-multiline-1-unfortunate/actual.js new file mode 100644 index 0000000000..b09ca26203 --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-expr-multiline-1-unfortunate/actual.js @@ -0,0 +1,5 @@ +[ + 1 + + 1 + 2 +] diff --git a/test/fixtures/lightscript/commaless/arr-expr-multiline-1-unfortunate/expected.json b/test/fixtures/lightscript/commaless/arr-expr-multiline-1-unfortunate/expected.json new file mode 100644 index 0000000000..49071bc3c3 --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-expr-multiline-1-unfortunate/expected.json @@ -0,0 +1,142 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "elements": [ + { + "type": "BinaryExpression", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "left": { + "type": "NumericLiteral", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/arr-expr-multiline-2-unfortunate/actual.js b/test/fixtures/lightscript/commaless/arr-expr-multiline-2-unfortunate/actual.js new file mode 100644 index 0000000000..89f67205b4 --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-expr-multiline-2-unfortunate/actual.js @@ -0,0 +1,5 @@ +[ + 1 + + 1 + 2 +] diff --git a/test/fixtures/lightscript/commaless/arr-expr-multiline-2-unfortunate/expected.json b/test/fixtures/lightscript/commaless/arr-expr-multiline-2-unfortunate/expected.json new file mode 100644 index 0000000000..ae24063aa1 --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-expr-multiline-2-unfortunate/expected.json @@ -0,0 +1,142 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "elements": [ + { + "type": "BinaryExpression", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "left": { + "type": "NumericLiteral", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/arr-expr-multiline-3/actual.js b/test/fixtures/lightscript/commaless/arr-expr-multiline-3/actual.js new file mode 100644 index 0000000000..a0db43c686 --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-expr-multiline-3/actual.js @@ -0,0 +1,5 @@ +[ + 1 + +1 + 2 +] diff --git a/test/fixtures/lightscript/commaless/arr-expr-multiline-3/expected.json b/test/fixtures/lightscript/commaless/arr-expr-multiline-3/expected.json new file mode 100644 index 0000000000..9f54bde39c --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-expr-multiline-3/expected.json @@ -0,0 +1,146 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + { + "type": "UnaryExpression", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "operator": "+", + "prefix": true, + "argument": { + "type": "NumericLiteral", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "extra": { + "parenthesizedArgument": false + } + }, + { + "type": "NumericLiteral", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + ] + } + } + ], + "directives": [] + } +} diff --git a/test/fixtures/lightscript/commaless/arr-expr-multiline-4-unfortunate/actual.js b/test/fixtures/lightscript/commaless/arr-expr-multiline-4-unfortunate/actual.js new file mode 100644 index 0000000000..9a456b1f12 --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-expr-multiline-4-unfortunate/actual.js @@ -0,0 +1,5 @@ +[ + 1 / + 1 + 2 +] diff --git a/test/fixtures/lightscript/commaless/arr-expr-multiline-4-unfortunate/expected.json b/test/fixtures/lightscript/commaless/arr-expr-multiline-4-unfortunate/expected.json new file mode 100644 index 0000000000..4e9b20c2a7 --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-expr-multiline-4-unfortunate/expected.json @@ -0,0 +1,142 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "elements": [ + { + "type": "BinaryExpression", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "left": { + "type": "NumericLiteral", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "operator": "/", + "right": { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/arr-expr/actual.js b/test/fixtures/lightscript/commaless/arr-expr/actual.js new file mode 100644 index 0000000000..80eff75f98 --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-expr/actual.js @@ -0,0 +1,4 @@ +[ + 1 + 1 + 2 +] diff --git a/test/fixtures/lightscript/commaless/arr-expr/expected.json b/test/fixtures/lightscript/commaless/arr-expr/expected.json new file mode 100644 index 0000000000..e842d672d0 --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-expr/expected.json @@ -0,0 +1,142 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "elements": [ + { + "type": "BinaryExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "left": { + "type": "NumericLiteral", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "NumericLiteral", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/arr-malformed-mixed/actual.js b/test/fixtures/lightscript/commaless/arr-malformed-mixed/actual.js new file mode 100644 index 0000000000..01241f5e56 --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-malformed-mixed/actual.js @@ -0,0 +1,5 @@ +[ + 1 + 2 3 + 4 +] diff --git a/test/fixtures/lightscript/commaless/arr-malformed-mixed/options.json b/test/fixtures/lightscript/commaless/arr-malformed-mixed/options.json new file mode 100644 index 0000000000..a897e18340 --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-malformed-mixed/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected , (3:4)" +} diff --git a/test/fixtures/lightscript/commaless/arr-malformed-oneline/actual.js b/test/fixtures/lightscript/commaless/arr-malformed-oneline/actual.js new file mode 100644 index 0000000000..5a3f03a193 --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-malformed-oneline/actual.js @@ -0,0 +1 @@ +[1 2] diff --git a/test/fixtures/lightscript/commaless/arr-malformed-oneline/options.json b/test/fixtures/lightscript/commaless/arr-malformed-oneline/options.json new file mode 100644 index 0000000000..dcb6ad70e7 --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-malformed-oneline/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected , (1:3)" +} diff --git a/test/fixtures/lightscript/commaless/arr-mixed/actual.js b/test/fixtures/lightscript/commaless/arr-mixed/actual.js new file mode 100644 index 0000000000..adeb42fed0 --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-mixed/actual.js @@ -0,0 +1,5 @@ +[ + 1 + 2, 3 + 4 +] diff --git a/test/fixtures/lightscript/commaless/arr-mixed/expected.json b/test/fixtures/lightscript/commaless/arr-mixed/expected.json new file mode 100644 index 0000000000..ef47edb352 --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-mixed/expected.json @@ -0,0 +1,146 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + }, + { + "type": "NumericLiteral", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + }, + { + "type": "NumericLiteral", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "extra": { + "rawValue": 4, + "raw": "4" + }, + "value": 4 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/arr-pattern/actual.js b/test/fixtures/lightscript/commaless/arr-pattern/actual.js new file mode 100644 index 0000000000..81db35f07d --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-pattern/actual.js @@ -0,0 +1,8 @@ +[ + a + [ + b + c + ] + d +] = [] diff --git a/test/fixtures/lightscript/commaless/arr-pattern/expected.json b/test/fixtures/lightscript/commaless/arr-pattern/expected.json new file mode 100644 index 0000000000..52e82d1fbc --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-pattern/expected.json @@ -0,0 +1,188 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 6 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 6 + } + }, + "id": { + "type": "ArrayPattern", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "ArrayPattern", + "start": 8, + "end": 25, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + }, + { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + }, + "identifierName": "c" + }, + "name": "c" + } + ] + }, + { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + }, + "identifierName": "d" + }, + "name": "d" + } + ] + }, + "init": { + "type": "ArrayExpression", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 6 + } + }, + "elements": [] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/arr-redundant/actual.js b/test/fixtures/lightscript/commaless/arr-redundant/actual.js new file mode 100644 index 0000000000..bcd4c22e57 --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-redundant/actual.js @@ -0,0 +1,4 @@ +[ + 1, + 2, +] diff --git a/test/fixtures/lightscript/commaless/arr-redundant/expected.json b/test/fixtures/lightscript/commaless/arr-redundant/expected.json new file mode 100644 index 0000000000..d8fc170a79 --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-redundant/expected.json @@ -0,0 +1,106 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + { + "type": "NumericLiteral", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/arr-with-paren-expr/actual.js b/test/fixtures/lightscript/commaless/arr-with-paren-expr/actual.js new file mode 100644 index 0000000000..efab10118b --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-with-paren-expr/actual.js @@ -0,0 +1,5 @@ +[ + a + (1 + 1) + b +] diff --git a/test/fixtures/lightscript/commaless/arr-with-paren-expr/expected.json b/test/fixtures/lightscript/commaless/arr-with-paren-expr/expected.json new file mode 100644 index 0000000000..e0bbbed13a --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-with-paren-expr/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "BinaryExpression", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "left": { + "type": "NumericLiteral", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "extra": { + "parenthesized": true, + "parenStart": 8 + } + }, + { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/arr-within-arr/actual.js b/test/fixtures/lightscript/commaless/arr-within-arr/actual.js new file mode 100644 index 0000000000..7c7506bab7 --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-within-arr/actual.js @@ -0,0 +1,5 @@ +[ + a + [b] + c +] diff --git a/test/fixtures/lightscript/commaless/arr-within-arr/expected.json b/test/fixtures/lightscript/commaless/arr-within-arr/expected.json new file mode 100644 index 0000000000..2e37ebed7c --- /dev/null +++ b/test/fixtures/lightscript/commaless/arr-within-arr/expected.json @@ -0,0 +1,134 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "ArrayExpression", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 4 + }, + "identifierName": "b" + }, + "name": "b" + } + ] + }, + { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + }, + "identifierName": "c" + }, + "name": "c" + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/arrow-expr-params/actual.js b/test/fixtures/lightscript/commaless/arrow-expr-params/actual.js new file mode 100644 index 0000000000..fc2ae0eade --- /dev/null +++ b/test/fixtures/lightscript/commaless/arrow-expr-params/actual.js @@ -0,0 +1,4 @@ +( + a + b +) => {} diff --git a/test/fixtures/lightscript/commaless/arrow-expr-params/expected.json b/test/fixtures/lightscript/commaless/arrow-expr-params/expected.json new file mode 100644 index 0000000000..ca10c8f91f --- /dev/null +++ b/test/fixtures/lightscript/commaless/arrow-expr-params/expected.json @@ -0,0 +1,125 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + } + ], + "skinny": false, + "body": { + "type": "BlockStatement", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/call-basic/actual.js b/test/fixtures/lightscript/commaless/call-basic/actual.js new file mode 100644 index 0000000000..8e76f27f52 --- /dev/null +++ b/test/fixtures/lightscript/commaless/call-basic/actual.js @@ -0,0 +1,4 @@ +x( + a + b +) diff --git a/test/fixtures/lightscript/commaless/call-basic/expected.json b/test/fixtures/lightscript/commaless/call-basic/expected.json new file mode 100644 index 0000000000..ee98355340 --- /dev/null +++ b/test/fixtures/lightscript/commaless/call-basic/expected.json @@ -0,0 +1,117 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "arguments": [ + { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/call-fat-fn-1/actual.js b/test/fixtures/lightscript/commaless/call-fat-fn-1/actual.js new file mode 100644 index 0000000000..c86d1dbd24 --- /dev/null +++ b/test/fixtures/lightscript/commaless/call-fat-fn-1/actual.js @@ -0,0 +1,7 @@ +x( + a + () => + 1 + 2 + c +) diff --git a/test/fixtures/lightscript/commaless/call-fat-fn-1/expected.json b/test/fixtures/lightscript/commaless/call-fat-fn-1/expected.json new file mode 100644 index 0000000000..277cdfed79 --- /dev/null +++ b/test/fixtures/lightscript/commaless/call-fat-fn-1/expected.json @@ -0,0 +1,229 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "arguments": [ + { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "ArrowFunctionExpression", + "start": 9, + "end": 26, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": false, + "body": { + "type": "BlockStatement", + "start": 12, + "end": 26, + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "ExpressionStatement", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + }, + { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + }, + "identifierName": "c" + }, + "name": "c" + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/call-fat-fn-2/actual.js b/test/fixtures/lightscript/commaless/call-fat-fn-2/actual.js new file mode 100644 index 0000000000..c7d917f4a4 --- /dev/null +++ b/test/fixtures/lightscript/commaless/call-fat-fn-2/actual.js @@ -0,0 +1,6 @@ +x(a + () => + 1 + 2 + c +) diff --git a/test/fixtures/lightscript/commaless/call-fat-fn-2/expected.json b/test/fixtures/lightscript/commaless/call-fat-fn-2/expected.json new file mode 100644 index 0000000000..8efdc76430 --- /dev/null +++ b/test/fixtures/lightscript/commaless/call-fat-fn-2/expected.json @@ -0,0 +1,229 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "arguments": [ + { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "ArrowFunctionExpression", + "start": 6, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": false, + "body": { + "type": "BlockStatement", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "ExpressionStatement", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + }, + { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + }, + "identifierName": "c" + }, + "name": "c" + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/call-fn/actual.js b/test/fixtures/lightscript/commaless/call-fn/actual.js new file mode 100644 index 0000000000..c3f9729160 --- /dev/null +++ b/test/fixtures/lightscript/commaless/call-fn/actual.js @@ -0,0 +1,6 @@ +x(a + fn() -> + 1 + 2 + c +) diff --git a/test/fixtures/lightscript/commaless/call-fn/expected.json b/test/fixtures/lightscript/commaless/call-fn/expected.json new file mode 100644 index 0000000000..68fd28099b --- /dev/null +++ b/test/fixtures/lightscript/commaless/call-fn/expected.json @@ -0,0 +1,245 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "arguments": [ + { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "NamedArrowExpression", + "start": 6, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 8, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 4 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 11, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "ExpressionStatement", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + }, + { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + }, + "identifierName": "c" + }, + "name": "c" + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/call-mixed/actual.js b/test/fixtures/lightscript/commaless/call-mixed/actual.js new file mode 100644 index 0000000000..26367d84c2 --- /dev/null +++ b/test/fixtures/lightscript/commaless/call-mixed/actual.js @@ -0,0 +1,3 @@ +x(a, b + c +) diff --git a/test/fixtures/lightscript/commaless/call-mixed/expected.json b/test/fixtures/lightscript/commaless/call-mixed/expected.json new file mode 100644 index 0000000000..73fa5f3ced --- /dev/null +++ b/test/fixtures/lightscript/commaless/call-mixed/expected.json @@ -0,0 +1,134 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "arguments": [ + { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "b" + }, + "name": "b" + }, + { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "c" + }, + "name": "c" + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/fn-decl-params/actual.js b/test/fixtures/lightscript/commaless/fn-decl-params/actual.js new file mode 100644 index 0000000000..701788b0f6 --- /dev/null +++ b/test/fixtures/lightscript/commaless/fn-decl-params/actual.js @@ -0,0 +1,4 @@ +function x ( + a + b +) {} diff --git a/test/fixtures/lightscript/commaless/fn-decl-params/expected.json b/test/fixtures/lightscript/commaless/fn-decl-params/expected.json new file mode 100644 index 0000000000..ea6bf81ea4 --- /dev/null +++ b/test/fixtures/lightscript/commaless/fn-decl-params/expected.json @@ -0,0 +1,125 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 4 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 4 + } + }, + "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": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + } + ], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 4 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/fn-named/actual.js b/test/fixtures/lightscript/commaless/fn-named/actual.js new file mode 100644 index 0000000000..5a77a62847 --- /dev/null +++ b/test/fixtures/lightscript/commaless/fn-named/actual.js @@ -0,0 +1,2 @@ +f(a + b) -> 1 diff --git a/test/fixtures/lightscript/commaless/fn-named/expected.json b/test/fixtures/lightscript/commaless/fn-named/expected.json new file mode 100644 index 0000000000..6e02568efd --- /dev/null +++ b/test/fixtures/lightscript/commaless/fn-named/expected.json @@ -0,0 +1,126 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "expression": true, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + } + ], + "skinny": true, + "body": { + "type": "NumericLiteral", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/method-params/actual.js b/test/fixtures/lightscript/commaless/method-params/actual.js new file mode 100644 index 0000000000..bca50b3465 --- /dev/null +++ b/test/fixtures/lightscript/commaless/method-params/actual.js @@ -0,0 +1,4 @@ +x = { + f(a + b) {} +} diff --git a/test/fixtures/lightscript/commaless/method-params/expected.json b/test/fixtures/lightscript/commaless/method-params/expected.json new file mode 100644 index 0000000000..9d8d94e489 --- /dev/null +++ b/test/fixtures/lightscript/commaless/method-params/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "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": 21, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 8, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "f" + }, + "name": "f" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + } + ], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/new-basic/actual.js b/test/fixtures/lightscript/commaless/new-basic/actual.js new file mode 100644 index 0000000000..2a71503a3c --- /dev/null +++ b/test/fixtures/lightscript/commaless/new-basic/actual.js @@ -0,0 +1,4 @@ +new X( + a + b +) diff --git a/test/fixtures/lightscript/commaless/new-basic/expected.json b/test/fixtures/lightscript/commaless/new-basic/expected.json new file mode 100644 index 0000000000..07ec43a6e9 --- /dev/null +++ b/test/fixtures/lightscript/commaless/new-basic/expected.json @@ -0,0 +1,117 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "callee": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "X" + }, + "name": "X" + }, + "arguments": [ + { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/obj-basic/actual.js b/test/fixtures/lightscript/commaless/obj-basic/actual.js new file mode 100644 index 0000000000..86390e8167 --- /dev/null +++ b/test/fixtures/lightscript/commaless/obj-basic/actual.js @@ -0,0 +1,4 @@ +x = { + a: 1 + b: 2 +} diff --git a/test/fixtures/lightscript/commaless/obj-basic/expected.json b/test/fixtures/lightscript/commaless/obj-basic/expected.json new file mode 100644 index 0000000000..f02162a054 --- /dev/null +++ b/test/fixtures/lightscript/commaless/obj-basic/expected.json @@ -0,0 +1,211 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "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": 21, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "NumericLiteral", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "ObjectProperty", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + }, + "value": { + "type": "NumericLiteral", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/obj-computed-async-key/actual.js b/test/fixtures/lightscript/commaless/obj-computed-async-key/actual.js new file mode 100644 index 0000000000..f139aab29c --- /dev/null +++ b/test/fixtures/lightscript/commaless/obj-computed-async-key/actual.js @@ -0,0 +1,4 @@ +x = { + async + b +} diff --git a/test/fixtures/lightscript/commaless/obj-computed-async-key/expected.json b/test/fixtures/lightscript/commaless/obj-computed-async-key/expected.json new file mode 100644 index 0000000000..5ec6dbe169 --- /dev/null +++ b/test/fixtures/lightscript/commaless/obj-computed-async-key/expected.json @@ -0,0 +1,210 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "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": 19, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "method": false, + "shorthand": true, + "key": { + "type": "Identifier", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "async" + }, + "name": "async" + }, + "value": { + "type": "Identifier", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "async" + }, + "name": "async" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + }, + "value": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + }, + "extra": { + "shorthand": true + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/obj-computed-get-key/actual.js b/test/fixtures/lightscript/commaless/obj-computed-get-key/actual.js new file mode 100644 index 0000000000..5a17d1dc86 --- /dev/null +++ b/test/fixtures/lightscript/commaless/obj-computed-get-key/actual.js @@ -0,0 +1,4 @@ +x = { + get + b +} diff --git a/test/fixtures/lightscript/commaless/obj-computed-get-key/expected.json b/test/fixtures/lightscript/commaless/obj-computed-get-key/expected.json new file mode 100644 index 0000000000..0e69c02f19 --- /dev/null +++ b/test/fixtures/lightscript/commaless/obj-computed-get-key/expected.json @@ -0,0 +1,211 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "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": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "get" + }, + "name": "get" + }, + "value": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "get" + }, + "name": "get" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + }, + "value": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + }, + "extra": { + "shorthand": true + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/obj-computed-set-key/actual.js b/test/fixtures/lightscript/commaless/obj-computed-set-key/actual.js new file mode 100644 index 0000000000..2520aba1b6 --- /dev/null +++ b/test/fixtures/lightscript/commaless/obj-computed-set-key/actual.js @@ -0,0 +1,4 @@ +x = { + set + b +} diff --git a/test/fixtures/lightscript/commaless/obj-computed-set-key/expected.json b/test/fixtures/lightscript/commaless/obj-computed-set-key/expected.json new file mode 100644 index 0000000000..0158f922cb --- /dev/null +++ b/test/fixtures/lightscript/commaless/obj-computed-set-key/expected.json @@ -0,0 +1,211 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "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": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "set" + }, + "name": "set" + }, + "value": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "set" + }, + "name": "set" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + }, + "value": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + }, + "extra": { + "shorthand": true + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/obj-computed/actual.js b/test/fixtures/lightscript/commaless/obj-computed/actual.js new file mode 100644 index 0000000000..68188e01a3 --- /dev/null +++ b/test/fixtures/lightscript/commaless/obj-computed/actual.js @@ -0,0 +1,4 @@ +x = { + a + b +} diff --git a/test/fixtures/lightscript/commaless/obj-computed/expected.json b/test/fixtures/lightscript/commaless/obj-computed/expected.json new file mode 100644 index 0000000000..379134dcc3 --- /dev/null +++ b/test/fixtures/lightscript/commaless/obj-computed/expected.json @@ -0,0 +1,211 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "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": 15, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + }, + "value": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + }, + "extra": { + "shorthand": true + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/obj-generator/actual.js b/test/fixtures/lightscript/commaless/obj-generator/actual.js new file mode 100644 index 0000000000..5cca614df0 --- /dev/null +++ b/test/fixtures/lightscript/commaless/obj-generator/actual.js @@ -0,0 +1,4 @@ +x = { + a + * b() {} +} diff --git a/test/fixtures/lightscript/commaless/obj-generator/expected.json b/test/fixtures/lightscript/commaless/obj-generator/expected.json new file mode 100644 index 0000000000..0efaa6d492 --- /dev/null +++ b/test/fixtures/lightscript/commaless/obj-generator/expected.json @@ -0,0 +1,217 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "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": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectMethod", + "start": 12, + "end": 20, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + }, + "kind": "method", + "id": null, + "generator": true, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/obj-methods/actual.js b/test/fixtures/lightscript/commaless/obj-methods/actual.js new file mode 100644 index 0000000000..c5f91bf341 --- /dev/null +++ b/test/fixtures/lightscript/commaless/obj-methods/actual.js @@ -0,0 +1,7 @@ +x = { + f() -> + 1 + 2 + async g() {} + h() {} +} diff --git a/test/fixtures/lightscript/commaless/obj-methods/expected.json b/test/fixtures/lightscript/commaless/obj-methods/expected.json new file mode 100644 index 0000000000..73cac13172 --- /dev/null +++ b/test/fixtures/lightscript/commaless/obj-methods/expected.json @@ -0,0 +1,356 @@ +{ + "type": "File", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "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": 52, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 8, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "f" + }, + "name": "f" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 12, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "ExpressionStatement", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + }, + { + "type": "ObjectMethod", + "start": 29, + "end": 41, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 14 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 5, + "column": 9 + }, + "identifierName": "g" + }, + "name": "g" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start": 39, + "end": 41, + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 14 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + }, + { + "type": "ObjectMethod", + "start": 44, + "end": 50, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 8 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 44, + "end": 45, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + }, + "identifierName": "h" + }, + "name": "h" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 48, + "end": 50, + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 8 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/obj-mixed/actual.js b/test/fixtures/lightscript/commaless/obj-mixed/actual.js new file mode 100644 index 0000000000..a235465d25 --- /dev/null +++ b/test/fixtures/lightscript/commaless/obj-mixed/actual.js @@ -0,0 +1,5 @@ +x = { + a: 1, b + c: 2 + d +} diff --git a/test/fixtures/lightscript/commaless/obj-mixed/expected.json b/test/fixtures/lightscript/commaless/obj-mixed/expected.json new file mode 100644 index 0000000000..cdca80bbf4 --- /dev/null +++ b/test/fixtures/lightscript/commaless/obj-mixed/expected.json @@ -0,0 +1,321 @@ +{ + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "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": 28, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "NumericLiteral", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "ObjectProperty", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "b" + }, + "name": "b" + }, + "value": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "b" + }, + "name": "b" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "c" + }, + "name": "c" + }, + "value": { + "type": "NumericLiteral", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + }, + { + "type": "ObjectProperty", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + }, + "identifierName": "d" + }, + "name": "d" + }, + "value": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + }, + "identifierName": "d" + }, + "name": "d" + }, + "extra": { + "shorthand": true + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/obj-pattern/actual.js b/test/fixtures/lightscript/commaless/obj-pattern/actual.js new file mode 100644 index 0000000000..2fecf2a794 --- /dev/null +++ b/test/fixtures/lightscript/commaless/obj-pattern/actual.js @@ -0,0 +1,8 @@ +{ + a + b: { + c + d + } + e +} = f diff --git a/test/fixtures/lightscript/commaless/obj-pattern/expected.json b/test/fixtures/lightscript/commaless/obj-pattern/expected.json new file mode 100644 index 0000000000..628943a027 --- /dev/null +++ b/test/fixtures/lightscript/commaless/obj-pattern/expected.json @@ -0,0 +1,376 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "id": { + "type": "ObjectPattern", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 8, + "end": 28, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + }, + "value": { + "type": "ObjectPattern", + "start": 11, + "end": 28, + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + }, + "identifierName": "c" + }, + "name": "c" + }, + "value": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + }, + "identifierName": "c" + }, + "name": "c" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + }, + "identifierName": "d" + }, + "name": "d" + }, + "value": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + }, + "identifierName": "d" + }, + "name": "d" + }, + "extra": { + "shorthand": true + } + } + ] + } + }, + { + "type": "ObjectProperty", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + }, + "identifierName": "e" + }, + "name": "e" + }, + "value": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + }, + "identifierName": "e" + }, + "name": "e" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 5 + }, + "identifierName": "f" + }, + "name": "f" + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/obj-redundant/actual.js b/test/fixtures/lightscript/commaless/obj-redundant/actual.js new file mode 100644 index 0000000000..db74f4de1b --- /dev/null +++ b/test/fixtures/lightscript/commaless/obj-redundant/actual.js @@ -0,0 +1,4 @@ +x = { + a: 1, + d, +} diff --git a/test/fixtures/lightscript/commaless/obj-redundant/expected.json b/test/fixtures/lightscript/commaless/obj-redundant/expected.json new file mode 100644 index 0000000000..bc6cb18cca --- /dev/null +++ b/test/fixtures/lightscript/commaless/obj-redundant/expected.json @@ -0,0 +1,211 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "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": 20, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "NumericLiteral", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "ObjectProperty", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "d" + }, + "name": "d" + }, + "value": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "d" + }, + "name": "d" + }, + "extra": { + "shorthand": true + } + } + ] + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/comprehension/basic/actual.js b/test/fixtures/lightscript/comprehension/basic/actual.js new file mode 100644 index 0000000000..7444c637f3 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/basic/actual.js @@ -0,0 +1 @@ +[for i=0; i<10; i++: i] diff --git a/test/fixtures/lightscript/comprehension/basic/expected.json b/test/fixtures/lightscript/comprehension/basic/expected.json new file mode 100644 index 0000000000..12f4dc43f1 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/basic/expected.json @@ -0,0 +1,252 @@ +{ + "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": "ArrayComprehension", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "loop": { + "type": "ForStatement", + "start": 1, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "init": { + "type": "AssignmentExpression", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "i" + }, + "name": "i" + }, + "right": { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + "isNowAssign": false + }, + "test": { + "type": "BinaryExpression", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "left": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": "<", + "right": { + "type": "NumericLiteral", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + }, + "update": { + "type": "UpdateExpression", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "i" + }, + "name": "i" + } + }, + "body": { + "type": "ExpressionStatement", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "i" + }, + "name": "i" + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/comprehension/curly/actual.js b/test/fixtures/lightscript/comprehension/curly/actual.js new file mode 100644 index 0000000000..16b9643988 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/curly/actual.js @@ -0,0 +1 @@ +[for i=0; i<10; i++ { i }] diff --git a/test/fixtures/lightscript/comprehension/curly/expected.json b/test/fixtures/lightscript/comprehension/curly/expected.json new file mode 100644 index 0000000000..f5996fb1c8 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/curly/expected.json @@ -0,0 +1,273 @@ +{ + "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": "ArrayComprehension", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "loop": { + "type": "ForStatement", + "start": 1, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "init": { + "type": "AssignmentExpression", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "i" + }, + "name": "i" + }, + "right": { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + "isNowAssign": false + }, + "test": { + "type": "BinaryExpression", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "left": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": "<", + "right": { + "type": "NumericLiteral", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + }, + "update": { + "type": "UpdateExpression", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "i" + }, + "name": "i" + } + }, + "body": { + "type": "BlockStatement", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "i" + }, + "name": "i" + } + } + ], + "directives": [], + "extra": { + "curly": true + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/comprehension/for-as-obj-key/actual.js b/test/fixtures/lightscript/comprehension/for-as-obj-key/actual.js new file mode 100644 index 0000000000..9c2f7943f1 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/for-as-obj-key/actual.js @@ -0,0 +1 @@ +{for: 4} diff --git a/test/fixtures/lightscript/comprehension/for-as-obj-key/expected.json b/test/fixtures/lightscript/comprehension/for-as-obj-key/expected.json new file mode 100644 index 0000000000..b41e218965 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/for-as-obj-key/expected.json @@ -0,0 +1,121 @@ +{ + "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": "ObjectExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "for" + }, + "name": "for" + }, + "value": { + "type": "NumericLiteral", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 4, + "raw": "4" + }, + "value": 4 + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/comprehension/if-elif/actual.js b/test/fixtures/lightscript/comprehension/if-elif/actual.js new file mode 100644 index 0000000000..3df26129ec --- /dev/null +++ b/test/fixtures/lightscript/comprehension/if-elif/actual.js @@ -0,0 +1 @@ +[ for let i = 0; i < 10; i++: if i > 5: i elif i > 3: i * 2 ] diff --git a/test/fixtures/lightscript/comprehension/if-elif/expected.json b/test/fixtures/lightscript/comprehension/if-elif/expected.json new file mode 100644 index 0000000000..014c1ccb2a --- /dev/null +++ b/test/fixtures/lightscript/comprehension/if-elif/expected.json @@ -0,0 +1,473 @@ +{ + "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": "ExpressionStatement", + "start": 0, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "expression": { + "type": "ArrayComprehension", + "start": 0, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "loop": { + "type": "ForStatement", + "start": 2, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "init": { + "type": "VariableDeclaration", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "i" + }, + "name": "i" + }, + "init": { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ], + "kind": "let" + }, + "test": { + "type": "BinaryExpression", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "left": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": "<", + "right": { + "type": "NumericLiteral", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + }, + "update": { + "type": "UpdateExpression", + "start": 25, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + }, + "identifierName": "i" + }, + "name": "i" + } + }, + "body": { + "type": "IfStatement", + "start": 30, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "test": { + "type": "BinaryExpression", + "start": 33, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "left": { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": ">", + "right": { + "type": "NumericLiteral", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "extra": { + "rawValue": 5, + "raw": "5" + }, + "value": 5 + } + }, + "consequent": { + "type": "ExpressionStatement", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "expression": { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + }, + "identifierName": "i" + }, + "name": "i" + } + }, + "alternate": { + "type": "IfStatement", + "start": 42, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "test": { + "type": "BinaryExpression", + "start": 47, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "left": { + "type": "Identifier", + "start": 47, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 48 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": ">", + "right": { + "type": "NumericLiteral", + "start": 51, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 51 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + } + }, + "consequent": { + "type": "ExpressionStatement", + "start": 54, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 54 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 54, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 54 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "left": { + "type": "Identifier", + "start": 54, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 54 + }, + "end": { + "line": 1, + "column": 55 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": "*", + "right": { + "type": "NumericLiteral", + "start": 58, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 58 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + }, + "alternate": null + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/comprehension/if-else-if/actual.js b/test/fixtures/lightscript/comprehension/if-else-if/actual.js new file mode 100644 index 0000000000..7ffc2d828d --- /dev/null +++ b/test/fixtures/lightscript/comprehension/if-else-if/actual.js @@ -0,0 +1 @@ +[ for let i = 0; i < 10; i++: if i > 5: i else if i > 3: i * 2 ] diff --git a/test/fixtures/lightscript/comprehension/if-else-if/expected.json b/test/fixtures/lightscript/comprehension/if-else-if/expected.json new file mode 100644 index 0000000000..20ba885a7b --- /dev/null +++ b/test/fixtures/lightscript/comprehension/if-else-if/expected.json @@ -0,0 +1,473 @@ +{ + "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": "ExpressionStatement", + "start": 0, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "expression": { + "type": "ArrayComprehension", + "start": 0, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "loop": { + "type": "ForStatement", + "start": 2, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "init": { + "type": "VariableDeclaration", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "i" + }, + "name": "i" + }, + "init": { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ], + "kind": "let" + }, + "test": { + "type": "BinaryExpression", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "left": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": "<", + "right": { + "type": "NumericLiteral", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + }, + "update": { + "type": "UpdateExpression", + "start": 25, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + }, + "identifierName": "i" + }, + "name": "i" + } + }, + "body": { + "type": "IfStatement", + "start": 30, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "test": { + "type": "BinaryExpression", + "start": 33, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "left": { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": ">", + "right": { + "type": "NumericLiteral", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "extra": { + "rawValue": 5, + "raw": "5" + }, + "value": 5 + } + }, + "consequent": { + "type": "ExpressionStatement", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "expression": { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + }, + "identifierName": "i" + }, + "name": "i" + } + }, + "alternate": { + "type": "IfStatement", + "start": 47, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "test": { + "type": "BinaryExpression", + "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": "i" + }, + "name": "i" + }, + "operator": ">", + "right": { + "type": "NumericLiteral", + "start": 54, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 54 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + } + }, + "consequent": { + "type": "ExpressionStatement", + "start": 57, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 57 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 57, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 57 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "left": { + "type": "Identifier", + "start": 57, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 57 + }, + "end": { + "line": 1, + "column": 58 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": "*", + "right": { + "type": "NumericLiteral", + "start": 61, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 61 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + }, + "alternate": null + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/comprehension/if-else/actual.js b/test/fixtures/lightscript/comprehension/if-else/actual.js new file mode 100644 index 0000000000..0e63200922 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/if-else/actual.js @@ -0,0 +1 @@ +[ for let i = 0; i < 10; i++ { if i > 5 { i } else { i } } ] diff --git a/test/fixtures/lightscript/comprehension/if-else/expected.json b/test/fixtures/lightscript/comprehension/if-else/expected.json new file mode 100644 index 0000000000..1e799ad5b5 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/if-else/expected.json @@ -0,0 +1,431 @@ +{ + "type": "File", + "start": 0, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 60 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 60 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 60 + } + }, + "expression": { + "type": "ArrayComprehension", + "start": 0, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 60 + } + }, + "loop": { + "type": "ForStatement", + "start": 2, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "init": { + "type": "VariableDeclaration", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "i" + }, + "name": "i" + }, + "init": { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ], + "kind": "let" + }, + "test": { + "type": "BinaryExpression", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "left": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": "<", + "right": { + "type": "NumericLiteral", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + }, + "update": { + "type": "UpdateExpression", + "start": 25, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + }, + "identifierName": "i" + }, + "name": "i" + } + }, + "body": { + "type": "BlockStatement", + "start": 29, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "body": [ + { + "type": "IfStatement", + "start": 31, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "test": { + "type": "BinaryExpression", + "start": 34, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "left": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": ">", + "right": { + "type": "NumericLiteral", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "extra": { + "rawValue": 5, + "raw": "5" + }, + "value": 5 + } + }, + "consequent": { + "type": "BlockStatement", + "start": 40, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "expression": { + "type": "Identifier", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 43 + }, + "identifierName": "i" + }, + "name": "i" + } + } + ], + "directives": [], + "extra": { + "curly": true + } + }, + "alternate": { + "type": "BlockStatement", + "start": 51, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 51 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 53, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "expression": { + "type": "Identifier", + "start": 53, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 54 + }, + "identifierName": "i" + }, + "name": "i" + } + } + ], + "directives": [], + "extra": { + "curly": true + } + } + } + ], + "directives": [], + "extra": { + "curly": true + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/comprehension/if/actual.js b/test/fixtures/lightscript/comprehension/if/actual.js new file mode 100644 index 0000000000..7301f0b909 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/if/actual.js @@ -0,0 +1 @@ +[ for let i = 0; i < 10; i++: if i > 5: i ] diff --git a/test/fixtures/lightscript/comprehension/if/expected.json b/test/fixtures/lightscript/comprehension/if/expected.json new file mode 100644 index 0000000000..5d7ff3c628 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/if/expected.json @@ -0,0 +1,337 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "expression": { + "type": "ArrayComprehension", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "loop": { + "type": "ForStatement", + "start": 2, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "init": { + "type": "VariableDeclaration", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "i" + }, + "name": "i" + }, + "init": { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ], + "kind": "let" + }, + "test": { + "type": "BinaryExpression", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "left": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": "<", + "right": { + "type": "NumericLiteral", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + }, + "update": { + "type": "UpdateExpression", + "start": 25, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + }, + "identifierName": "i" + }, + "name": "i" + } + }, + "body": { + "type": "IfStatement", + "start": 30, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "test": { + "type": "BinaryExpression", + "start": 33, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "left": { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": ">", + "right": { + "type": "NumericLiteral", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "extra": { + "rawValue": 5, + "raw": "5" + }, + "value": 5 + } + }, + "consequent": { + "type": "ExpressionStatement", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "expression": { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + }, + "identifierName": "i" + }, + "name": "i" + } + }, + "alternate": null + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/comprehension/malformed-as-pattern/actual.js b/test/fixtures/lightscript/comprehension/malformed-as-pattern/actual.js new file mode 100644 index 0000000000..c403791f80 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/malformed-as-pattern/actual.js @@ -0,0 +1 @@ +const { for elem x in arr: x, x } = {} diff --git a/test/fixtures/lightscript/comprehension/malformed-as-pattern/options.json b/test/fixtures/lightscript/comprehension/malformed-as-pattern/options.json new file mode 100644 index 0000000000..b4a79a0033 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/malformed-as-pattern/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding invalid left-hand side in variable declaration (1:6)" +} diff --git a/test/fixtures/lightscript/comprehension/nested-for/actual.js b/test/fixtures/lightscript/comprehension/nested-for/actual.js new file mode 100644 index 0000000000..721fe882bd --- /dev/null +++ b/test/fixtures/lightscript/comprehension/nested-for/actual.js @@ -0,0 +1 @@ +[for let i of []: for const j in {}: i + j ] diff --git a/test/fixtures/lightscript/comprehension/nested-for/expected.json b/test/fixtures/lightscript/comprehension/nested-for/expected.json new file mode 100644 index 0000000000..f1e3997feb --- /dev/null +++ b/test/fixtures/lightscript/comprehension/nested-for/expected.json @@ -0,0 +1,293 @@ +{ + "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": "ArrayComprehension", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "loop": { + "type": "ForOfStatement", + "start": 1, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "i" + }, + "name": "i" + }, + "init": null + } + ], + "kind": "let" + }, + "right": { + "type": "ArrayExpression", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "elements": [] + }, + "body": { + "type": "ForInStatement", + "start": 18, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 22, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "j" + }, + "name": "j" + }, + "init": null + } + ], + "kind": "const" + }, + "right": { + "type": "ObjectExpression", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "properties": [] + }, + "body": { + "type": "ExpressionStatement", + "start": 37, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 37, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "left": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 38 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 42 + }, + "identifierName": "j" + }, + "name": "j" + } + } + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/comprehension/object-basic/actual.js b/test/fixtures/lightscript/comprehension/object-basic/actual.js new file mode 100644 index 0000000000..5b33c662e3 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/object-basic/actual.js @@ -0,0 +1 @@ +{for idx i in Array(10): (i,i)} diff --git a/test/fixtures/lightscript/comprehension/object-basic/expected.json b/test/fixtures/lightscript/comprehension/object-basic/expected.json new file mode 100644 index 0000000000..f7d5c1a2c2 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/object-basic/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": "ObjectComprehension", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "properties": [], + "loop": { + "type": "ForInArrayStatement", + "start": 1, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "idx": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "i" + }, + "name": "i" + }, + "body": { + "type": "ExpressionStatement", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 26, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + }, + "identifierName": "i" + }, + "name": "i" + }, + { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "i" + }, + "name": "i" + } + ], + "extra": { + "parenthesized": true, + "parenStart": 25 + } + } + }, + "array": { + "type": "CallExpression", + "start": 14, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "callee": { + "type": "Identifier", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "Array" + }, + "name": "Array" + }, + "arguments": [ + { + "type": "NumericLiteral", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + ] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/comprehension/object-curly/actual.js b/test/fixtures/lightscript/comprehension/object-curly/actual.js new file mode 100644 index 0000000000..aa14cfcf8a --- /dev/null +++ b/test/fixtures/lightscript/comprehension/object-curly/actual.js @@ -0,0 +1 @@ +{for idx i in Array(10) { (i, i) }} diff --git a/test/fixtures/lightscript/comprehension/object-curly/expected.json b/test/fixtures/lightscript/comprehension/object-curly/expected.json new file mode 100644 index 0000000000..7f6bd47ba0 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/object-curly/expected.json @@ -0,0 +1,242 @@ +{ + "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": "ExpressionStatement", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "expression": { + "type": "ObjectComprehension", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "properties": [], + "loop": { + "type": "ForInArrayStatement", + "start": 1, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "idx": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "i" + }, + "name": "i" + }, + "body": { + "type": "BlockStatement", + "start": 24, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 26, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 27, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + }, + "identifierName": "i" + }, + "name": "i" + }, + { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 31 + }, + "identifierName": "i" + }, + "name": "i" + } + ], + "extra": { + "parenthesized": true, + "parenStart": 26 + } + } + } + ], + "directives": [], + "extra": { + "curly": true + } + }, + "array": { + "type": "CallExpression", + "start": 14, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "callee": { + "type": "Identifier", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "Array" + }, + "name": "Array" + }, + "arguments": [ + { + "type": "NumericLiteral", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + ] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/comprehension/object-if-elif/actual.js b/test/fixtures/lightscript/comprehension/object-if-elif/actual.js new file mode 100644 index 0000000000..169aa1259c --- /dev/null +++ b/test/fixtures/lightscript/comprehension/object-if-elif/actual.js @@ -0,0 +1 @@ +{ for idx i in Array(10): if i > 5: (i, i) elif i > 3: (i, i * 2) } diff --git a/test/fixtures/lightscript/comprehension/object-if-elif/expected.json b/test/fixtures/lightscript/comprehension/object-if-elif/expected.json new file mode 100644 index 0000000000..0aefe304a9 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/object-if-elif/expected.json @@ -0,0 +1,464 @@ +{ + "type": "File", + "start": 0, + "end": 67, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 67 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 67, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 67 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 67, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 67 + } + }, + "expression": { + "type": "ObjectComprehension", + "start": 0, + "end": 67, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 67 + } + }, + "properties": [], + "loop": { + "type": "ForInArrayStatement", + "start": 2, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 65 + } + }, + "idx": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "i" + }, + "name": "i" + }, + "body": { + "type": "IfStatement", + "start": 26, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 65 + } + }, + "test": { + "type": "BinaryExpression", + "start": 29, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "left": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": ">", + "right": { + "type": "NumericLiteral", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "extra": { + "rawValue": 5, + "raw": "5" + }, + "value": 5 + } + }, + "consequent": { + "type": "ExpressionStatement", + "start": 36, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 37, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 38 + }, + "identifierName": "i" + }, + "name": "i" + }, + { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + }, + "identifierName": "i" + }, + "name": "i" + } + ], + "extra": { + "parenthesized": true, + "parenStart": 36 + } + } + }, + "alternate": { + "type": "IfStatement", + "start": 43, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 65 + } + }, + "test": { + "type": "BinaryExpression", + "start": 48, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "left": { + "type": "Identifier", + "start": 48, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 49 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": ">", + "right": { + "type": "NumericLiteral", + "start": 52, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 52 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + } + }, + "consequent": { + "type": "ExpressionStatement", + "start": 55, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 65 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 56, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 56 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 56, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 56 + }, + "end": { + "line": 1, + "column": 57 + }, + "identifierName": "i" + }, + "name": "i" + }, + { + "type": "BinaryExpression", + "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": "i" + }, + "name": "i" + }, + "operator": "*", + "right": { + "type": "NumericLiteral", + "start": 63, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 63 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 55 + } + } + }, + "alternate": null + } + }, + "array": { + "type": "CallExpression", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "callee": { + "type": "Identifier", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "Array" + }, + "name": "Array" + }, + "arguments": [ + { + "type": "NumericLiteral", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + ] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/comprehension/object-if-else-if/actual.js b/test/fixtures/lightscript/comprehension/object-if-else-if/actual.js new file mode 100644 index 0000000000..7ecf07e610 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/object-if-else-if/actual.js @@ -0,0 +1 @@ +{ for idx i in Array(10): if i > 5: (i, i) else if i > 3: (i, i * 2) } diff --git a/test/fixtures/lightscript/comprehension/object-if-else-if/expected.json b/test/fixtures/lightscript/comprehension/object-if-else-if/expected.json new file mode 100644 index 0000000000..95e2716538 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/object-if-else-if/expected.json @@ -0,0 +1,464 @@ +{ + "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": "ExpressionStatement", + "start": 0, + "end": 70, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 70 + } + }, + "expression": { + "type": "ObjectComprehension", + "start": 0, + "end": 70, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 70 + } + }, + "properties": [], + "loop": { + "type": "ForInArrayStatement", + "start": 2, + "end": 68, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 68 + } + }, + "idx": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "i" + }, + "name": "i" + }, + "body": { + "type": "IfStatement", + "start": 26, + "end": 68, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 68 + } + }, + "test": { + "type": "BinaryExpression", + "start": 29, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "left": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": ">", + "right": { + "type": "NumericLiteral", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "extra": { + "rawValue": 5, + "raw": "5" + }, + "value": 5 + } + }, + "consequent": { + "type": "ExpressionStatement", + "start": 36, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 37, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 38 + }, + "identifierName": "i" + }, + "name": "i" + }, + { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + }, + "identifierName": "i" + }, + "name": "i" + } + ], + "extra": { + "parenthesized": true, + "parenStart": 36 + } + } + }, + "alternate": { + "type": "IfStatement", + "start": 48, + "end": 68, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 68 + } + }, + "test": { + "type": "BinaryExpression", + "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": "i" + }, + "name": "i" + }, + "operator": ">", + "right": { + "type": "NumericLiteral", + "start": 55, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + } + }, + "consequent": { + "type": "ExpressionStatement", + "start": 58, + "end": 68, + "loc": { + "start": { + "line": 1, + "column": 58 + }, + "end": { + "line": 1, + "column": 68 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 59, + "end": 67, + "loc": { + "start": { + "line": 1, + "column": 59 + }, + "end": { + "line": 1, + "column": 67 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 59, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 59 + }, + "end": { + "line": 1, + "column": 60 + }, + "identifierName": "i" + }, + "name": "i" + }, + { + "type": "BinaryExpression", + "start": 62, + "end": 67, + "loc": { + "start": { + "line": 1, + "column": 62 + }, + "end": { + "line": 1, + "column": 67 + } + }, + "left": { + "type": "Identifier", + "start": 62, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 62 + }, + "end": { + "line": 1, + "column": 63 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": "*", + "right": { + "type": "NumericLiteral", + "start": 66, + "end": 67, + "loc": { + "start": { + "line": 1, + "column": 66 + }, + "end": { + "line": 1, + "column": 67 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 58 + } + } + }, + "alternate": null + } + }, + "array": { + "type": "CallExpression", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "callee": { + "type": "Identifier", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "Array" + }, + "name": "Array" + }, + "arguments": [ + { + "type": "NumericLiteral", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + ] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/comprehension/object-if-else/actual.js b/test/fixtures/lightscript/comprehension/object-if-else/actual.js new file mode 100644 index 0000000000..866725ea15 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/object-if-else/actual.js @@ -0,0 +1 @@ +{ for idx i in Array(10) { if i > 5 { (i, i) } else { (i, i) } } } diff --git a/test/fixtures/lightscript/comprehension/object-if-else/expected.json b/test/fixtures/lightscript/comprehension/object-if-else/expected.json new file mode 100644 index 0000000000..dcb83f5c72 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/object-if-else/expected.json @@ -0,0 +1,422 @@ +{ + "type": "File", + "start": 0, + "end": 66, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 66 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 66, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 66 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 66, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 66 + } + }, + "expression": { + "type": "ObjectComprehension", + "start": 0, + "end": 66, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 66 + } + }, + "properties": [], + "loop": { + "type": "ForInArrayStatement", + "start": 2, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "idx": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "i" + }, + "name": "i" + }, + "body": { + "type": "BlockStatement", + "start": 25, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "body": [ + { + "type": "IfStatement", + "start": 27, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "test": { + "type": "BinaryExpression", + "start": 30, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "left": { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 31 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": ">", + "right": { + "type": "NumericLiteral", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "extra": { + "rawValue": 5, + "raw": "5" + }, + "value": 5 + } + }, + "consequent": { + "type": "BlockStatement", + "start": 36, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 38, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 39, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 40 + }, + "identifierName": "i" + }, + "name": "i" + }, + { + "type": "Identifier", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 43 + }, + "identifierName": "i" + }, + "name": "i" + } + ], + "extra": { + "parenthesized": true, + "parenStart": 38 + } + } + } + ], + "directives": [], + "extra": { + "curly": true + } + }, + "alternate": { + "type": "BlockStatement", + "start": 52, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 52 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 54, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 54 + }, + "end": { + "line": 1, + "column": 60 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 55, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 55, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 56 + }, + "identifierName": "i" + }, + "name": "i" + }, + { + "type": "Identifier", + "start": 58, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 58 + }, + "end": { + "line": 1, + "column": 59 + }, + "identifierName": "i" + }, + "name": "i" + } + ], + "extra": { + "parenthesized": true, + "parenStart": 54 + } + } + } + ], + "directives": [], + "extra": { + "curly": true + } + } + } + ], + "directives": [], + "extra": { + "curly": true + } + }, + "array": { + "type": "CallExpression", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "callee": { + "type": "Identifier", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "Array" + }, + "name": "Array" + }, + "arguments": [ + { + "type": "NumericLiteral", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + ] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/comprehension/object-if/actual.js b/test/fixtures/lightscript/comprehension/object-if/actual.js new file mode 100644 index 0000000000..a83fc1a9cf --- /dev/null +++ b/test/fixtures/lightscript/comprehension/object-if/actual.js @@ -0,0 +1 @@ +{for idx i in Array(10): if i > 5: (i, i)} diff --git a/test/fixtures/lightscript/comprehension/object-if/expected.json b/test/fixtures/lightscript/comprehension/object-if/expected.json new file mode 100644 index 0000000000..a9d2217af9 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/object-if/expected.json @@ -0,0 +1,290 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "expression": { + "type": "ObjectComprehension", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "properties": [], + "loop": { + "type": "ForInArrayStatement", + "start": 1, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "idx": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "i" + }, + "name": "i" + }, + "body": { + "type": "IfStatement", + "start": 25, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "test": { + "type": "BinaryExpression", + "start": 28, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "left": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": ">", + "right": { + "type": "NumericLiteral", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "extra": { + "rawValue": 5, + "raw": "5" + }, + "value": 5 + } + }, + "consequent": { + "type": "ExpressionStatement", + "start": 35, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 36, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 37 + }, + "identifierName": "i" + }, + "name": "i" + }, + { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 40 + }, + "identifierName": "i" + }, + "name": "i" + } + ], + "extra": { + "parenthesized": true, + "parenStart": 35 + } + } + }, + "alternate": null + }, + "array": { + "type": "CallExpression", + "start": 14, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "callee": { + "type": "Identifier", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "Array" + }, + "name": "Array" + }, + "arguments": [ + { + "type": "NumericLiteral", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + ] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/comprehension/object-nested-for/actual.js b/test/fixtures/lightscript/comprehension/object-nested-for/actual.js new file mode 100644 index 0000000000..aacd1f24ff --- /dev/null +++ b/test/fixtures/lightscript/comprehension/object-nested-for/actual.js @@ -0,0 +1 @@ +{for let i of []: for const j in {}: (i, j)} diff --git a/test/fixtures/lightscript/comprehension/object-nested-for/expected.json b/test/fixtures/lightscript/comprehension/object-nested-for/expected.json new file mode 100644 index 0000000000..18f94ddd0a --- /dev/null +++ b/test/fixtures/lightscript/comprehension/object-nested-for/expected.json @@ -0,0 +1,299 @@ +{ + "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": "ObjectComprehension", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "properties": [], + "loop": { + "type": "ForOfStatement", + "start": 1, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "i" + }, + "name": "i" + }, + "init": null + } + ], + "kind": "let" + }, + "right": { + "type": "ArrayExpression", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "elements": [] + }, + "body": { + "type": "ForInStatement", + "start": 18, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 22, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "j" + }, + "name": "j" + }, + "init": null + } + ], + "kind": "const" + }, + "right": { + "type": "ObjectExpression", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "properties": [] + }, + "body": { + "type": "ExpressionStatement", + "start": 37, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 38, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 39 + }, + "identifierName": "i" + }, + "name": "i" + }, + { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 42 + }, + "identifierName": "j" + }, + "name": "j" + } + ], + "extra": { + "parenthesized": true, + "parenStart": 37 + } + } + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/comprehension/object-paren-curly/actual.js b/test/fixtures/lightscript/comprehension/object-paren-curly/actual.js new file mode 100644 index 0000000000..37cdd762c5 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/object-paren-curly/actual.js @@ -0,0 +1 @@ +{ for (idx i in Array(10)) { (i,i) } } diff --git a/test/fixtures/lightscript/comprehension/object-paren-curly/expected.json b/test/fixtures/lightscript/comprehension/object-paren-curly/expected.json new file mode 100644 index 0000000000..a3fac92efb --- /dev/null +++ b/test/fixtures/lightscript/comprehension/object-paren-curly/expected.json @@ -0,0 +1,242 @@ +{ + "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": "ObjectComprehension", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "properties": [], + "loop": { + "type": "ForInArrayStatement", + "start": 2, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "idx": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "i" + }, + "name": "i" + }, + "body": { + "type": "BlockStatement", + "start": 27, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 29, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 30, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 31 + }, + "identifierName": "i" + }, + "name": "i" + }, + { + "type": "Identifier", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 33 + }, + "identifierName": "i" + }, + "name": "i" + } + ], + "extra": { + "parenthesized": true, + "parenStart": 29 + } + } + } + ], + "directives": [], + "extra": { + "curly": true + } + }, + "array": { + "type": "CallExpression", + "start": 16, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "callee": { + "type": "Identifier", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "Array" + }, + "name": "Array" + }, + "arguments": [ + { + "type": "NumericLiteral", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + ] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/comprehension/object-paren-free/actual.js b/test/fixtures/lightscript/comprehension/object-paren-free/actual.js new file mode 100644 index 0000000000..3df476aef2 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/object-paren-free/actual.js @@ -0,0 +1 @@ +{for idx i in Array(10): i, i} diff --git a/test/fixtures/lightscript/comprehension/object-paren-free/expected.json b/test/fixtures/lightscript/comprehension/object-paren-free/expected.json new file mode 100644 index 0000000000..000994eb05 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/object-paren-free/expected.json @@ -0,0 +1,217 @@ +{ + "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": "ObjectComprehension", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "properties": [], + "loop": { + "type": "ForInArrayStatement", + "start": 1, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "idx": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "i" + }, + "name": "i" + }, + "body": { + "type": "ExpressionStatement", + "start": 25, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 25, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + }, + "identifierName": "i" + }, + "name": "i" + }, + { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "i" + }, + "name": "i" + } + ] + } + }, + "array": { + "type": "CallExpression", + "start": 14, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "callee": { + "type": "Identifier", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "Array" + }, + "name": "Array" + }, + "arguments": [ + { + "type": "NumericLiteral", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + ] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/comprehension/paren-curly/actual.js b/test/fixtures/lightscript/comprehension/paren-curly/actual.js new file mode 100644 index 0000000000..d5e5190dda --- /dev/null +++ b/test/fixtures/lightscript/comprehension/paren-curly/actual.js @@ -0,0 +1 @@ +[for (i=0; i<10; i++) { i }] diff --git a/test/fixtures/lightscript/comprehension/paren-curly/expected.json b/test/fixtures/lightscript/comprehension/paren-curly/expected.json new file mode 100644 index 0000000000..c99df6c5e8 --- /dev/null +++ b/test/fixtures/lightscript/comprehension/paren-curly/expected.json @@ -0,0 +1,273 @@ +{ + "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": "ArrayComprehension", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "loop": { + "type": "ForStatement", + "start": 1, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "init": { + "type": "AssignmentExpression", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "i" + }, + "name": "i" + }, + "right": { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + "isNowAssign": false + }, + "test": { + "type": "BinaryExpression", + "start": 11, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "left": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": "<", + "right": { + "type": "NumericLiteral", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + }, + "update": { + "type": "UpdateExpression", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "i" + }, + "name": "i" + } + }, + "body": { + "type": "BlockStatement", + "start": 22, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "i" + }, + "name": "i" + } + } + ], + "directives": [], + "extra": { + "curly": true + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/elif/basic/actual.js b/test/fixtures/lightscript/elif/basic/actual.js new file mode 100644 index 0000000000..aa9bd4e72f --- /dev/null +++ b/test/fixtures/lightscript/elif/basic/actual.js @@ -0,0 +1,4 @@ +if false: + 1 +elif true: + 2 diff --git a/test/fixtures/lightscript/elif/basic/expected.json b/test/fixtures/lightscript/elif/basic/expected.json new file mode 100644 index 0000000000..2cd420e318 --- /dev/null +++ b/test/fixtures/lightscript/elif/basic/expected.json @@ -0,0 +1,209 @@ +{ + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 3, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "value": false + }, + "consequent": { + "type": "BlockStatement", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": { + "type": "IfStatement", + "start": 14, + "end": 28, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 19, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "value": true + }, + "consequent": { + "type": "BlockStatement", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": null + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/elif/with-else-if/actual.js b/test/fixtures/lightscript/elif/with-else-if/actual.js new file mode 100644 index 0000000000..272913e98a --- /dev/null +++ b/test/fixtures/lightscript/elif/with-else-if/actual.js @@ -0,0 +1,6 @@ +if false: + 1 +elif true: + 2 +else if null: + 3 diff --git a/test/fixtures/lightscript/elif/with-else-if/expected.json b/test/fixtures/lightscript/elif/with-else-if/expected.json new file mode 100644 index 0000000000..9dce145b5d --- /dev/null +++ b/test/fixtures/lightscript/elif/with-else-if/expected.json @@ -0,0 +1,295 @@ +{ + "type": "File", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 3, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "value": false + }, + "consequent": { + "type": "BlockStatement", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": { + "type": "IfStatement", + "start": 14, + "end": 46, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 19, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "value": true + }, + "consequent": { + "type": "BlockStatement", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": { + "type": "IfStatement", + "start": 34, + "end": 46, + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "test": { + "type": "NullLiteral", + "start": 37, + "end": 41, + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 5, + "column": 12 + } + } + }, + "consequent": { + "type": "BlockStatement", + "start": 41, + "end": 46, + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 45, + "end": 46, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 45, + "end": 46, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": null + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/elif/with-else/actual.js b/test/fixtures/lightscript/elif/with-else/actual.js new file mode 100644 index 0000000000..c09d2f1063 --- /dev/null +++ b/test/fixtures/lightscript/elif/with-else/actual.js @@ -0,0 +1,6 @@ +if false: + 1 +elif true: + 2 +else: + 3 diff --git a/test/fixtures/lightscript/elif/with-else/expected.json b/test/fixtures/lightscript/elif/with-else/expected.json new file mode 100644 index 0000000000..8bc966242a --- /dev/null +++ b/test/fixtures/lightscript/elif/with-else/expected.json @@ -0,0 +1,264 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 3, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "value": false + }, + "consequent": { + "type": "BlockStatement", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": { + "type": "IfStatement", + "start": 14, + "end": 38, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 19, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "value": true + }, + "consequent": { + "type": "BlockStatement", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": { + "type": "BlockStatement", + "start": 33, + "end": 38, + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/for-in/array-elem-destructured-arr/actual.js b/test/fixtures/lightscript/for-in/array-elem-destructured-arr/actual.js new file mode 100644 index 0000000000..61081dac77 --- /dev/null +++ b/test/fixtures/lightscript/for-in/array-elem-destructured-arr/actual.js @@ -0,0 +1 @@ +for elem [foo] in array {} diff --git a/test/fixtures/lightscript/for-in/array-elem-destructured-arr/expected.json b/test/fixtures/lightscript/for-in/array-elem-destructured-arr/expected.json new file mode 100644 index 0000000000..3baec2708f --- /dev/null +++ b/test/fixtures/lightscript/for-in/array-elem-destructured-arr/expected.json @@ -0,0 +1,120 @@ +{ + "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": "ForInArrayStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "elem": { + "type": "ArrayPattern", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "foo" + }, + "name": "foo" + } + ] + }, + "body": { + "type": "BlockStatement", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "array": { + "type": "Identifier", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "array" + }, + "name": "array" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/for-in/array-elem-destructured-complex/actual.js b/test/fixtures/lightscript/for-in/array-elem-destructured-complex/actual.js new file mode 100644 index 0000000000..9fa1f03682 --- /dev/null +++ b/test/fixtures/lightscript/for-in/array-elem-destructured-complex/actual.js @@ -0,0 +1 @@ +for elem { a, b: { c: d }, e = 1 } in arr {} diff --git a/test/fixtures/lightscript/for-in/array-elem-destructured-complex/expected.json b/test/fixtures/lightscript/for-in/array-elem-destructured-complex/expected.json new file mode 100644 index 0000000000..0ea2a8de8b --- /dev/null +++ b/test/fixtures/lightscript/for-in/array-elem-destructured-complex/expected.json @@ -0,0 +1,352 @@ +{ + "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": "ForInArrayStatement", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "elem": { + "type": "ObjectPattern", + "start": 9, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "a" + }, + "name": "a" + }, + "extra": { + "shorthand": true + } + }, + { + "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": "b" + }, + "name": "b" + }, + "value": { + "type": "ObjectPattern", + "start": 17, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 19, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "c" + }, + "name": "c" + }, + "value": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "d" + }, + "name": "d" + } + } + ] + } + }, + { + "type": "ObjectProperty", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + }, + "identifierName": "e" + }, + "name": "e" + }, + "value": { + "type": "AssignmentPattern", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "left": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + }, + "identifierName": "e" + }, + "name": "e" + }, + "right": { + "type": "NumericLiteral", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + "extra": { + "shorthand": true + } + } + ] + }, + "body": { + "type": "BlockStatement", + "start": 42, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "array": { + "type": "Identifier", + "start": 38, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 41 + }, + "identifierName": "arr" + }, + "name": "arr" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/for-in/array-elem-destructured-obj/actual.js b/test/fixtures/lightscript/for-in/array-elem-destructured-obj/actual.js new file mode 100644 index 0000000000..82715135a1 --- /dev/null +++ b/test/fixtures/lightscript/for-in/array-elem-destructured-obj/actual.js @@ -0,0 +1 @@ +for elem { foo } in array {} diff --git a/test/fixtures/lightscript/for-in/array-elem-destructured-obj/expected.json b/test/fixtures/lightscript/for-in/array-elem-destructured-obj/expected.json new file mode 100644 index 0000000000..1178b838ff --- /dev/null +++ b/test/fixtures/lightscript/for-in/array-elem-destructured-obj/expected.json @@ -0,0 +1,158 @@ +{ + "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": "ForInArrayStatement", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "elem": { + "type": "ObjectPattern", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "value": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "body": { + "type": "BlockStatement", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "array": { + "type": "Identifier", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "array" + }, + "name": "array" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/for-in/array-elem-idx-destructured/actual.js b/test/fixtures/lightscript/for-in/array-elem-idx-destructured/actual.js new file mode 100644 index 0000000000..6c85a93f8f --- /dev/null +++ b/test/fixtures/lightscript/for-in/array-elem-idx-destructured/actual.js @@ -0,0 +1 @@ +for elem { foo }, idx i in array {} diff --git a/test/fixtures/lightscript/for-in/array-elem-idx-destructured/expected.json b/test/fixtures/lightscript/for-in/array-elem-idx-destructured/expected.json new file mode 100644 index 0000000000..9398490a24 --- /dev/null +++ b/test/fixtures/lightscript/for-in/array-elem-idx-destructured/expected.json @@ -0,0 +1,175 @@ +{ + "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": "ForInArrayStatement", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "elem": { + "type": "ObjectPattern", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "value": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "idx": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "i" + }, + "name": "i" + }, + "body": { + "type": "BlockStatement", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "array": { + "type": "Identifier", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + }, + "identifierName": "array" + }, + "name": "array" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/for-in/array-elem-idx/actual.js b/test/fixtures/lightscript/for-in/array-elem-idx/actual.js new file mode 100644 index 0000000000..47d7a9d24f --- /dev/null +++ b/test/fixtures/lightscript/for-in/array-elem-idx/actual.js @@ -0,0 +1 @@ +for elem e, idx i in array {} diff --git a/test/fixtures/lightscript/for-in/array-elem-idx/expected.json b/test/fixtures/lightscript/for-in/array-elem-idx/expected.json new file mode 100644 index 0000000000..7115931372 --- /dev/null +++ b/test/fixtures/lightscript/for-in/array-elem-idx/expected.json @@ -0,0 +1,120 @@ +{ + "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": "ForInArrayStatement", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "elem": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "e" + }, + "name": "e" + }, + "idx": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "i" + }, + "name": "i" + }, + "body": { + "type": "BlockStatement", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "array": { + "type": "Identifier", + "start": 21, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 26 + }, + "identifierName": "array" + }, + "name": "array" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/for-in/array-elem/actual.js b/test/fixtures/lightscript/for-in/array-elem/actual.js new file mode 100644 index 0000000000..581be17f87 --- /dev/null +++ b/test/fixtures/lightscript/for-in/array-elem/actual.js @@ -0,0 +1 @@ +for elem e in array {} diff --git a/test/fixtures/lightscript/for-in/array-elem/expected.json b/test/fixtures/lightscript/for-in/array-elem/expected.json new file mode 100644 index 0000000000..7bd1e5bbb7 --- /dev/null +++ b/test/fixtures/lightscript/for-in/array-elem/expected.json @@ -0,0 +1,103 @@ +{ + "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": "ForInArrayStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "elem": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "e" + }, + "name": "e" + }, + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "array": { + "type": "Identifier", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "array" + }, + "name": "array" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/for-in/array-idx-elem/actual.js b/test/fixtures/lightscript/for-in/array-idx-elem/actual.js new file mode 100644 index 0000000000..1e398f879b --- /dev/null +++ b/test/fixtures/lightscript/for-in/array-idx-elem/actual.js @@ -0,0 +1 @@ +for idx i, elem e in array {} diff --git a/test/fixtures/lightscript/for-in/array-idx-elem/expected.json b/test/fixtures/lightscript/for-in/array-idx-elem/expected.json new file mode 100644 index 0000000000..13b482756b --- /dev/null +++ b/test/fixtures/lightscript/for-in/array-idx-elem/expected.json @@ -0,0 +1,120 @@ +{ + "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": "ForInArrayStatement", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "idx": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "i" + }, + "name": "i" + }, + "elem": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "e" + }, + "name": "e" + }, + "body": { + "type": "BlockStatement", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "array": { + "type": "Identifier", + "start": 21, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 26 + }, + "identifierName": "array" + }, + "name": "array" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/for-in/array-idx-invalid-destructure/actual.js b/test/fixtures/lightscript/for-in/array-idx-invalid-destructure/actual.js new file mode 100644 index 0000000000..8f335b2e46 --- /dev/null +++ b/test/fixtures/lightscript/for-in/array-idx-invalid-destructure/actual.js @@ -0,0 +1 @@ +for idx { i } in array {} diff --git a/test/fixtures/lightscript/for-in/array-idx-invalid-destructure/options.json b/test/fixtures/lightscript/for-in/array-idx-invalid-destructure/options.json new file mode 100644 index 0000000000..9ce9658f7d --- /dev/null +++ b/test/fixtures/lightscript/for-in/array-idx-invalid-destructure/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:8)" +} diff --git a/test/fixtures/lightscript/for-in/array-idx/actual.js b/test/fixtures/lightscript/for-in/array-idx/actual.js new file mode 100644 index 0000000000..13d4c4db99 --- /dev/null +++ b/test/fixtures/lightscript/for-in/array-idx/actual.js @@ -0,0 +1 @@ +for idx i in array {} diff --git a/test/fixtures/lightscript/for-in/array-idx/expected.json b/test/fixtures/lightscript/for-in/array-idx/expected.json new file mode 100644 index 0000000000..6eee311acb --- /dev/null +++ b/test/fixtures/lightscript/for-in/array-idx/expected.json @@ -0,0 +1,103 @@ +{ + "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": "ForInArrayStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "idx": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "i" + }, + "name": "i" + }, + "body": { + "type": "BlockStatement", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "array": { + "type": "Identifier", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "array" + }, + "name": "array" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/for-in/keyword-reuse/actual.js b/test/fixtures/lightscript/for-in/keyword-reuse/actual.js new file mode 100644 index 0000000000..be8afffcc5 --- /dev/null +++ b/test/fixtures/lightscript/for-in/keyword-reuse/actual.js @@ -0,0 +1 @@ +for const key in obj {} diff --git a/test/fixtures/lightscript/for-in/keyword-reuse/expected.json b/test/fixtures/lightscript/for-in/keyword-reuse/expected.json new file mode 100644 index 0000000000..e284c529af --- /dev/null +++ b/test/fixtures/lightscript/for-in/keyword-reuse/expected.json @@ -0,0 +1,137 @@ +{ + "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": "ForInStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "key" + }, + "name": "key" + }, + "init": null + } + ], + "kind": "const" + }, + "right": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "obj" + }, + "name": "obj" + }, + "body": { + "type": "BlockStatement", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/for-in/mismatched-types-idx-idx/actual.js b/test/fixtures/lightscript/for-in/mismatched-types-idx-idx/actual.js new file mode 100644 index 0000000000..2b14c55c90 --- /dev/null +++ b/test/fixtures/lightscript/for-in/mismatched-types-idx-idx/actual.js @@ -0,0 +1 @@ +for idx k, idx e in obj {} diff --git a/test/fixtures/lightscript/for-in/mismatched-types-idx-idx/options.json b/test/fixtures/lightscript/for-in/mismatched-types-idx-idx/options.json new file mode 100644 index 0000000000..4177a801be --- /dev/null +++ b/test/fixtures/lightscript/for-in/mismatched-types-idx-idx/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected elem (1:11)" +} diff --git a/test/fixtures/lightscript/for-in/mismatched-types-idx-val/actual.js b/test/fixtures/lightscript/for-in/mismatched-types-idx-val/actual.js new file mode 100644 index 0000000000..3141ddaa23 --- /dev/null +++ b/test/fixtures/lightscript/for-in/mismatched-types-idx-val/actual.js @@ -0,0 +1 @@ +for idx k, val e in obj {} diff --git a/test/fixtures/lightscript/for-in/mismatched-types-idx-val/options.json b/test/fixtures/lightscript/for-in/mismatched-types-idx-val/options.json new file mode 100644 index 0000000000..4177a801be --- /dev/null +++ b/test/fixtures/lightscript/for-in/mismatched-types-idx-val/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected elem (1:11)" +} diff --git a/test/fixtures/lightscript/for-in/mismatched-types-key-elem/actual.js b/test/fixtures/lightscript/for-in/mismatched-types-key-elem/actual.js new file mode 100644 index 0000000000..48a4e5bb3a --- /dev/null +++ b/test/fixtures/lightscript/for-in/mismatched-types-key-elem/actual.js @@ -0,0 +1 @@ +for key k, elem e in obj {} diff --git a/test/fixtures/lightscript/for-in/mismatched-types-key-elem/options.json b/test/fixtures/lightscript/for-in/mismatched-types-key-elem/options.json new file mode 100644 index 0000000000..0d76ee2be0 --- /dev/null +++ b/test/fixtures/lightscript/for-in/mismatched-types-key-elem/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected val (1:11)" +} diff --git a/test/fixtures/lightscript/for-in/no-implicit-const/actual.js b/test/fixtures/lightscript/for-in/no-implicit-const/actual.js new file mode 100644 index 0000000000..b37bea1bca --- /dev/null +++ b/test/fixtures/lightscript/for-in/no-implicit-const/actual.js @@ -0,0 +1 @@ +for x in [1, 2] {} diff --git a/test/fixtures/lightscript/for-in/no-implicit-const/options.json b/test/fixtures/lightscript/for-in/no-implicit-const/options.json new file mode 100644 index 0000000000..4fa5b8e28b --- /dev/null +++ b/test/fixtures/lightscript/for-in/no-implicit-const/options.json @@ -0,0 +1,3 @@ +{ + "throws": "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. (1:4)" +} diff --git a/test/fixtures/lightscript/for-in/now-invalid-expr-1/actual.js b/test/fixtures/lightscript/for-in/now-invalid-expr-1/actual.js new file mode 100644 index 0000000000..e36ecd3507 --- /dev/null +++ b/test/fixtures/lightscript/for-in/now-invalid-expr-1/actual.js @@ -0,0 +1,2 @@ +// core/uncategorized/374 +for(now (1 + 1) in list) process(x); diff --git a/test/fixtures/lightscript/for-in/now-invalid-expr-1/options.json b/test/fixtures/lightscript/for-in/now-invalid-expr-1/options.json new file mode 100644 index 0000000000..8fdea6cb57 --- /dev/null +++ b/test/fixtures/lightscript/for-in/now-invalid-expr-1/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid left-hand side in for-in statement (2:9)" +} diff --git a/test/fixtures/lightscript/for-in/now-invalid-expr-2/actual.js b/test/fixtures/lightscript/for-in/now-invalid-expr-2/actual.js new file mode 100644 index 0000000000..f71140a86e --- /dev/null +++ b/test/fixtures/lightscript/for-in/now-invalid-expr-2/actual.js @@ -0,0 +1,2 @@ +// core/uncategorized/417 +for (now i + 1 in {}); diff --git a/test/fixtures/lightscript/for-in/now-invalid-expr-2/options.json b/test/fixtures/lightscript/for-in/now-invalid-expr-2/options.json new file mode 100644 index 0000000000..8fdea6cb57 --- /dev/null +++ b/test/fixtures/lightscript/for-in/now-invalid-expr-2/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid left-hand side in for-in statement (2:9)" +} diff --git a/test/fixtures/lightscript/for-in/now-invalid-expr-3/actual.js b/test/fixtures/lightscript/for-in/now-invalid-expr-3/actual.js new file mode 100644 index 0000000000..54a54f37b6 --- /dev/null +++ b/test/fixtures/lightscript/for-in/now-invalid-expr-3/actual.js @@ -0,0 +1,2 @@ +// core/uncategorized/418 +for (now +i in {}); diff --git a/test/fixtures/lightscript/for-in/now-invalid-expr-3/options.json b/test/fixtures/lightscript/for-in/now-invalid-expr-3/options.json new file mode 100644 index 0000000000..8fdea6cb57 --- /dev/null +++ b/test/fixtures/lightscript/for-in/now-invalid-expr-3/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid left-hand side in for-in statement (2:9)" +} diff --git a/test/fixtures/lightscript/for-in/now-valid-expr/actual.js b/test/fixtures/lightscript/for-in/now-valid-expr/actual.js new file mode 100644 index 0000000000..c6d46d3cbe --- /dev/null +++ b/test/fixtures/lightscript/for-in/now-valid-expr/actual.js @@ -0,0 +1,2 @@ +// es2015/uncategorized/310 +for(now {x = 0} in arr); diff --git a/test/fixtures/lightscript/for-in/now-valid-expr/expected.json b/test/fixtures/lightscript/for-in/now-valid-expr/expected.json new file mode 100644 index 0000000000..44a32c4cc9 --- /dev/null +++ b/test/fixtures/lightscript/for-in/now-valid-expr/expected.json @@ -0,0 +1,228 @@ +{ + "type": "File", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForInStatement", + "start": 28, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "left": { + "type": "ObjectPattern", + "start": 36, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 37, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x", + "leadingComments": null + }, + "value": { + "type": "AssignmentPattern", + "start": 37, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "left": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "NumericLiteral", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + "leadingComments": null + }, + "leadingComments": null, + "extra": { + "shorthand": true + } + } + ], + "leadingComments": null + }, + "right": { + "type": "Identifier", + "start": 47, + "end": 50, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 22 + }, + "identifierName": "arr" + }, + "name": "arr" + }, + "body": { + "type": "EmptyStatement", + "start": 51, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 24 + } + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " es2015/uncategorized/310", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + } + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " es2015/uncategorized/310", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + } + } + ] +} \ No newline at end of file diff --git a/test/fixtures/lightscript/for-in/now-vanilla-for/actual.js b/test/fixtures/lightscript/for-in/now-vanilla-for/actual.js new file mode 100644 index 0000000000..9512373910 --- /dev/null +++ b/test/fixtures/lightscript/for-in/now-vanilla-for/actual.js @@ -0,0 +1,2 @@ +// core/uncategorized/246 +for(now x in list) process(x); diff --git a/test/fixtures/lightscript/for-in/now-vanilla-for/expected.json b/test/fixtures/lightscript/for-in/now-vanilla-for/expected.json new file mode 100644 index 0000000000..ebb99384bf --- /dev/null +++ b/test/fixtures/lightscript/for-in/now-vanilla-for/expected.json @@ -0,0 +1,186 @@ +{ + "type": "File", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForInStatement", + "start": 26, + "end": 56, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "left": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "x" + }, + "name": "x", + "leadingComments": null + }, + "right": { + "type": "Identifier", + "start": 39, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "list" + }, + "name": "list" + }, + "body": { + "type": "ExpressionStatement", + "start": 45, + "end": 56, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "expression": { + "type": "CallExpression", + "start": 45, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "callee": { + "type": "Identifier", + "start": 45, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 26 + }, + "identifierName": "process" + }, + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 53, + "end": 54, + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 28 + }, + "identifierName": "x" + }, + "name": "x" + } + ] + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " core/uncategorized/246", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + } + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " core/uncategorized/246", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + } + } + ] +} \ No newline at end of file diff --git a/test/fixtures/lightscript/for-in/now/actual.js b/test/fixtures/lightscript/for-in/now/actual.js new file mode 100644 index 0000000000..74c41fb81e --- /dev/null +++ b/test/fixtures/lightscript/for-in/now/actual.js @@ -0,0 +1 @@ +for now k in obj: {} diff --git a/test/fixtures/lightscript/for-in/now/expected.json b/test/fixtures/lightscript/for-in/now/expected.json new file mode 100644 index 0000000000..d8249777ef --- /dev/null +++ b/test/fixtures/lightscript/for-in/now/expected.json @@ -0,0 +1,103 @@ +{ + "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": "ForInStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "left": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "k" + }, + "name": "k" + }, + "right": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "obj" + }, + "name": "obj" + }, + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/for-in/obj-key-invalid-destructure/actual.js b/test/fixtures/lightscript/for-in/obj-key-invalid-destructure/actual.js new file mode 100644 index 0000000000..f877266fdd --- /dev/null +++ b/test/fixtures/lightscript/for-in/obj-key-invalid-destructure/actual.js @@ -0,0 +1 @@ +for key { foo } in obj {} diff --git a/test/fixtures/lightscript/for-in/obj-key-invalid-destructure/options.json b/test/fixtures/lightscript/for-in/obj-key-invalid-destructure/options.json new file mode 100644 index 0000000000..9ce9658f7d --- /dev/null +++ b/test/fixtures/lightscript/for-in/obj-key-invalid-destructure/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:8)" +} diff --git a/test/fixtures/lightscript/for-in/obj-key-val-destructured/actual.js b/test/fixtures/lightscript/for-in/obj-key-val-destructured/actual.js new file mode 100644 index 0000000000..eec9a70da8 --- /dev/null +++ b/test/fixtures/lightscript/for-in/obj-key-val-destructured/actual.js @@ -0,0 +1 @@ +for key k, val { foo } in obj {} diff --git a/test/fixtures/lightscript/for-in/obj-key-val-destructured/expected.json b/test/fixtures/lightscript/for-in/obj-key-val-destructured/expected.json new file mode 100644 index 0000000000..944e704981 --- /dev/null +++ b/test/fixtures/lightscript/for-in/obj-key-val-destructured/expected.json @@ -0,0 +1,175 @@ +{ + "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": "ForInObjectStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "key": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "k" + }, + "name": "k" + }, + "val": { + "type": "ObjectPattern", + "start": 15, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "value": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "body": { + "type": "BlockStatement", + "start": 30, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "object": { + "type": "Identifier", + "start": 26, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "obj" + }, + "name": "obj" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/for-in/obj-key-val/actual.js b/test/fixtures/lightscript/for-in/obj-key-val/actual.js new file mode 100644 index 0000000000..f266dc67cb --- /dev/null +++ b/test/fixtures/lightscript/for-in/obj-key-val/actual.js @@ -0,0 +1 @@ +for key k, val v in obj {} diff --git a/test/fixtures/lightscript/for-in/obj-key-val/expected.json b/test/fixtures/lightscript/for-in/obj-key-val/expected.json new file mode 100644 index 0000000000..4787afe94f --- /dev/null +++ b/test/fixtures/lightscript/for-in/obj-key-val/expected.json @@ -0,0 +1,120 @@ +{ + "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": "ForInObjectStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "key": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "k" + }, + "name": "k" + }, + "val": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "v" + }, + "name": "v" + }, + "body": { + "type": "BlockStatement", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "object": { + "type": "Identifier", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "obj" + }, + "name": "obj" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/for-in/obj-key/actual.js b/test/fixtures/lightscript/for-in/obj-key/actual.js new file mode 100644 index 0000000000..a1c705ed6b --- /dev/null +++ b/test/fixtures/lightscript/for-in/obj-key/actual.js @@ -0,0 +1 @@ +for key k in obj {} diff --git a/test/fixtures/lightscript/for-in/obj-key/expected.json b/test/fixtures/lightscript/for-in/obj-key/expected.json new file mode 100644 index 0000000000..4b4aa38602 --- /dev/null +++ b/test/fixtures/lightscript/for-in/obj-key/expected.json @@ -0,0 +1,103 @@ +{ + "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": "ForInObjectStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "key": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "k" + }, + "name": "k" + }, + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "object": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "obj" + }, + "name": "obj" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/for-in/obj-val-destructured-arr/actual.js b/test/fixtures/lightscript/for-in/obj-val-destructured-arr/actual.js new file mode 100644 index 0000000000..db57868214 --- /dev/null +++ b/test/fixtures/lightscript/for-in/obj-val-destructured-arr/actual.js @@ -0,0 +1 @@ +for val [x] in obj {} diff --git a/test/fixtures/lightscript/for-in/obj-val-destructured-arr/expected.json b/test/fixtures/lightscript/for-in/obj-val-destructured-arr/expected.json new file mode 100644 index 0000000000..03b9fccc4c --- /dev/null +++ b/test/fixtures/lightscript/for-in/obj-val-destructured-arr/expected.json @@ -0,0 +1,120 @@ +{ + "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": "ForInObjectStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "val": { + "type": "ArrayPattern", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + } + ] + }, + "body": { + "type": "BlockStatement", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "object": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "obj" + }, + "name": "obj" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/for-in/obj-val-destructured-complex/actual.js b/test/fixtures/lightscript/for-in/obj-val-destructured-complex/actual.js new file mode 100644 index 0000000000..e17836bd55 --- /dev/null +++ b/test/fixtures/lightscript/for-in/obj-val-destructured-complex/actual.js @@ -0,0 +1 @@ +for val [x, { a: [y, z], b = 2 }] in obj {} diff --git a/test/fixtures/lightscript/for-in/obj-val-destructured-complex/expected.json b/test/fixtures/lightscript/for-in/obj-val-destructured-complex/expected.json new file mode 100644 index 0000000000..cc9a804b93 --- /dev/null +++ b/test/fixtures/lightscript/for-in/obj-val-destructured-complex/expected.json @@ -0,0 +1,313 @@ +{ + "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": "script", + "body": [ + { + "type": "ForInObjectStatement", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "val": { + "type": "ArrayPattern", + "start": 8, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + }, + { + "type": "ObjectPattern", + "start": 12, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 14, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "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": "ArrayPattern", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "y" + }, + "name": "y" + }, + { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "z" + }, + "name": "z" + } + ] + } + }, + { + "type": "ObjectProperty", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + }, + "identifierName": "b" + }, + "name": "b" + }, + "value": { + "type": "AssignmentPattern", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "left": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + }, + "identifierName": "b" + }, + "name": "b" + }, + "right": { + "type": "NumericLiteral", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + }, + "extra": { + "shorthand": true + } + } + ] + } + ] + }, + "body": { + "type": "BlockStatement", + "start": 41, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "object": { + "type": "Identifier", + "start": 37, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 40 + }, + "identifierName": "obj" + }, + "name": "obj" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/for-in/obj-val-destructured-obj/actual.js b/test/fixtures/lightscript/for-in/obj-val-destructured-obj/actual.js new file mode 100644 index 0000000000..9066c4346e --- /dev/null +++ b/test/fixtures/lightscript/for-in/obj-val-destructured-obj/actual.js @@ -0,0 +1 @@ +for val { foo } in obj {} diff --git a/test/fixtures/lightscript/for-in/obj-val-destructured-obj/expected.json b/test/fixtures/lightscript/for-in/obj-val-destructured-obj/expected.json new file mode 100644 index 0000000000..4a6a97e035 --- /dev/null +++ b/test/fixtures/lightscript/for-in/obj-val-destructured-obj/expected.json @@ -0,0 +1,158 @@ +{ + "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": "ForInObjectStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "val": { + "type": "ObjectPattern", + "start": 8, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "value": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "body": { + "type": "BlockStatement", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "object": { + "type": "Identifier", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "obj" + }, + "name": "obj" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/for-in/obj-val-invalid-destructure/actual.js b/test/fixtures/lightscript/for-in/obj-val-invalid-destructure/actual.js new file mode 100644 index 0000000000..03f15c4ae6 --- /dev/null +++ b/test/fixtures/lightscript/for-in/obj-val-invalid-destructure/actual.js @@ -0,0 +1 @@ +for val { prop: 1 } in obj {} diff --git a/test/fixtures/lightscript/for-in/obj-val-invalid-destructure/options.json b/test/fixtures/lightscript/for-in/obj-val-invalid-destructure/options.json new file mode 100644 index 0000000000..4c07f39d17 --- /dev/null +++ b/test/fixtures/lightscript/for-in/obj-val-invalid-destructure/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:16)" +} diff --git a/test/fixtures/lightscript/for-in/obj-val-key/actual.js b/test/fixtures/lightscript/for-in/obj-val-key/actual.js new file mode 100644 index 0000000000..901b4e6bb2 --- /dev/null +++ b/test/fixtures/lightscript/for-in/obj-val-key/actual.js @@ -0,0 +1 @@ +for val v, key k in obj {} diff --git a/test/fixtures/lightscript/for-in/obj-val-key/expected.json b/test/fixtures/lightscript/for-in/obj-val-key/expected.json new file mode 100644 index 0000000000..739ce36cc8 --- /dev/null +++ b/test/fixtures/lightscript/for-in/obj-val-key/expected.json @@ -0,0 +1,120 @@ +{ + "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": "ForInObjectStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "val": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "v" + }, + "name": "v" + }, + "key": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "k" + }, + "name": "k" + }, + "body": { + "type": "BlockStatement", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "object": { + "type": "Identifier", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "obj" + }, + "name": "obj" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/for-in/obj-val/actual.js b/test/fixtures/lightscript/for-in/obj-val/actual.js new file mode 100644 index 0000000000..6844dafc85 --- /dev/null +++ b/test/fixtures/lightscript/for-in/obj-val/actual.js @@ -0,0 +1 @@ +for val v in obj {} diff --git a/test/fixtures/lightscript/for-in/obj-val/expected.json b/test/fixtures/lightscript/for-in/obj-val/expected.json new file mode 100644 index 0000000000..8f64948dc9 --- /dev/null +++ b/test/fixtures/lightscript/for-in/obj-val/expected.json @@ -0,0 +1,103 @@ +{ + "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": "ForInObjectStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "val": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "v" + }, + "name": "v" + }, + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "object": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "obj" + }, + "name": "obj" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/for-of/array-pattern/actual.js b/test/fixtures/lightscript/for-of/array-pattern/actual.js new file mode 100644 index 0000000000..a7351cd35a --- /dev/null +++ b/test/fixtures/lightscript/for-of/array-pattern/actual.js @@ -0,0 +1 @@ +for (now [p, q] of r); diff --git a/test/fixtures/lightscript/for-of/array-pattern/expected.json b/test/fixtures/lightscript/for-of/array-pattern/expected.json new file mode 100644 index 0000000000..4971180d1e --- /dev/null +++ b/test/fixtures/lightscript/for-of/array-pattern/expected.json @@ -0,0 +1,133 @@ +{ + "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": "ForOfStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "left": { + "type": "ArrayPattern", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "p" + }, + "name": "p" + }, + { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "q" + }, + "name": "q" + } + ], + "isNowAssign": true + }, + "right": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "r" + }, + "name": "r" + }, + "body": { + "type": "EmptyStatement", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/for-of/basic/actual.js b/test/fixtures/lightscript/for-of/basic/actual.js new file mode 100644 index 0000000000..28463ef55f --- /dev/null +++ b/test/fixtures/lightscript/for-of/basic/actual.js @@ -0,0 +1 @@ +for(now x of list) process(x); diff --git a/test/fixtures/lightscript/for-of/basic/expected.json b/test/fixtures/lightscript/for-of/basic/expected.json new file mode 100644 index 0000000000..4544ae8959 --- /dev/null +++ b/test/fixtures/lightscript/for-of/basic/expected.json @@ -0,0 +1,150 @@ +{ + "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": "ForOfStatement", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "left": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "x" + }, + "name": "x", + "isNowAssign": true + }, + "right": { + "type": "Identifier", + "start": 13, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "list" + }, + "name": "list" + }, + "body": { + "type": "ExpressionStatement", + "start": 19, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expression": { + "type": "CallExpression", + "start": 19, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "callee": { + "type": "Identifier", + "start": 19, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 26 + }, + "identifierName": "process" + }, + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + }, + "identifierName": "x" + }, + "name": "x" + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/for-of/invalid-lhs-init/actual.js b/test/fixtures/lightscript/for-of/invalid-lhs-init/actual.js new file mode 100644 index 0000000000..332343aef9 --- /dev/null +++ b/test/fixtures/lightscript/for-of/invalid-lhs-init/actual.js @@ -0,0 +1 @@ +for (now this of that); diff --git a/test/fixtures/lightscript/for-of/invalid-lhs-init/options.json b/test/fixtures/lightscript/for-of/invalid-lhs-init/options.json new file mode 100644 index 0000000000..4dea599986 --- /dev/null +++ b/test/fixtures/lightscript/for-of/invalid-lhs-init/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid left-hand side in for-of statement (1:9)" +} diff --git a/test/fixtures/lightscript/for-of/object-pattern/actual.js b/test/fixtures/lightscript/for-of/object-pattern/actual.js new file mode 100644 index 0000000000..87df051f34 --- /dev/null +++ b/test/fixtures/lightscript/for-of/object-pattern/actual.js @@ -0,0 +1 @@ +for (now {x, y} of z); diff --git a/test/fixtures/lightscript/for-of/object-pattern/expected.json b/test/fixtures/lightscript/for-of/object-pattern/expected.json new file mode 100644 index 0000000000..1077db8766 --- /dev/null +++ b/test/fixtures/lightscript/for-of/object-pattern/expected.json @@ -0,0 +1,209 @@ +{ + "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": "ForOfStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "left": { + "type": "ObjectPattern", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "method": false, + "shorthand": true, + "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": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "method": false, + "shorthand": true, + "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": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "y" + }, + "name": "y" + }, + "extra": { + "shorthand": true + } + } + ], + "isNowAssign": true + }, + "right": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "z" + }, + "name": "z" + }, + "body": { + "type": "EmptyStatement", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/for/with-now/actual.js b/test/fixtures/lightscript/for/with-now/actual.js new file mode 100644 index 0000000000..9120370873 --- /dev/null +++ b/test/fixtures/lightscript/for/with-now/actual.js @@ -0,0 +1 @@ +for (now i=0; i 1 { + 'a' +} else + 'b' diff --git a/test/fixtures/lightscript/if-expression/braces-no-colon/expected.json b/test/fixtures/lightscript/if-expression/braces-no-colon/expected.json new file mode 100644 index 0000000000..2426c0dfe3 --- /dev/null +++ b/test/fixtures/lightscript/if-expression/braces-no-colon/expected.json @@ -0,0 +1,231 @@ +{ + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "y" + }, + "name": "y" + }, + "init": { + "type": "IfExpression", + "start": 4, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "test": { + "type": "BinaryExpression", + "start": 7, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "left": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": ">", + "right": { + "type": "NumericLiteral", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + "consequent": { + "type": "BlockStatement", + "start": 13, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "expression": { + "type": "StringLiteral", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "extra": { + "rawValue": "a", + "raw": "'a'" + }, + "value": "a" + } + } + ], + "directives": [], + "extra": { + "curly": true + } + }, + "alternate": { + "type": "StringLiteral", + "start": 30, + "end": 33, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "extra": { + "rawValue": "b", + "raw": "'b'" + }, + "value": "b" + } + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/if-expression/colon-braces/actual.js b/test/fixtures/lightscript/if-expression/colon-braces/actual.js new file mode 100644 index 0000000000..b6a9f9c70e --- /dev/null +++ b/test/fixtures/lightscript/if-expression/colon-braces/actual.js @@ -0,0 +1,5 @@ +y = if x > 1: + 'a' +else { + 'b' +} diff --git a/test/fixtures/lightscript/if-expression/colon-braces/options.json b/test/fixtures/lightscript/if-expression/colon-braces/options.json new file mode 100644 index 0000000000..4252ad09b1 --- /dev/null +++ b/test/fixtures/lightscript/if-expression/colon-braces/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected : (3:4)" +} diff --git a/test/fixtures/lightscript/if-expression/colon-no-colon/actual.js b/test/fixtures/lightscript/if-expression/colon-no-colon/actual.js new file mode 100644 index 0000000000..0d24ea39eb --- /dev/null +++ b/test/fixtures/lightscript/if-expression/colon-no-colon/actual.js @@ -0,0 +1,4 @@ +y = if x > 1: + 'a' +else + 'b' diff --git a/test/fixtures/lightscript/if-expression/colon-no-colon/options.json b/test/fixtures/lightscript/if-expression/colon-no-colon/options.json new file mode 100644 index 0000000000..4252ad09b1 --- /dev/null +++ b/test/fixtures/lightscript/if-expression/colon-no-colon/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected : (3:4)" +} diff --git a/test/fixtures/lightscript/if-expression/colon-oneline/actual.js b/test/fixtures/lightscript/if-expression/colon-oneline/actual.js new file mode 100644 index 0000000000..7a0b8bdc61 --- /dev/null +++ b/test/fixtures/lightscript/if-expression/colon-oneline/actual.js @@ -0,0 +1,3 @@ +y = if x > 1: + 'a' +else 'b' diff --git a/test/fixtures/lightscript/if-expression/colon-oneline/options.json b/test/fixtures/lightscript/if-expression/colon-oneline/options.json new file mode 100644 index 0000000000..4252ad09b1 --- /dev/null +++ b/test/fixtures/lightscript/if-expression/colon-oneline/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected : (3:4)" +} diff --git a/test/fixtures/lightscript/if-expression/elif-indent-mismatch/actual.js b/test/fixtures/lightscript/if-expression/elif-indent-mismatch/actual.js new file mode 100644 index 0000000000..0a656310ba --- /dev/null +++ b/test/fixtures/lightscript/if-expression/elif-indent-mismatch/actual.js @@ -0,0 +1,3 @@ +x = if false: 1 + elif true: + 2 diff --git a/test/fixtures/lightscript/if-expression/elif-indent-mismatch/options.json b/test/fixtures/lightscript/if-expression/elif-indent-mismatch/options.json new file mode 100644 index 0000000000..dab65d8f73 --- /dev/null +++ b/test/fixtures/lightscript/if-expression/elif-indent-mismatch/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unmatched `else` (must match indentation of the line with `if`). (2:2)" +} diff --git a/test/fixtures/lightscript/if-expression/elif-mismatch/actual.js b/test/fixtures/lightscript/if-expression/elif-mismatch/actual.js new file mode 100644 index 0000000000..8691ac20cc --- /dev/null +++ b/test/fixtures/lightscript/if-expression/elif-mismatch/actual.js @@ -0,0 +1,4 @@ +y = if x > 1: + 'a' +elif x < -1 + 'b' diff --git a/test/fixtures/lightscript/if-expression/elif-mismatch/options.json b/test/fixtures/lightscript/if-expression/elif-mismatch/options.json new file mode 100644 index 0000000000..2dd3f546e9 --- /dev/null +++ b/test/fixtures/lightscript/if-expression/elif-mismatch/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Paren-free test expressions must be followed by braces or a colon. (4:2)" +} diff --git a/test/fixtures/lightscript/if-expression/elif/actual.js b/test/fixtures/lightscript/if-expression/elif/actual.js new file mode 100644 index 0000000000..407d6da962 --- /dev/null +++ b/test/fixtures/lightscript/if-expression/elif/actual.js @@ -0,0 +1,4 @@ +x = if false: + 1 +elif true: + 2 diff --git a/test/fixtures/lightscript/if-expression/elif/expected.json b/test/fixtures/lightscript/if-expression/elif/expected.json new file mode 100644 index 0000000000..e75104f008 --- /dev/null +++ b/test/fixtures/lightscript/if-expression/elif/expected.json @@ -0,0 +1,259 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "IfExpression", + "start": 4, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 7, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": false + }, + "consequent": { + "type": "BlockStatement", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": { + "type": "IfExpression", + "start": 18, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 23, + "end": 27, + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "value": true + }, + "consequent": { + "type": "BlockStatement", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": null + } + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/if-expression/else-if/actual.js b/test/fixtures/lightscript/if-expression/else-if/actual.js new file mode 100644 index 0000000000..46fa31a34e --- /dev/null +++ b/test/fixtures/lightscript/if-expression/else-if/actual.js @@ -0,0 +1,4 @@ +x = if false: + 1 +else if true: + 2 diff --git a/test/fixtures/lightscript/if-expression/else-if/expected.json b/test/fixtures/lightscript/if-expression/else-if/expected.json new file mode 100644 index 0000000000..5acad0015a --- /dev/null +++ b/test/fixtures/lightscript/if-expression/else-if/expected.json @@ -0,0 +1,259 @@ +{ + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "IfExpression", + "start": 4, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 7, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": false + }, + "consequent": { + "type": "BlockStatement", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": { + "type": "IfExpression", + "start": 23, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 26, + "end": 30, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 12 + } + }, + "value": true + }, + "consequent": { + "type": "BlockStatement", + "start": 30, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": null + } + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/if-expression/elseif-mismatch/actual.js b/test/fixtures/lightscript/if-expression/elseif-mismatch/actual.js new file mode 100644 index 0000000000..256b14f96e --- /dev/null +++ b/test/fixtures/lightscript/if-expression/elseif-mismatch/actual.js @@ -0,0 +1,5 @@ +y = if x > 1: + 'a' +else if x < -1 { + 'b' +} diff --git a/test/fixtures/lightscript/if-expression/elseif-mismatch/options.json b/test/fixtures/lightscript/if-expression/elseif-mismatch/options.json new file mode 100644 index 0000000000..d4c511a6db --- /dev/null +++ b/test/fixtures/lightscript/if-expression/elseif-mismatch/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected : (3:15)" +} diff --git a/test/fixtures/lightscript/if-expression/inner-if-stmt-await/actual.js b/test/fixtures/lightscript/if-expression/inner-if-stmt-await/actual.js new file mode 100644 index 0000000000..029b40da09 --- /dev/null +++ b/test/fixtures/lightscript/if-expression/inner-if-stmt-await/actual.js @@ -0,0 +1,4 @@ +f() -/> + x = if true: + if true: + await 1 diff --git a/test/fixtures/lightscript/if-expression/inner-if-stmt-await/expected.json b/test/fixtures/lightscript/if-expression/inner-if-stmt-await/expected.json new file mode 100644 index 0000000000..c69c1ca8d7 --- /dev/null +++ b/test/fixtures/lightscript/if-expression/inner-if-stmt-await/expected.json @@ -0,0 +1,301 @@ +{ + "type": "File", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "expression": false, + "async": true, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 4, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 10, + "end": 49, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 10, + "end": 49, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "IfExpression", + "start": 14, + "end": 49, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 17, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "value": true + }, + "consequent": { + "type": "BlockStatement", + "start": 21, + "end": 49, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "body": [ + { + "type": "IfStatement", + "start": 27, + "end": 49, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 30, + "end": 34, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "value": true + }, + "consequent": { + "type": "BlockStatement", + "start": 34, + "end": 49, + "loc": { + "start": { + "line": 3, + "column": 11 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 42, + "end": 49, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "expression": { + "type": "AwaitExpression", + "start": 42, + "end": 49, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "argument": { + "type": "NumericLiteral", + "start": 48, + "end": 49, + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": null + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": null + } + } + ] + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/if-expression/inner-if-stmt-break/actual.js b/test/fixtures/lightscript/if-expression/inner-if-stmt-break/actual.js new file mode 100644 index 0000000000..47741433b2 --- /dev/null +++ b/test/fixtures/lightscript/if-expression/inner-if-stmt-break/actual.js @@ -0,0 +1,4 @@ +while false: + x = if true: + if true: + break diff --git a/test/fixtures/lightscript/if-expression/inner-if-stmt-break/options.json b/test/fixtures/lightscript/if-expression/inner-if-stmt-break/options.json new file mode 100644 index 0000000000..8337fad4a8 --- /dev/null +++ b/test/fixtures/lightscript/if-expression/inner-if-stmt-break/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unsyntactic break (4:6)" +} diff --git a/test/fixtures/lightscript/if-expression/inner-if-stmt-return/actual.js b/test/fixtures/lightscript/if-expression/inner-if-stmt-return/actual.js new file mode 100644 index 0000000000..2e52f3f567 --- /dev/null +++ b/test/fixtures/lightscript/if-expression/inner-if-stmt-return/actual.js @@ -0,0 +1,4 @@ +f() -> + x = if true: + if true: + return diff --git a/test/fixtures/lightscript/if-expression/inner-if-stmt-return/options.json b/test/fixtures/lightscript/if-expression/inner-if-stmt-return/options.json new file mode 100644 index 0000000000..9a63b4c53e --- /dev/null +++ b/test/fixtures/lightscript/if-expression/inner-if-stmt-return/options.json @@ -0,0 +1,3 @@ +{ + "throws": "'return' outside of function (4:6)" +} diff --git a/test/fixtures/lightscript/if-expression/no-alternate/actual.js b/test/fixtures/lightscript/if-expression/no-alternate/actual.js new file mode 100644 index 0000000000..29b277f79d --- /dev/null +++ b/test/fixtures/lightscript/if-expression/no-alternate/actual.js @@ -0,0 +1 @@ +x = if false: 1 diff --git a/test/fixtures/lightscript/if-expression/no-alternate/expected.json b/test/fixtures/lightscript/if-expression/no-alternate/expected.json new file mode 100644 index 0000000000..571753e36e --- /dev/null +++ b/test/fixtures/lightscript/if-expression/no-alternate/expected.json @@ -0,0 +1,136 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "IfExpression", + "start": 4, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 7, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": false + }, + "consequent": { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "alternate": null + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/if-expression/no-colon-colon/actual.js b/test/fixtures/lightscript/if-expression/no-colon-colon/actual.js new file mode 100644 index 0000000000..3dc40bd585 --- /dev/null +++ b/test/fixtures/lightscript/if-expression/no-colon-colon/actual.js @@ -0,0 +1,4 @@ +y = if x > 1 + 'a' +else: + 'b' diff --git a/test/fixtures/lightscript/if-expression/no-colon-colon/options.json b/test/fixtures/lightscript/if-expression/no-colon-colon/options.json new file mode 100644 index 0000000000..82bb227caf --- /dev/null +++ b/test/fixtures/lightscript/if-expression/no-colon-colon/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Paren-free test expressions must be followed by braces or a colon. (2:2)" +} diff --git a/test/fixtures/lightscript/if-expression/no-delimiters/actual.js b/test/fixtures/lightscript/if-expression/no-delimiters/actual.js new file mode 100644 index 0000000000..235b0d3591 --- /dev/null +++ b/test/fixtures/lightscript/if-expression/no-delimiters/actual.js @@ -0,0 +1,4 @@ +y = if x > 1 + 'a' +else + 'b' diff --git a/test/fixtures/lightscript/if-expression/no-delimiters/options.json b/test/fixtures/lightscript/if-expression/no-delimiters/options.json new file mode 100644 index 0000000000..82bb227caf --- /dev/null +++ b/test/fixtures/lightscript/if-expression/no-delimiters/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Paren-free test expressions must be followed by braces or a colon. (2:2)" +} diff --git a/test/fixtures/lightscript/if-expression/oneline-stmt/actual.js b/test/fixtures/lightscript/if-expression/oneline-stmt/actual.js new file mode 100644 index 0000000000..45fb36cbb0 --- /dev/null +++ b/test/fixtures/lightscript/if-expression/oneline-stmt/actual.js @@ -0,0 +1,2 @@ +-> + x = if y: return z else: throw new Error diff --git a/test/fixtures/lightscript/if-expression/oneline-stmt/options.json b/test/fixtures/lightscript/if-expression/oneline-stmt/options.json new file mode 100644 index 0000000000..66927a25e4 --- /dev/null +++ b/test/fixtures/lightscript/if-expression/oneline-stmt/options.json @@ -0,0 +1,3 @@ +{ + "throws": "'return' outside of function (2:12)" +} diff --git a/test/fixtures/lightscript/if-expression/oneline-then-block/actual.js b/test/fixtures/lightscript/if-expression/oneline-then-block/actual.js new file mode 100644 index 0000000000..8268673022 --- /dev/null +++ b/test/fixtures/lightscript/if-expression/oneline-then-block/actual.js @@ -0,0 +1,4 @@ +x = + if false: 1 + elif true: + 2 diff --git a/test/fixtures/lightscript/if-expression/oneline-then-block/expected.json b/test/fixtures/lightscript/if-expression/oneline-then-block/expected.json new file mode 100644 index 0000000000..664d800eec --- /dev/null +++ b/test/fixtures/lightscript/if-expression/oneline-then-block/expected.json @@ -0,0 +1,226 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "IfExpression", + "start": 6, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "value": false + }, + "consequent": { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "alternate": { + "type": "IfExpression", + "start": 20, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 25, + "end": 29, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "value": true + }, + "consequent": { + "type": "BlockStatement", + "start": 29, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 11 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": null + } + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/if-expression/oneline/actual.js b/test/fixtures/lightscript/if-expression/oneline/actual.js new file mode 100644 index 0000000000..2b0ee792e8 --- /dev/null +++ b/test/fixtures/lightscript/if-expression/oneline/actual.js @@ -0,0 +1 @@ +x = if false: 1 elif true: 2 else: 3 diff --git a/test/fixtures/lightscript/if-expression/oneline/expected.json b/test/fixtures/lightscript/if-expression/oneline/expected.json new file mode 100644 index 0000000000..3f54e70167 --- /dev/null +++ b/test/fixtures/lightscript/if-expression/oneline/expected.json @@ -0,0 +1,206 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "IfExpression", + "start": 4, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 7, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": false + }, + "consequent": { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "alternate": { + "type": "IfExpression", + "start": 16, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 21, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "value": true + }, + "consequent": { + "type": "NumericLiteral", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + }, + "alternate": { + "type": "NumericLiteral", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + } + } + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/if-expression/paren-expr-body/actual.js b/test/fixtures/lightscript/if-expression/paren-expr-body/actual.js new file mode 100644 index 0000000000..4111df7124 --- /dev/null +++ b/test/fixtures/lightscript/if-expression/paren-expr-body/actual.js @@ -0,0 +1 @@ +x = if(true) 1 diff --git a/test/fixtures/lightscript/if-expression/paren-expr-body/expected.json b/test/fixtures/lightscript/if-expression/paren-expr-body/expected.json new file mode 100644 index 0000000000..d1f116ffe9 --- /dev/null +++ b/test/fixtures/lightscript/if-expression/paren-expr-body/expected.json @@ -0,0 +1,139 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "IfExpression", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true + }, + "consequent": { + "type": "NumericLiteral", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "alternate": null + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/if-statement/braces-colon/actual.js b/test/fixtures/lightscript/if-statement/braces-colon/actual.js new file mode 100644 index 0000000000..f2d84f0ba5 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/braces-colon/actual.js @@ -0,0 +1,4 @@ +if x > 1 { + 'a' +} else: + 'b' diff --git a/test/fixtures/lightscript/if-statement/braces-colon/options.json b/test/fixtures/lightscript/if-statement/braces-colon/options.json new file mode 100644 index 0000000000..3aea067619 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/braces-colon/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected { (3:6)" +} diff --git a/test/fixtures/lightscript/if-statement/braces-elif-colon-2/actual.js b/test/fixtures/lightscript/if-statement/braces-elif-colon-2/actual.js new file mode 100644 index 0000000000..907bbd9d53 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/braces-elif-colon-2/actual.js @@ -0,0 +1,6 @@ +if x > 1 { + 'a' +} elif 1 { + 'b' +} else if 1: + 'c' diff --git a/test/fixtures/lightscript/if-statement/braces-elif-colon-2/options.json b/test/fixtures/lightscript/if-statement/braces-elif-colon-2/options.json new file mode 100644 index 0000000000..afa194f93a --- /dev/null +++ b/test/fixtures/lightscript/if-statement/braces-elif-colon-2/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected { (5:11)" +} diff --git a/test/fixtures/lightscript/if-statement/braces-elif-colon/actual.js b/test/fixtures/lightscript/if-statement/braces-elif-colon/actual.js new file mode 100644 index 0000000000..43402c99d2 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/braces-elif-colon/actual.js @@ -0,0 +1,4 @@ +if x > 1 { + 'a' +} elif 1: + 'b' diff --git a/test/fixtures/lightscript/if-statement/braces-elif-colon/options.json b/test/fixtures/lightscript/if-statement/braces-elif-colon/options.json new file mode 100644 index 0000000000..8f07dfc5f2 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/braces-elif-colon/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected { (3:8)" +} diff --git a/test/fixtures/lightscript/if-statement/braces-no-colon/actual.js b/test/fixtures/lightscript/if-statement/braces-no-colon/actual.js new file mode 100644 index 0000000000..57ec167146 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/braces-no-colon/actual.js @@ -0,0 +1,4 @@ +if x > 1 { + 'a' +} else + 'b' diff --git a/test/fixtures/lightscript/if-statement/braces-no-colon/expected.json b/test/fixtures/lightscript/if-statement/braces-no-colon/expected.json new file mode 100644 index 0000000000..fe49aac225 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/braces-no-colon/expected.json @@ -0,0 +1,193 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "test": { + "type": "BinaryExpression", + "start": 3, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "left": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": ">", + "right": { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + "consequent": { + "type": "BlockStatement", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "expression": { + "type": "StringLiteral", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "extra": { + "rawValue": "a", + "raw": "'a'" + }, + "value": "a" + } + } + ], + "directives": [], + "extra": { + "curly": true + } + }, + "alternate": { + "type": "ExpressionStatement", + "start": 26, + "end": 29, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "expression": { + "type": "StringLiteral", + "start": 26, + "end": 29, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "extra": { + "rawValue": "b", + "raw": "'b'" + }, + "value": "b" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/if-statement/colon-braces/actual.js b/test/fixtures/lightscript/if-statement/colon-braces/actual.js new file mode 100644 index 0000000000..a2fa5e93e1 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/colon-braces/actual.js @@ -0,0 +1,5 @@ +if x > 1: + 'a' +else { + 'b' +} diff --git a/test/fixtures/lightscript/if-statement/colon-braces/options.json b/test/fixtures/lightscript/if-statement/colon-braces/options.json new file mode 100644 index 0000000000..4252ad09b1 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/colon-braces/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected : (3:4)" +} diff --git a/test/fixtures/lightscript/if-statement/colon-no-colon/actual.js b/test/fixtures/lightscript/if-statement/colon-no-colon/actual.js new file mode 100644 index 0000000000..dcad42332c --- /dev/null +++ b/test/fixtures/lightscript/if-statement/colon-no-colon/actual.js @@ -0,0 +1,4 @@ +if x > 1: + 'a' +else + 'b' diff --git a/test/fixtures/lightscript/if-statement/colon-no-colon/options.json b/test/fixtures/lightscript/if-statement/colon-no-colon/options.json new file mode 100644 index 0000000000..4252ad09b1 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/colon-no-colon/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected : (3:4)" +} diff --git a/test/fixtures/lightscript/if-statement/colon-oneline/actual.js b/test/fixtures/lightscript/if-statement/colon-oneline/actual.js new file mode 100644 index 0000000000..3402898ac6 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/colon-oneline/actual.js @@ -0,0 +1,3 @@ +if x > 1: + 'a' +else 'b' diff --git a/test/fixtures/lightscript/if-statement/colon-oneline/options.json b/test/fixtures/lightscript/if-statement/colon-oneline/options.json new file mode 100644 index 0000000000..4252ad09b1 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/colon-oneline/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected : (3:4)" +} diff --git a/test/fixtures/lightscript/if-statement/elif-mismatch/actual.js b/test/fixtures/lightscript/if-statement/elif-mismatch/actual.js new file mode 100644 index 0000000000..1014e52612 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/elif-mismatch/actual.js @@ -0,0 +1,4 @@ +if x > 1: + 'a' +elif x < -1 + 'b' diff --git a/test/fixtures/lightscript/if-statement/elif-mismatch/options.json b/test/fixtures/lightscript/if-statement/elif-mismatch/options.json new file mode 100644 index 0000000000..2dd3f546e9 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/elif-mismatch/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Paren-free test expressions must be followed by braces or a colon. (4:2)" +} diff --git a/test/fixtures/lightscript/if-statement/elif/actual.js b/test/fixtures/lightscript/if-statement/elif/actual.js new file mode 100644 index 0000000000..05df1c73cb --- /dev/null +++ b/test/fixtures/lightscript/if-statement/elif/actual.js @@ -0,0 +1,4 @@ +if x > 1: + 'a' +elif x < -1: + 'b' diff --git a/test/fixtures/lightscript/if-statement/elif/expected.json b/test/fixtures/lightscript/if-statement/elif/expected.json new file mode 100644 index 0000000000..64eab1d858 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/elif/expected.json @@ -0,0 +1,303 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "test": { + "type": "BinaryExpression", + "start": 3, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "left": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": ">", + "right": { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + "consequent": { + "type": "BlockStatement", + "start": 8, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "expression": { + "type": "StringLiteral", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "extra": { + "rawValue": "a", + "raw": "'a'" + }, + "value": "a" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": { + "type": "IfStatement", + "start": 16, + "end": 34, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "test": { + "type": "BinaryExpression", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "left": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 6 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "<", + "right": { + "type": "UnaryExpression", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "operator": "-", + "prefix": true, + "argument": { + "type": "NumericLiteral", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "extra": { + "parenthesizedArgument": false + } + } + }, + "consequent": { + "type": "BlockStatement", + "start": 27, + "end": 34, + "loc": { + "start": { + "line": 3, + "column": 11 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 31, + "end": 34, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "expression": { + "type": "StringLiteral", + "start": 31, + "end": 34, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "extra": { + "rawValue": "b", + "raw": "'b'" + }, + "value": "b" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": null + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/if-statement/else-if-illegal-newline/actual.js b/test/fixtures/lightscript/if-statement/else-if-illegal-newline/actual.js new file mode 100644 index 0000000000..7f78e899a2 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/else-if-illegal-newline/actual.js @@ -0,0 +1,5 @@ +if x > 1: + 'a' +else + if x < -1: + 'b' diff --git a/test/fixtures/lightscript/if-statement/else-if-illegal-newline/options.json b/test/fixtures/lightscript/if-statement/else-if-illegal-newline/options.json new file mode 100644 index 0000000000..4b23db84f3 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/else-if-illegal-newline/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Illegal newline. (3:4)" +} diff --git a/test/fixtures/lightscript/if-statement/elseif-mismatch/actual.js b/test/fixtures/lightscript/if-statement/elseif-mismatch/actual.js new file mode 100644 index 0000000000..af821a8519 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/elseif-mismatch/actual.js @@ -0,0 +1,5 @@ +if x > 1: + 'a' +else if x < -1 { + 'b' +} diff --git a/test/fixtures/lightscript/if-statement/elseif-mismatch/options.json b/test/fixtures/lightscript/if-statement/elseif-mismatch/options.json new file mode 100644 index 0000000000..d4c511a6db --- /dev/null +++ b/test/fixtures/lightscript/if-statement/elseif-mismatch/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected : (3:15)" +} diff --git a/test/fixtures/lightscript/if-statement/elseif/actual.js b/test/fixtures/lightscript/if-statement/elseif/actual.js new file mode 100644 index 0000000000..68772ca1e8 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/elseif/actual.js @@ -0,0 +1,4 @@ +if x > 1: + 'a' +else if x < -1: + 'b' diff --git a/test/fixtures/lightscript/if-statement/elseif/expected.json b/test/fixtures/lightscript/if-statement/elseif/expected.json new file mode 100644 index 0000000000..0c5eae946a --- /dev/null +++ b/test/fixtures/lightscript/if-statement/elseif/expected.json @@ -0,0 +1,303 @@ +{ + "type": "File", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "test": { + "type": "BinaryExpression", + "start": 3, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "left": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": ">", + "right": { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + "consequent": { + "type": "BlockStatement", + "start": 8, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "expression": { + "type": "StringLiteral", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "extra": { + "rawValue": "a", + "raw": "'a'" + }, + "value": "a" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": { + "type": "IfStatement", + "start": 21, + "end": 37, + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "test": { + "type": "BinaryExpression", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "left": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "<", + "right": { + "type": "UnaryExpression", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "operator": "-", + "prefix": true, + "argument": { + "type": "NumericLiteral", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "extra": { + "parenthesizedArgument": false + } + } + }, + "consequent": { + "type": "BlockStatement", + "start": 30, + "end": 37, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 34, + "end": 37, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "expression": { + "type": "StringLiteral", + "start": 34, + "end": 37, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "extra": { + "rawValue": "b", + "raw": "'b'" + }, + "value": "b" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": null + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/if-statement/no-colon-colon/actual.js b/test/fixtures/lightscript/if-statement/no-colon-colon/actual.js new file mode 100644 index 0000000000..143df69513 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/no-colon-colon/actual.js @@ -0,0 +1,4 @@ +if x > 1 + 'a' +else: + 'b' diff --git a/test/fixtures/lightscript/if-statement/no-colon-colon/options.json b/test/fixtures/lightscript/if-statement/no-colon-colon/options.json new file mode 100644 index 0000000000..82bb227caf --- /dev/null +++ b/test/fixtures/lightscript/if-statement/no-colon-colon/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Paren-free test expressions must be followed by braces or a colon. (2:2)" +} diff --git a/test/fixtures/lightscript/if-statement/no-delimiters/actual.js b/test/fixtures/lightscript/if-statement/no-delimiters/actual.js new file mode 100644 index 0000000000..09773735aa --- /dev/null +++ b/test/fixtures/lightscript/if-statement/no-delimiters/actual.js @@ -0,0 +1,4 @@ +if x > 1 + 'a' +else + 'b' diff --git a/test/fixtures/lightscript/if-statement/no-delimiters/options.json b/test/fixtures/lightscript/if-statement/no-delimiters/options.json new file mode 100644 index 0000000000..82bb227caf --- /dev/null +++ b/test/fixtures/lightscript/if-statement/no-delimiters/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Paren-free test expressions must be followed by braces or a colon. (2:2)" +} diff --git a/test/fixtures/lightscript/if-statement/oneline-return-colons/actual.js b/test/fixtures/lightscript/if-statement/oneline-return-colons/actual.js new file mode 100644 index 0000000000..c39c85d749 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/oneline-return-colons/actual.js @@ -0,0 +1,2 @@ +f() -> + if true: 1 else: 2 diff --git a/test/fixtures/lightscript/if-statement/oneline-return-colons/expected.json b/test/fixtures/lightscript/if-statement/oneline-return-colons/expected.json new file mode 100644 index 0000000000..ce7ee384c5 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/oneline-return-colons/expected.json @@ -0,0 +1,193 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 4, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "body": [ + { + "type": "IfStatement", + "start": 9, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "value": true + }, + "consequent": { + "type": "ExpressionStatement", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + "alternate": { + "type": "ExpressionStatement", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/if-statement/oneline-return-undelimited/actual.js b/test/fixtures/lightscript/if-statement/oneline-return-undelimited/actual.js new file mode 100644 index 0000000000..08580e2730 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/oneline-return-undelimited/actual.js @@ -0,0 +1,2 @@ +f() -> + if (true) return 1 else return 2 diff --git a/test/fixtures/lightscript/if-statement/oneline-return-undelimited/expected.json b/test/fixtures/lightscript/if-statement/oneline-return-undelimited/expected.json new file mode 100644 index 0000000000..9ae52f58a5 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/oneline-return-undelimited/expected.json @@ -0,0 +1,193 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 34 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 4, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 2, + "column": 34 + } + }, + "body": [ + { + "type": "IfStatement", + "start": 9, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 34 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 13, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "value": true + }, + "consequent": { + "type": "ReturnStatement", + "start": 19, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "argument": { + "type": "NumericLiteral", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + "alternate": { + "type": "ReturnStatement", + "start": 33, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 26 + }, + "end": { + "line": 2, + "column": 34 + } + }, + "argument": { + "type": "NumericLiteral", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 33 + }, + "end": { + "line": 2, + "column": 34 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/if-statement/paren-expr-body/actual.js b/test/fixtures/lightscript/if-statement/paren-expr-body/actual.js new file mode 100644 index 0000000000..b9e337492c --- /dev/null +++ b/test/fixtures/lightscript/if-statement/paren-expr-body/actual.js @@ -0,0 +1 @@ +if(true) 1 diff --git a/test/fixtures/lightscript/if-statement/paren-expr-body/expected.json b/test/fixtures/lightscript/if-statement/paren-expr-body/expected.json new file mode 100644 index 0000000000..562e219a07 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/paren-expr-body/expected.json @@ -0,0 +1,101 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 3, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": true + }, + "consequent": { + "type": "ExpressionStatement", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + "alternate": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/if-statement/threeline-return/actual.js b/test/fixtures/lightscript/if-statement/threeline-return/actual.js new file mode 100644 index 0000000000..65c7b544e2 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/threeline-return/actual.js @@ -0,0 +1,4 @@ +f() -> + if true: + return 1 + else return 2 diff --git a/test/fixtures/lightscript/if-statement/threeline-return/options.json b/test/fixtures/lightscript/if-statement/threeline-return/options.json new file mode 100644 index 0000000000..5d4961fa0e --- /dev/null +++ b/test/fixtures/lightscript/if-statement/threeline-return/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected : (4:6)" +} diff --git a/test/fixtures/lightscript/if-statement/twoline-return/actual.js b/test/fixtures/lightscript/if-statement/twoline-return/actual.js new file mode 100644 index 0000000000..5cd778ba11 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/twoline-return/actual.js @@ -0,0 +1,3 @@ +f() -> + if (true) return 1 + else return 2 diff --git a/test/fixtures/lightscript/if-statement/twoline-return/expected.json b/test/fixtures/lightscript/if-statement/twoline-return/expected.json new file mode 100644 index 0000000000..81b40b4a08 --- /dev/null +++ b/test/fixtures/lightscript/if-statement/twoline-return/expected.json @@ -0,0 +1,193 @@ +{ + "type": "File", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 4, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "body": [ + { + "type": "IfStatement", + "start": 9, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 13, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "value": true + }, + "consequent": { + "type": "ReturnStatement", + "start": 19, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "argument": { + "type": "NumericLiteral", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + "alternate": { + "type": "ReturnStatement", + "start": 35, + "end": 43, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "argument": { + "type": "NumericLiteral", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/index-dot-access/basic-0/actual.js b/test/fixtures/lightscript/index-dot-access/basic-0/actual.js new file mode 100644 index 0000000000..2d746d070a --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/basic-0/actual.js @@ -0,0 +1 @@ +x.0 diff --git a/test/fixtures/lightscript/index-dot-access/basic-0/expected.json b/test/fixtures/lightscript/index-dot-access/basic-0/expected.json new file mode 100644 index 0000000000..1bae9d8701 --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/basic-0/expected.json @@ -0,0 +1,102 @@ +{ + "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": "MemberExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "property": { + "type": "NumericLiteral", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + "computed": true + } + } + ], + "directives": [] + } +} diff --git a/test/fixtures/lightscript/index-dot-access/basic-1/actual.js b/test/fixtures/lightscript/index-dot-access/basic-1/actual.js new file mode 100644 index 0000000000..3f8501f735 --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/basic-1/actual.js @@ -0,0 +1 @@ +x.1 diff --git a/test/fixtures/lightscript/index-dot-access/basic-1/expected.json b/test/fixtures/lightscript/index-dot-access/basic-1/expected.json new file mode 100644 index 0000000000..0c26866a89 --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/basic-1/expected.json @@ -0,0 +1,102 @@ +{ + "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": "MemberExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "property": { + "type": "NumericLiteral", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "computed": true + } + } + ], + "directives": [] + } +} diff --git a/test/fixtures/lightscript/index-dot-access/decimal-method/actual.js b/test/fixtures/lightscript/index-dot-access/decimal-method/actual.js new file mode 100644 index 0000000000..ee98ab6b94 --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/decimal-method/actual.js @@ -0,0 +1 @@ +0.0.toString() diff --git a/test/fixtures/lightscript/index-dot-access/decimal-method/expected.json b/test/fixtures/lightscript/index-dot-access/decimal-method/expected.json new file mode 100644 index 0000000000..f06f3225f3 --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/decimal-method/expected.json @@ -0,0 +1,118 @@ +{ + "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": "CallExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "callee": { + "type": "MemberExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "object": { + "type": "NumericLiteral", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 0, + "raw": "0.0" + }, + "value": 0 + }, + "property": { + "type": "Identifier", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "toString" + }, + "name": "toString" + }, + "computed": false + }, + "arguments": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/index-dot-access/decimal-spread/actual.js b/test/fixtures/lightscript/index-dot-access/decimal-spread/actual.js new file mode 100644 index 0000000000..e557ed1b43 --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/decimal-spread/actual.js @@ -0,0 +1 @@ +f(...0.0) diff --git a/test/fixtures/lightscript/index-dot-access/decimal-spread/expected.json b/test/fixtures/lightscript/index-dot-access/decimal-spread/expected.json new file mode 100644 index 0000000000..74ffe2effc --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/decimal-spread/expected.json @@ -0,0 +1,118 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "f" + }, + "name": "f" + }, + "arguments": [ + { + "type": "SpreadElement", + "start": 2, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "argument": { + "type": "NumericLiteral", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0.0" + }, + "value": 0 + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/index-dot-access/malformed-trailing-letter/actual.js b/test/fixtures/lightscript/index-dot-access/malformed-trailing-letter/actual.js new file mode 100644 index 0000000000..811217b19e --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/malformed-trailing-letter/actual.js @@ -0,0 +1 @@ +x.1a diff --git a/test/fixtures/lightscript/index-dot-access/malformed-trailing-letter/options.json b/test/fixtures/lightscript/index-dot-access/malformed-trailing-letter/options.json new file mode 100644 index 0000000000..dd76235059 --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/malformed-trailing-letter/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Identifier directly after number (1:3)" +} diff --git a/test/fixtures/lightscript/index-dot-access/no-leading-int-illegal/actual.js b/test/fixtures/lightscript/index-dot-access/no-leading-int-illegal/actual.js new file mode 100644 index 0000000000..b7e2d6208f --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/no-leading-int-illegal/actual.js @@ -0,0 +1 @@ +.1 diff --git a/test/fixtures/lightscript/index-dot-access/no-leading-int-illegal/options.json b/test/fixtures/lightscript/index-dot-access/no-leading-int-illegal/options.json new file mode 100644 index 0000000000..ced6ccb19f --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/no-leading-int-illegal/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Decimal numbers must be prefixed with a `0` in LightScript (eg; `0.1`). (1:0)" +} diff --git a/test/fixtures/lightscript/index-dot-access/no-trailing-int-illegal/actual.js b/test/fixtures/lightscript/index-dot-access/no-trailing-int-illegal/actual.js new file mode 100644 index 0000000000..d54c6b66bc --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/no-trailing-int-illegal/actual.js @@ -0,0 +1 @@ +1. diff --git a/test/fixtures/lightscript/index-dot-access/no-trailing-int-illegal/options.json b/test/fixtures/lightscript/index-dot-access/no-trailing-int-illegal/options.json new file mode 100644 index 0000000000..4e266b8b73 --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/no-trailing-int-illegal/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Numbers with a decimal must end in a number (eg; `1.0`) in LightScript. (1:1)" +} diff --git a/test/fixtures/lightscript/index-dot-access/num-with-e/actual.js b/test/fixtures/lightscript/index-dot-access/num-with-e/actual.js new file mode 100644 index 0000000000..a174fab940 --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/num-with-e/actual.js @@ -0,0 +1 @@ +x.1e2 diff --git a/test/fixtures/lightscript/index-dot-access/num-with-e/expected.json b/test/fixtures/lightscript/index-dot-access/num-with-e/expected.json new file mode 100644 index 0000000000..c04f664f37 --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/num-with-e/expected.json @@ -0,0 +1,102 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "property": { + "type": "NumericLiteral", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 100, + "raw": "1e2" + }, + "value": 100 + }, + "computed": true + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/index-dot-access/num-with-o/actual.js b/test/fixtures/lightscript/index-dot-access/num-with-o/actual.js new file mode 100644 index 0000000000..10b5271db0 --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/num-with-o/actual.js @@ -0,0 +1 @@ +x.0o11 diff --git a/test/fixtures/lightscript/index-dot-access/num-with-o/expected.json b/test/fixtures/lightscript/index-dot-access/num-with-o/expected.json new file mode 100644 index 0000000000..7a85026469 --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/num-with-o/expected.json @@ -0,0 +1,102 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "property": { + "type": "NumericLiteral", + "start": 2, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o11" + }, + "value": 9 + }, + "computed": true + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/index-dot-access/two-digits/actual.js b/test/fixtures/lightscript/index-dot-access/two-digits/actual.js new file mode 100644 index 0000000000..97acb4217e --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/two-digits/actual.js @@ -0,0 +1 @@ +x.12 diff --git a/test/fixtures/lightscript/index-dot-access/two-digits/expected.json b/test/fixtures/lightscript/index-dot-access/two-digits/expected.json new file mode 100644 index 0000000000..baf05e645f --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/two-digits/expected.json @@ -0,0 +1,102 @@ +{ + "type": "File", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "property": { + "type": "NumericLiteral", + "start": 2, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 12, + "raw": "12" + }, + "value": 12 + }, + "computed": true + } + } + ], + "directives": [] + } +} diff --git a/test/fixtures/lightscript/index-dot-access/with-following-int-0/actual.js b/test/fixtures/lightscript/index-dot-access/with-following-int-0/actual.js new file mode 100644 index 0000000000..a9e5524d21 --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/with-following-int-0/actual.js @@ -0,0 +1 @@ +x.0.1 diff --git a/test/fixtures/lightscript/index-dot-access/with-following-int-0/expected.json b/test/fixtures/lightscript/index-dot-access/with-following-int-0/expected.json new file mode 100644 index 0000000000..e11f60f977 --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/with-following-int-0/expected.json @@ -0,0 +1,138 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "property": { + "type": "NumericLiteral", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + "computed": true + }, + "property": { + "type": "NumericLiteral", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "computed": true + } + } + ], + "directives": [] + } +} diff --git a/test/fixtures/lightscript/index-dot-access/with-following-int-1/actual.js b/test/fixtures/lightscript/index-dot-access/with-following-int-1/actual.js new file mode 100644 index 0000000000..04bd98703d --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/with-following-int-1/actual.js @@ -0,0 +1 @@ +x.1.1 diff --git a/test/fixtures/lightscript/index-dot-access/with-following-int-1/expected.json b/test/fixtures/lightscript/index-dot-access/with-following-int-1/expected.json new file mode 100644 index 0000000000..cd8d1db890 --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/with-following-int-1/expected.json @@ -0,0 +1,138 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "property": { + "type": "NumericLiteral", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "computed": true + }, + "property": { + "type": "NumericLiteral", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "computed": true + } + } + ], + "directives": [] + } +} diff --git a/test/fixtures/lightscript/index-dot-access/with-following-member-1/actual.js b/test/fixtures/lightscript/index-dot-access/with-following-member-1/actual.js new file mode 100644 index 0000000000..d14056540f --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/with-following-member-1/actual.js @@ -0,0 +1 @@ +x.1.y diff --git a/test/fixtures/lightscript/index-dot-access/with-following-member-1/expected.json b/test/fixtures/lightscript/index-dot-access/with-following-member-1/expected.json new file mode 100644 index 0000000000..6fc13d7784 --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/with-following-member-1/expected.json @@ -0,0 +1,135 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "property": { + "type": "NumericLiteral", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "computed": true + }, + "property": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + }, + "computed": false + } + } + ], + "directives": [] + } +} diff --git a/test/fixtures/lightscript/index-dot-access/with-following-member/actual.js b/test/fixtures/lightscript/index-dot-access/with-following-member/actual.js new file mode 100644 index 0000000000..08bf0c54d1 --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/with-following-member/actual.js @@ -0,0 +1 @@ +x.0.y diff --git a/test/fixtures/lightscript/index-dot-access/with-following-member/expected.json b/test/fixtures/lightscript/index-dot-access/with-following-member/expected.json new file mode 100644 index 0000000000..7526a51351 --- /dev/null +++ b/test/fixtures/lightscript/index-dot-access/with-following-member/expected.json @@ -0,0 +1,135 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "property": { + "type": "NumericLiteral", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + "computed": true + }, + "property": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + }, + "computed": false + } + } + ], + "directives": [] + } +} diff --git a/test/fixtures/lightscript/named-arrow-functions/default-object-params-parameterized/actual.js b/test/fixtures/lightscript/named-arrow-functions/default-object-params-parameterized/actual.js new file mode 100644 index 0000000000..5a4c35e88c --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/default-object-params-parameterized/actual.js @@ -0,0 +1 @@ +fn({ x = 1 }) -> x diff --git a/test/fixtures/lightscript/named-arrow-functions/default-object-params-parameterized/expected.json b/test/fixtures/lightscript/named-arrow-functions/default-object-params-parameterized/expected.json new file mode 100644 index 0000000000..e7dec1419e --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/default-object-params-parameterized/expected.json @@ -0,0 +1,230 @@ +{ + "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": "NamedArrowDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": true, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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": "x" + }, + "name": "x" + }, + "value": { + "type": "AssignmentPattern", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "left": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "NumericLiteral", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + "extra": { + "shorthand": true + } + } + ] + } + ], + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "T", + "variance": null + } + ] + }, + "skinny": true, + "body": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/default-object-params/actual.js b/test/fixtures/lightscript/named-arrow-functions/default-object-params/actual.js new file mode 100644 index 0000000000..f165af5e70 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/default-object-params/actual.js @@ -0,0 +1 @@ +fn({ x = 1 }, { y = 2 }) -> x + y diff --git a/test/fixtures/lightscript/named-arrow-functions/default-object-params/expected.json b/test/fixtures/lightscript/named-arrow-functions/default-object-params/expected.json new file mode 100644 index 0000000000..7caaab7c43 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/default-object-params/expected.json @@ -0,0 +1,336 @@ +{ + "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": "NamedArrowDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": true, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "x" + }, + "name": "x" + }, + "value": { + "type": "AssignmentPattern", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "left": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "NumericLiteral", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + "extra": { + "shorthand": true + } + } + ] + }, + { + "type": "ObjectPattern", + "start": 14, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "y" + }, + "name": "y" + }, + "value": { + "type": "AssignmentPattern", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "left": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "y" + }, + "name": "y" + }, + "right": { + "type": "NumericLiteral", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + }, + "extra": { + "shorthand": true + } + } + ] + } + ], + "skinny": true, + "body": { + "type": "BinaryExpression", + "start": 28, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "left": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 33 + }, + "identifierName": "y" + }, + "name": "y" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/default-params/actual.js b/test/fixtures/lightscript/named-arrow-functions/default-params/actual.js new file mode 100644 index 0000000000..b4c9f46431 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/default-params/actual.js @@ -0,0 +1 @@ +fn(x = 1) -> x diff --git a/test/fixtures/lightscript/named-arrow-functions/default-params/expected.json b/test/fixtures/lightscript/named-arrow-functions/default-params/expected.json new file mode 100644 index 0000000000..a751e9233f --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/default-params/expected.json @@ -0,0 +1,141 @@ +{ + "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": "NamedArrowDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": true, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 3, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "left": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "skinny": true, + "body": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/destructured-first-child-assign/actual.js b/test/fixtures/lightscript/named-arrow-functions/destructured-first-child-assign/actual.js new file mode 100644 index 0000000000..0059a365fb --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/destructured-first-child-assign/actual.js @@ -0,0 +1,2 @@ +fn() -> + {x, y} = {} 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 new file mode 100644 index 0000000000..dc55180c5d --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/destructured-first-child-assign/expected.json @@ -0,0 +1,268 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 5, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 10, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 10, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "id": { + "type": "ObjectPattern", + "start": 10, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + "value": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "y" + }, + "name": "y" + }, + "value": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "y" + }, + "name": "y" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": { + "type": "ObjectExpression", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "properties": [] + } + } + ] + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/destructured-first-child-colon-const/actual.js b/test/fixtures/lightscript/named-arrow-functions/destructured-first-child-colon-const/actual.js new file mode 100644 index 0000000000..0059a365fb --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/destructured-first-child-colon-const/actual.js @@ -0,0 +1,2 @@ +fn() -> + {x, y} = {} 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 new file mode 100644 index 0000000000..dc55180c5d --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/destructured-first-child-colon-const/expected.json @@ -0,0 +1,268 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 5, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 10, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 10, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "id": { + "type": "ObjectPattern", + "start": 10, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + "value": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "y" + }, + "name": "y" + }, + "value": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "y" + }, + "name": "y" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": { + "type": "ObjectExpression", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "properties": [] + } + } + ] + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/export-basic/actual.js b/test/fixtures/lightscript/named-arrow-functions/export-basic/actual.js new file mode 100644 index 0000000000..990fa71cd2 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/export-basic/actual.js @@ -0,0 +1 @@ +export fn() -> x diff --git a/test/fixtures/lightscript/named-arrow-functions/export-basic/expected.json b/test/fixtures/lightscript/named-arrow-functions/export-basic/expected.json new file mode 100644 index 0000000000..9c3e888982 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/export-basic/expected.json @@ -0,0 +1,106 @@ +{ + "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": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "NamedArrowDeclaration", + "start": 7, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": true, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "exportKind": "value" + } + ], + "directives": [] + } +} diff --git a/test/fixtures/lightscript/named-arrow-functions/export-basic/options.json b/test/fixtures/lightscript/named-arrow-functions/export-basic/options.json new file mode 100644 index 0000000000..2104ca4328 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/export-basic/options.json @@ -0,0 +1,3 @@ +{ + "sourceType": "module" +} diff --git a/test/fixtures/lightscript/named-arrow-functions/export-typed/actual.js b/test/fixtures/lightscript/named-arrow-functions/export-typed/actual.js new file mode 100644 index 0000000000..389360653e --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/export-typed/actual.js @@ -0,0 +1 @@ +export fn(x: T): T -> x diff --git a/test/fixtures/lightscript/named-arrow-functions/export-typed/expected.json b/test/fixtures/lightscript/named-arrow-functions/export-typed/expected.json new file mode 100644 index 0000000000..851754ed82 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/export-typed/expected.json @@ -0,0 +1,302 @@ +{ + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "NamedArrowDeclaration", + "start": 7, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "T", + "variance": null, + "bound": { + "type": "TypeAnnotation", + "start": 11, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "TT" + }, + "name": "TT" + } + } + } + } + ] + }, + "id": { + "type": "Identifier", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": true, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 17, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "x" + }, + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "T" + }, + "name": "T" + } + } + } + } + ], + "returnType": { + "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" + } + } + }, + "skinny": true, + "body": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "exportKind": "value" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/export-typed/options.json b/test/fixtures/lightscript/named-arrow-functions/export-typed/options.json new file mode 100644 index 0000000000..2104ca4328 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/export-typed/options.json @@ -0,0 +1,3 @@ +{ + "sourceType": "module" +} diff --git a/test/fixtures/lightscript/named-arrow-functions/expression-fat/actual.js b/test/fixtures/lightscript/named-arrow-functions/expression-fat/actual.js new file mode 100644 index 0000000000..63df5eb9ef --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/expression-fat/actual.js @@ -0,0 +1 @@ +foo(fn() => x) diff --git a/test/fixtures/lightscript/named-arrow-functions/expression-fat/expected.json b/test/fixtures/lightscript/named-arrow-functions/expression-fat/expected.json new file mode 100644 index 0000000000..dbb64bbfb7 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/expression-fat/expected.json @@ -0,0 +1,137 @@ +{ + "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": "CallExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "arguments": [ + { + "type": "NamedArrowExpression", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": true, + "async": false, + "params": [], + "skinny": false, + "body": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/expression-skinny/actual.js b/test/fixtures/lightscript/named-arrow-functions/expression-skinny/actual.js new file mode 100644 index 0000000000..5083c0eadd --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/expression-skinny/actual.js @@ -0,0 +1 @@ +foo(fn() -> x) diff --git a/test/fixtures/lightscript/named-arrow-functions/expression-skinny/expected.json b/test/fixtures/lightscript/named-arrow-functions/expression-skinny/expected.json new file mode 100644 index 0000000000..3cd290a67f --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/expression-skinny/expected.json @@ -0,0 +1,137 @@ +{ + "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": "CallExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "arguments": [ + { + "type": "NamedArrowExpression", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": true, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/fat-async-generators/actual.js b/test/fixtures/lightscript/named-arrow-functions/fat-async-generators/actual.js new file mode 100644 index 0000000000..354ed0a5dc --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/fat-async-generators/actual.js @@ -0,0 +1,2 @@ +fn() =*/> + yield await x diff --git a/test/fixtures/lightscript/named-arrow-functions/fat-async-generators/expected.json b/test/fixtures/lightscript/named-arrow-functions/fat-async-generators/expected.json new file mode 100644 index 0000000000..9dd98eb150 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/fat-async-generators/expected.json @@ -0,0 +1,154 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": true, + "expression": false, + "async": true, + "params": [], + "skinny": false, + "body": { + "type": "BlockStatement", + "start": 5, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 12, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "expression": { + "type": "YieldExpression", + "start": 12, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "argument": { + "type": "AwaitExpression", + "start": 18, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "argument": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + } + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} diff --git a/test/fixtures/lightscript/named-arrow-functions/fat-async-generators/options.json b/test/fixtures/lightscript/named-arrow-functions/fat-async-generators/options.json new file mode 100644 index 0000000000..a2159d522d --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/fat-async-generators/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["lightscript", "jsx", "flow", "asyncGenerators"] +} diff --git a/test/fixtures/lightscript/named-arrow-functions/fat-async/actual.js b/test/fixtures/lightscript/named-arrow-functions/fat-async/actual.js new file mode 100644 index 0000000000..4ffd3655e6 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/fat-async/actual.js @@ -0,0 +1,2 @@ +fn() =/> + await x diff --git a/test/fixtures/lightscript/named-arrow-functions/fat-async/expected.json b/test/fixtures/lightscript/named-arrow-functions/fat-async/expected.json new file mode 100644 index 0000000000..ee8d1e3485 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/fat-async/expected.json @@ -0,0 +1,139 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": false, + "async": true, + "params": [], + "skinny": false, + "body": { + "type": "BlockStatement", + "start": 5, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 11, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "expression": { + "type": "AwaitExpression", + "start": 11, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "argument": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "x" + }, + "name": "x" + } + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} diff --git a/test/fixtures/lightscript/named-arrow-functions/fat-oneline/actual.js b/test/fixtures/lightscript/named-arrow-functions/fat-oneline/actual.js new file mode 100644 index 0000000000..21a5692978 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/fat-oneline/actual.js @@ -0,0 +1 @@ +fn() => x diff --git a/test/fixtures/lightscript/named-arrow-functions/fat-oneline/expected.json b/test/fixtures/lightscript/named-arrow-functions/fat-oneline/expected.json new file mode 100644 index 0000000000..ae90ff42cb --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/fat-oneline/expected.json @@ -0,0 +1,88 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": true, + "async": false, + "params": [], + "skinny": false, + "body": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/fat-white/actual.js b/test/fixtures/lightscript/named-arrow-functions/fat-white/actual.js new file mode 100644 index 0000000000..3e3b2317d1 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/fat-white/actual.js @@ -0,0 +1,2 @@ +fn() => + x diff --git a/test/fixtures/lightscript/named-arrow-functions/fat-white/expected.json b/test/fixtures/lightscript/named-arrow-functions/fat-white/expected.json new file mode 100644 index 0000000000..afea4957b4 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/fat-white/expected.json @@ -0,0 +1,124 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": false, + "body": { + "type": "BlockStatement", + "start": 5, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "expression": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/first-line-string/actual.js b/test/fixtures/lightscript/named-arrow-functions/first-line-string/actual.js new file mode 100644 index 0000000000..925718d2f4 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/first-line-string/actual.js @@ -0,0 +1,2 @@ +fn() -> + "hello world" diff --git a/test/fixtures/lightscript/named-arrow-functions/first-line-string/expected.json b/test/fixtures/lightscript/named-arrow-functions/first-line-string/expected.json new file mode 100644 index 0000000000..412b94d1cb --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/first-line-string/expected.json @@ -0,0 +1,127 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 5, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 10, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "expression": { + "type": "StringLiteral", + "start": 10, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "extra": { + "rawValue": "hello world", + "raw": "\"hello world\"" + }, + "value": "hello world" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/if-call-colon-arrow-fn-no-paren-unfortunate/actual.js b/test/fixtures/lightscript/named-arrow-functions/if-call-colon-arrow-fn-no-paren-unfortunate/actual.js new file mode 100644 index 0000000000..7691465583 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/if-call-colon-arrow-fn-no-paren-unfortunate/actual.js @@ -0,0 +1 @@ +x = if fn(): xx => 4 diff --git a/test/fixtures/lightscript/named-arrow-functions/if-call-colon-arrow-fn-no-paren-unfortunate/options.json b/test/fixtures/lightscript/named-arrow-functions/if-call-colon-arrow-fn-no-paren-unfortunate/options.json new file mode 100644 index 0000000000..63f9c8a548 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/if-call-colon-arrow-fn-no-paren-unfortunate/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Paren-free test expressions must be followed by braces or a colon. (1:20)" +} diff --git a/test/fixtures/lightscript/named-arrow-functions/if-call-colon-arrow-fn/actual.js b/test/fixtures/lightscript/named-arrow-functions/if-call-colon-arrow-fn/actual.js new file mode 100644 index 0000000000..19c671eb9e --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/if-call-colon-arrow-fn/actual.js @@ -0,0 +1 @@ +x = if fn(): () => 4 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 new file mode 100644 index 0000000000..1f9c8a7fd4 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/if-call-colon-arrow-fn/expected.json @@ -0,0 +1,174 @@ +{ + "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 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "IfExpression", + "start": 4, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "test": { + "type": "CallExpression", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "callee": { + "type": "Identifier", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "arguments": [] + }, + "consequent": { + "type": "ArrowFunctionExpression", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [], + "skinny": false, + "body": { + "type": "NumericLiteral", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": 4, + "raw": "4" + }, + "value": 4 + } + }, + "alternate": null + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/if-call-colon-named-arrow-fn/actual.js b/test/fixtures/lightscript/named-arrow-functions/if-call-colon-named-arrow-fn/actual.js new file mode 100644 index 0000000000..511ae60f5d --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/if-call-colon-named-arrow-fn/actual.js @@ -0,0 +1 @@ +x = if fn(): y() => 4 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 new file mode 100644 index 0000000000..45ed80a216 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/if-call-colon-named-arrow-fn/expected.json @@ -0,0 +1,190 @@ +{ + "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": "VariableDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "IfExpression", + "start": 4, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "test": { + "type": "CallExpression", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "callee": { + "type": "Identifier", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "arguments": [] + }, + "consequent": { + "type": "NamedArrowExpression", + "start": 13, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "y" + }, + "name": "y" + }, + "generator": false, + "expression": true, + "async": false, + "params": [], + "skinny": false, + "body": { + "type": "NumericLiteral", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "extra": { + "rawValue": 4, + "raw": "4" + }, + "value": 4 + } + }, + "alternate": null + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/if-call-colon/actual.js b/test/fixtures/lightscript/named-arrow-functions/if-call-colon/actual.js new file mode 100644 index 0000000000..00ba58ec25 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/if-call-colon/actual.js @@ -0,0 +1 @@ +if fn(): x diff --git a/test/fixtures/lightscript/named-arrow-functions/if-call-colon/expected.json b/test/fixtures/lightscript/named-arrow-functions/if-call-colon/expected.json new file mode 100644 index 0000000000..ec122c661e --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/if-call-colon/expected.json @@ -0,0 +1,115 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "test": { + "type": "CallExpression", + "start": 3, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "callee": { + "type": "Identifier", + "start": 3, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "arguments": [] + }, + "consequent": { + "type": "ExpressionStatement", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "alternate": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/invalid-duplicated-params/actual.js b/test/fixtures/lightscript/named-arrow-functions/invalid-duplicated-params/actual.js new file mode 100644 index 0000000000..a8535f1c42 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/invalid-duplicated-params/actual.js @@ -0,0 +1 @@ +fn(x, x) => x diff --git a/test/fixtures/lightscript/named-arrow-functions/invalid-duplicated-params/options.json b/test/fixtures/lightscript/named-arrow-functions/invalid-duplicated-params/options.json new file mode 100644 index 0000000000..1dec90e652 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/invalid-duplicated-params/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Argument name clash in strict mode (1:6)" +} diff --git a/test/fixtures/lightscript/named-arrow-functions/invalid-parens-params-parameterized/actual.js b/test/fixtures/lightscript/named-arrow-functions/invalid-parens-params-parameterized/actual.js new file mode 100644 index 0000000000..690dc6af17 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/invalid-parens-params-parameterized/actual.js @@ -0,0 +1 @@ +fn(x, (y)) => x diff --git a/test/fixtures/lightscript/named-arrow-functions/invalid-parens-params-parameterized/options.json b/test/fixtures/lightscript/named-arrow-functions/invalid-parens-params-parameterized/options.json new file mode 100644 index 0000000000..d50e8469b8 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/invalid-parens-params-parameterized/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:14)" +} diff --git a/test/fixtures/lightscript/named-arrow-functions/invalid-parens-params/actual.js b/test/fixtures/lightscript/named-arrow-functions/invalid-parens-params/actual.js new file mode 100644 index 0000000000..cbc4188e88 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/invalid-parens-params/actual.js @@ -0,0 +1 @@ +fn(x, (y)) => x diff --git a/test/fixtures/lightscript/named-arrow-functions/invalid-parens-params/options.json b/test/fixtures/lightscript/named-arrow-functions/invalid-parens-params/options.json new file mode 100644 index 0000000000..cb6c66081e --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/invalid-parens-params/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:11)" +} diff --git a/test/fixtures/lightscript/named-arrow-functions/malformed-old-async-double/actual.js b/test/fixtures/lightscript/named-arrow-functions/malformed-old-async-double/actual.js new file mode 100644 index 0000000000..2c03ef909c --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/malformed-old-async-double/actual.js @@ -0,0 +1 @@ +async fn() -/> 1 diff --git a/test/fixtures/lightscript/named-arrow-functions/malformed-old-async-double/options.json b/test/fixtures/lightscript/named-arrow-functions/malformed-old-async-double/options.json new file mode 100644 index 0000000000..cd43c5c712 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/malformed-old-async-double/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected => (1:8)" +} diff --git a/test/fixtures/lightscript/named-arrow-functions/malformed-old-async-fat/actual.js b/test/fixtures/lightscript/named-arrow-functions/malformed-old-async-fat/actual.js new file mode 100644 index 0000000000..6ce2981669 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/malformed-old-async-fat/actual.js @@ -0,0 +1 @@ +async fn() => 1 diff --git a/test/fixtures/lightscript/named-arrow-functions/malformed-old-async-fat/options.json b/test/fixtures/lightscript/named-arrow-functions/malformed-old-async-fat/options.json new file mode 100644 index 0000000000..cd43c5c712 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/malformed-old-async-fat/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected => (1:8)" +} diff --git a/test/fixtures/lightscript/named-arrow-functions/malformed-old-async/actual.js b/test/fixtures/lightscript/named-arrow-functions/malformed-old-async/actual.js new file mode 100644 index 0000000000..dfcb4a2321 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/malformed-old-async/actual.js @@ -0,0 +1 @@ +async fn() -> 1 diff --git a/test/fixtures/lightscript/named-arrow-functions/malformed-old-async/options.json b/test/fixtures/lightscript/named-arrow-functions/malformed-old-async/options.json new file mode 100644 index 0000000000..cd43c5c712 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/malformed-old-async/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected => (1:8)" +} diff --git a/test/fixtures/lightscript/named-arrow-functions/member-basic/actual.js b/test/fixtures/lightscript/named-arrow-functions/member-basic/actual.js new file mode 100644 index 0000000000..f8ba48e4fb --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/member-basic/actual.js @@ -0,0 +1 @@ +o.f() -> x diff --git a/test/fixtures/lightscript/named-arrow-functions/member-basic/expected.json b/test/fixtures/lightscript/named-arrow-functions/member-basic/expected.json new file mode 100644 index 0000000000..75ad754d86 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/member-basic/expected.json @@ -0,0 +1,120 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "NamedArrowMemberExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "expression": true, + "async": false, + "params": [], + "object": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "o" + }, + "name": "o" + }, + "skinny": true, + "body": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/member-computed-todo/actual.js b/test/fixtures/lightscript/named-arrow-functions/member-computed-todo/actual.js new file mode 100644 index 0000000000..766dd4c96c --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/member-computed-todo/actual.js @@ -0,0 +1 @@ +o['f']() -> x diff --git a/test/fixtures/lightscript/named-arrow-functions/member-computed-todo/options.json b/test/fixtures/lightscript/named-arrow-functions/member-computed-todo/options.json new file mode 100644 index 0000000000..7773284276 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/member-computed-todo/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Binding invalid left-hand side in function name (1:2)" +} diff --git a/test/fixtures/lightscript/named-arrow-functions/return-obj-firstline/actual.js b/test/fixtures/lightscript/named-arrow-functions/return-obj-firstline/actual.js new file mode 100644 index 0000000000..e6830a4bb5 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/return-obj-firstline/actual.js @@ -0,0 +1,2 @@ +fn(x, y) -> + {x, y} diff --git a/test/fixtures/lightscript/named-arrow-functions/return-obj-firstline/expected.json b/test/fixtures/lightscript/named-arrow-functions/return-obj-firstline/expected.json new file mode 100644 index 0000000000..f7088aeb6f --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/return-obj-firstline/expected.json @@ -0,0 +1,269 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "y" + }, + "name": "y" + } + ], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 9, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + "value": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "y" + }, + "name": "y" + }, + "value": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "y" + }, + "name": "y" + }, + "extra": { + "shorthand": true + } + } + ] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/skinny-async-generators/actual.js b/test/fixtures/lightscript/named-arrow-functions/skinny-async-generators/actual.js new file mode 100644 index 0000000000..b5fdc7d568 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/skinny-async-generators/actual.js @@ -0,0 +1,2 @@ +fn() -*/> + yield await x diff --git a/test/fixtures/lightscript/named-arrow-functions/skinny-async-generators/expected.json b/test/fixtures/lightscript/named-arrow-functions/skinny-async-generators/expected.json new file mode 100644 index 0000000000..9460cc5f4c --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/skinny-async-generators/expected.json @@ -0,0 +1,154 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": true, + "expression": false, + "async": true, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 5, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 12, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "expression": { + "type": "YieldExpression", + "start": 12, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "argument": { + "type": "AwaitExpression", + "start": 18, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "argument": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + } + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} diff --git a/test/fixtures/lightscript/named-arrow-functions/skinny-async-generators/options.json b/test/fixtures/lightscript/named-arrow-functions/skinny-async-generators/options.json new file mode 100644 index 0000000000..a2159d522d --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/skinny-async-generators/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["lightscript", "jsx", "flow", "asyncGenerators"] +} diff --git a/test/fixtures/lightscript/named-arrow-functions/skinny-async/actual.js b/test/fixtures/lightscript/named-arrow-functions/skinny-async/actual.js new file mode 100644 index 0000000000..4a52bf38e7 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/skinny-async/actual.js @@ -0,0 +1,2 @@ +fn() -/> + await x diff --git a/test/fixtures/lightscript/named-arrow-functions/skinny-async/expected.json b/test/fixtures/lightscript/named-arrow-functions/skinny-async/expected.json new file mode 100644 index 0000000000..2a4c6aff01 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/skinny-async/expected.json @@ -0,0 +1,139 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": false, + "async": true, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 5, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 11, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "expression": { + "type": "AwaitExpression", + "start": 11, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "argument": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "x" + }, + "name": "x" + } + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/skinny-curly/actual.js b/test/fixtures/lightscript/named-arrow-functions/skinny-curly/actual.js new file mode 100644 index 0000000000..9e4537c7c7 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/skinny-curly/actual.js @@ -0,0 +1 @@ +fn() -> {} diff --git a/test/fixtures/lightscript/named-arrow-functions/skinny-curly/expected.json b/test/fixtures/lightscript/named-arrow-functions/skinny-curly/expected.json new file mode 100644 index 0000000000..84fe23bc04 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/skinny-curly/expected.json @@ -0,0 +1,91 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/skinny-generator/actual.js b/test/fixtures/lightscript/named-arrow-functions/skinny-generator/actual.js new file mode 100644 index 0000000000..478859f1d0 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/skinny-generator/actual.js @@ -0,0 +1,2 @@ +fn() -*> + yield x diff --git a/test/fixtures/lightscript/named-arrow-functions/skinny-generator/expected.json b/test/fixtures/lightscript/named-arrow-functions/skinny-generator/expected.json new file mode 100644 index 0000000000..285c87a844 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/skinny-generator/expected.json @@ -0,0 +1,140 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": true, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 5, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 11, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "expression": { + "type": "YieldExpression", + "start": 11, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "delegate": false, + "argument": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "x" + }, + "name": "x" + } + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/skinny-oneline-stmt/actual.js b/test/fixtures/lightscript/named-arrow-functions/skinny-oneline-stmt/actual.js new file mode 100644 index 0000000000..482c28f8e4 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/skinny-oneline-stmt/actual.js @@ -0,0 +1 @@ +f() -> for key k in o: k diff --git a/test/fixtures/lightscript/named-arrow-functions/skinny-oneline-stmt/expected.json b/test/fixtures/lightscript/named-arrow-functions/skinny-oneline-stmt/expected.json new file mode 100644 index 0000000000..66e2afa80b --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/skinny-oneline-stmt/expected.json @@ -0,0 +1,173 @@ +{ + "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": "NamedArrowDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 4, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": [ + { + "type": "ForInObjectStatement", + "start": 7, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "key": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "k" + }, + "name": "k" + }, + "body": { + "type": "ExpressionStatement", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "k" + }, + "name": "k" + } + }, + "object": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "o" + }, + "name": "o" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/skinny-oneline/actual.js b/test/fixtures/lightscript/named-arrow-functions/skinny-oneline/actual.js new file mode 100644 index 0000000000..80d34c6205 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/skinny-oneline/actual.js @@ -0,0 +1 @@ +fn() -> x diff --git a/test/fixtures/lightscript/named-arrow-functions/skinny-oneline/expected.json b/test/fixtures/lightscript/named-arrow-functions/skinny-oneline/expected.json new file mode 100644 index 0000000000..afeb9477e3 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/skinny-oneline/expected.json @@ -0,0 +1,88 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": true, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/skinny-params/actual.js b/test/fixtures/lightscript/named-arrow-functions/skinny-params/actual.js new file mode 100644 index 0000000000..0156fbae1c --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/skinny-params/actual.js @@ -0,0 +1,2 @@ +fn(x, y = 1) -> + x diff --git a/test/fixtures/lightscript/named-arrow-functions/skinny-params/expected.json b/test/fixtures/lightscript/named-arrow-functions/skinny-params/expected.json new file mode 100644 index 0000000000..2f28ba86d8 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/skinny-params/expected.json @@ -0,0 +1,194 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + { + "type": "AssignmentPattern", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "y" + }, + "name": "y" + }, + "right": { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 13, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "expression": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/skinny-white-malformed-dedent/actual.js b/test/fixtures/lightscript/named-arrow-functions/skinny-white-malformed-dedent/actual.js new file mode 100644 index 0000000000..fc276a23cf --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/skinny-white-malformed-dedent/actual.js @@ -0,0 +1,2 @@ +fn() -> +x diff --git a/test/fixtures/lightscript/named-arrow-functions/skinny-white-malformed-dedent/options.json b/test/fixtures/lightscript/named-arrow-functions/skinny-white-malformed-dedent/options.json new file mode 100644 index 0000000000..f568ef6fed --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/skinny-white-malformed-dedent/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Expected an Indent or Statement (1:5)" +} diff --git a/test/fixtures/lightscript/named-arrow-functions/skinny-white/actual.js b/test/fixtures/lightscript/named-arrow-functions/skinny-white/actual.js new file mode 100644 index 0000000000..cf4b5e21e9 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/skinny-white/actual.js @@ -0,0 +1,2 @@ +fn() -> + x diff --git a/test/fixtures/lightscript/named-arrow-functions/skinny-white/expected.json b/test/fixtures/lightscript/named-arrow-functions/skinny-white/expected.json new file mode 100644 index 0000000000..b6b78aafa3 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/skinny-white/expected.json @@ -0,0 +1,124 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 5, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "expression": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/typed-default-params/actual.js b/test/fixtures/lightscript/named-arrow-functions/typed-default-params/actual.js new file mode 100644 index 0000000000..8420b2d2b8 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/typed-default-params/actual.js @@ -0,0 +1 @@ +fn(x: T = 1) -> x 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 new file mode 100644 index 0000000000..c2eb1d2f15 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/typed-default-params/expected.json @@ -0,0 +1,189 @@ +{ + "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": "NamedArrowDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": true, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 3, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "Identifier", + "start": 3, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "x" + }, + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "T" + }, + "name": "T" + } + } + } + }, + "right": { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "skinny": true, + "body": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/typed-function-param/actual.js b/test/fixtures/lightscript/named-arrow-functions/typed-function-param/actual.js new file mode 100644 index 0000000000..81c84d7de1 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/typed-function-param/actual.js @@ -0,0 +1 @@ +f(g: (a: number, b: number) => number) => 1 diff --git a/test/fixtures/lightscript/named-arrow-functions/typed-function-param/expected.json b/test/fixtures/lightscript/named-arrow-functions/typed-function-param/expected.json new file mode 100644 index 0000000000..ca6a0f4b8e --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/typed-function-param/expected.json @@ -0,0 +1,254 @@ +{ + "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": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "expression": true, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 2, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 37 + }, + "identifierName": "g" + }, + "name": "g", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 3, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 5, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "params": [ + { + "type": "FunctionTypeParam", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "a" + }, + "name": "a" + }, + "optional": false, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + } + } + }, + { + "type": "FunctionTypeParam", + "start": 17, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "name": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "b" + }, + "name": "b" + }, + "optional": false, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 26 + } + } + } + } + ], + "rest": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 31, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 37 + } + } + }, + "typeParameters": null + } + } + } + ], + "skinny": false, + "body": { + "type": "NumericLiteral", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/typed-parameterized-function-param/actual.js b/test/fixtures/lightscript/named-arrow-functions/typed-parameterized-function-param/actual.js new file mode 100644 index 0000000000..66fb185643 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/typed-parameterized-function-param/actual.js @@ -0,0 +1 @@ +findMax(arr: T[], compare: (a: T, b: T) => number) -> arr diff --git a/test/fixtures/lightscript/named-arrow-functions/typed-parameterized-function-param/expected.json b/test/fixtures/lightscript/named-arrow-functions/typed-parameterized-function-param/expected.json new file mode 100644 index 0000000000..b2901c5705 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/typed-parameterized-function-param/expected.json @@ -0,0 +1,401 @@ +{ + "type": "File", + "start": 0, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 60 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 60 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 60 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "findMax" + }, + "name": "findMax" + }, + "generator": false, + "expression": true, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "arr" + }, + "name": "arr", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "typeAnnotation": { + "type": "ArrayTypeAnnotation", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "elementType": { + "type": "GenericTypeAnnotation", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "T" + }, + "name": "T" + } + } + } + } + }, + { + "type": "Identifier", + "start": 21, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 52 + }, + "identifierName": "compare" + }, + "name": "compare", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 28, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 30, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "params": [ + { + "type": "FunctionTypeParam", + "start": 31, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "name": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 32 + }, + "identifierName": "a" + }, + "name": "a" + }, + "optional": false, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + }, + "identifierName": "T" + }, + "name": "T" + } + } + }, + { + "type": "FunctionTypeParam", + "start": 37, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "name": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 38 + }, + "identifierName": "b" + }, + "name": "b" + }, + "optional": false, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + }, + "identifierName": "T" + }, + "name": "T" + } + } + } + ], + "rest": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 46, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 52 + } + } + }, + "typeParameters": null + } + } + } + ], + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "T", + "variance": null + } + ] + }, + "skinny": true, + "body": { + "type": "Identifier", + "start": 57, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 57 + }, + "end": { + "line": 1, + "column": 60 + }, + "identifierName": "arr" + }, + "name": "arr" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/typed-parameterized/actual.js b/test/fixtures/lightscript/named-arrow-functions/typed-parameterized/actual.js new file mode 100644 index 0000000000..935c6161ac --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/typed-parameterized/actual.js @@ -0,0 +1 @@ +fn(x: T): T -> x diff --git a/test/fixtures/lightscript/named-arrow-functions/typed-parameterized/expected.json b/test/fixtures/lightscript/named-arrow-functions/typed-parameterized/expected.json new file mode 100644 index 0000000000..b615d029df --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/typed-parameterized/expected.json @@ -0,0 +1,236 @@ +{ + "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": "NamedArrowDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": true, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "T" + }, + "name": "T" + } + } + } + } + ], + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "T", + "variance": null + } + ] + }, + "returnType": { + "type": "TypeAnnotation", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "T" + }, + "name": "T" + } + } + }, + "skinny": true, + "body": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/typed-params/actual.js b/test/fixtures/lightscript/named-arrow-functions/typed-params/actual.js new file mode 100644 index 0000000000..d35ef2957b --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/typed-params/actual.js @@ -0,0 +1 @@ +fn(x: T) -> x diff --git a/test/fixtures/lightscript/named-arrow-functions/typed-params/expected.json b/test/fixtures/lightscript/named-arrow-functions/typed-params/expected.json new file mode 100644 index 0000000000..59114d7ec9 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/typed-params/expected.json @@ -0,0 +1,154 @@ +{ + "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": "NamedArrowDeclaration", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": true, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 3, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "x" + }, + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "T" + }, + "name": "T" + } + } + } + } + ], + "skinny": true, + "body": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/named-arrow-functions/typed-return/actual.js b/test/fixtures/lightscript/named-arrow-functions/typed-return/actual.js new file mode 100644 index 0000000000..9383ea4ecf --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/typed-return/actual.js @@ -0,0 +1 @@ +fn(): number -> 1 diff --git a/test/fixtures/lightscript/named-arrow-functions/typed-return/expected.json b/test/fixtures/lightscript/named-arrow-functions/typed-return/expected.json new file mode 100644 index 0000000000..204f116e73 --- /dev/null +++ b/test/fixtures/lightscript/named-arrow-functions/typed-return/expected.json @@ -0,0 +1,121 @@ +{ + "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": "NamedArrowDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "expression": true, + "async": false, + "params": [], + "returnType": { + "type": "TypeAnnotation", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + } + } + }, + "skinny": true, + "body": { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/now-reassignment/await-arrow/actual.js b/test/fixtures/lightscript/now-reassignment/await-arrow/actual.js new file mode 100644 index 0000000000..51e32e9d0b --- /dev/null +++ b/test/fixtures/lightscript/now-reassignment/await-arrow/actual.js @@ -0,0 +1,2 @@ +f() -/> + now x <- fetch() diff --git a/test/fixtures/lightscript/now-reassignment/await-arrow/expected.json b/test/fixtures/lightscript/now-reassignment/await-arrow/expected.json new file mode 100644 index 0000000000..9464510d84 --- /dev/null +++ b/test/fixtures/lightscript/now-reassignment/await-arrow/expected.json @@ -0,0 +1,189 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "NamedArrowDeclaration", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "expression": false, + "async": true, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 4, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 10, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 10, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "operator": "<-", + "left": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "AwaitExpression", + "start": 16, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "argument": { + "type": "CallExpression", + "start": 19, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "callee": { + "type": "Identifier", + "start": 19, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 16 + }, + "identifierName": "fetch" + }, + "name": "fetch" + }, + "arguments": [] + } + }, + "isNowAssign": true + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/now-reassignment/basic/actual.js b/test/fixtures/lightscript/now-reassignment/basic/actual.js new file mode 100644 index 0000000000..cd62d008cf --- /dev/null +++ b/test/fixtures/lightscript/now-reassignment/basic/actual.js @@ -0,0 +1,2 @@ +let x = 3 +now x = 4 diff --git a/test/fixtures/lightscript/now-reassignment/basic/expected.json b/test/fixtures/lightscript/now-reassignment/basic/expected.json new file mode 100644 index 0000000000..81f0dbf90f --- /dev/null +++ b/test/fixtures/lightscript/now-reassignment/basic/expected.json @@ -0,0 +1,173 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "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": "x" + }, + "name": "x" + }, + "init": { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + } + } + ], + "kind": "let" + }, + { + "type": "ExpressionStatement", + "start": 10, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 10, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "NumericLiteral", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "extra": { + "rawValue": 4, + "raw": "4" + }, + "value": 4 + }, + "isNowAssign": true + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/now-reassignment/in-expression/actual.js b/test/fixtures/lightscript/now-reassignment/in-expression/actual.js new file mode 100644 index 0000000000..fb27657d4f --- /dev/null +++ b/test/fixtures/lightscript/now-reassignment/in-expression/actual.js @@ -0,0 +1,2 @@ +let x = 3 +if (now x = 4) {} diff --git a/test/fixtures/lightscript/now-reassignment/in-expression/expected.json b/test/fixtures/lightscript/now-reassignment/in-expression/expected.json new file mode 100644 index 0000000000..6399e89e7e --- /dev/null +++ b/test/fixtures/lightscript/now-reassignment/in-expression/expected.json @@ -0,0 +1,194 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "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": "x" + }, + "name": "x" + }, + "init": { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + } + } + ], + "kind": "let" + }, + { + "type": "IfStatement", + "start": 10, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "test": { + "type": "AssignmentExpression", + "start": 14, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "NumericLiteral", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "extra": { + "rawValue": 4, + "raw": "4" + }, + "value": 4 + }, + "isNowAssign": true + }, + "consequent": { + "type": "BlockStatement", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "alternate": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/now-reassignment/invalid-no-assign/actual.js b/test/fixtures/lightscript/now-reassignment/invalid-no-assign/actual.js new file mode 100644 index 0000000000..2c3cad18e1 --- /dev/null +++ b/test/fixtures/lightscript/now-reassignment/invalid-no-assign/actual.js @@ -0,0 +1 @@ +now x() diff --git a/test/fixtures/lightscript/now-reassignment/invalid-no-assign/options.json b/test/fixtures/lightscript/now-reassignment/invalid-no-assign/options.json new file mode 100644 index 0000000000..13535c93da --- /dev/null +++ b/test/fixtures/lightscript/now-reassignment/invalid-no-assign/options.json @@ -0,0 +1,3 @@ +{ + "throws": "`now` can only be used with assignments and updates. (1:4)" +} diff --git a/test/fixtures/lightscript/now-reassignment/member-no-now/actual.js b/test/fixtures/lightscript/now-reassignment/member-no-now/actual.js new file mode 100644 index 0000000000..8484129051 --- /dev/null +++ b/test/fixtures/lightscript/now-reassignment/member-no-now/actual.js @@ -0,0 +1 @@ +x.y = 8 diff --git a/test/fixtures/lightscript/now-reassignment/member-no-now/expected.json b/test/fixtures/lightscript/now-reassignment/member-no-now/expected.json new file mode 100644 index 0000000000..19b8d91fea --- /dev/null +++ b/test/fixtures/lightscript/now-reassignment/member-no-now/expected.json @@ -0,0 +1,136 @@ +{ + "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": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "=", + "left": { + "type": "MemberExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "property": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "y" + }, + "name": "y" + }, + "computed": false + }, + "right": { + "type": "NumericLiteral", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 8, + "raw": "8" + }, + "value": 8 + }, + "isNowAssign": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/now-reassignment/multiple-assign/actual.js b/test/fixtures/lightscript/now-reassignment/multiple-assign/actual.js new file mode 100644 index 0000000000..cd80a4b29d --- /dev/null +++ b/test/fixtures/lightscript/now-reassignment/multiple-assign/actual.js @@ -0,0 +1,2 @@ +let y, x = 3 +now x = now y = 8 diff --git a/test/fixtures/lightscript/now-reassignment/multiple-assign/expected.json b/test/fixtures/lightscript/now-reassignment/multiple-assign/expected.json new file mode 100644 index 0000000000..81a88d1e9f --- /dev/null +++ b/test/fixtures/lightscript/now-reassignment/multiple-assign/expected.json @@ -0,0 +1,240 @@ +{ + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "start": 7, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "NumericLiteral", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + } + } + ], + "kind": "let" + }, + { + "type": "ExpressionStatement", + "start": 13, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 13, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "AssignmentExpression", + "start": 21, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + }, + "identifierName": "y" + }, + "name": "y" + }, + "right": { + "type": "NumericLiteral", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "extra": { + "rawValue": 8, + "raw": "8" + }, + "value": 8 + }, + "isNowAssign": true + }, + "isNowAssign": true + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/now-reassignment/now-member/actual.js b/test/fixtures/lightscript/now-reassignment/now-member/actual.js new file mode 100644 index 0000000000..ef1f99350c --- /dev/null +++ b/test/fixtures/lightscript/now-reassignment/now-member/actual.js @@ -0,0 +1 @@ +now x.y = 8 diff --git a/test/fixtures/lightscript/now-reassignment/now-member/expected.json b/test/fixtures/lightscript/now-reassignment/now-member/expected.json new file mode 100644 index 0000000000..89e9e20b34 --- /dev/null +++ b/test/fixtures/lightscript/now-reassignment/now-member/expected.json @@ -0,0 +1,136 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "operator": "=", + "left": { + "type": "MemberExpression", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "object": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "property": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "y" + }, + "name": "y" + }, + "computed": false + }, + "right": { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 8, + "raw": "8" + }, + "value": 8 + }, + "isNowAssign": true + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/now-reassignment/now-plus-eq/actual.js b/test/fixtures/lightscript/now-reassignment/now-plus-eq/actual.js new file mode 100644 index 0000000000..b0aeb23de0 --- /dev/null +++ b/test/fixtures/lightscript/now-reassignment/now-plus-eq/actual.js @@ -0,0 +1 @@ +now x += 8 diff --git a/test/fixtures/lightscript/now-reassignment/now-plus-eq/expected.json b/test/fixtures/lightscript/now-reassignment/now-plus-eq/expected.json new file mode 100644 index 0000000000..f754a3205d --- /dev/null +++ b/test/fixtures/lightscript/now-reassignment/now-plus-eq/expected.json @@ -0,0 +1,103 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "operator": "+=", + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "NumericLiteral", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 8, + "raw": "8" + }, + "value": 8 + }, + "isNowAssign": true + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/now-reassignment/plus-eq/actual.js b/test/fixtures/lightscript/now-reassignment/plus-eq/actual.js new file mode 100644 index 0000000000..47e52faccb --- /dev/null +++ b/test/fixtures/lightscript/now-reassignment/plus-eq/actual.js @@ -0,0 +1 @@ +x += 8 diff --git a/test/fixtures/lightscript/now-reassignment/plus-eq/expected.json b/test/fixtures/lightscript/now-reassignment/plus-eq/expected.json new file mode 100644 index 0000000000..ba6832f4d1 --- /dev/null +++ b/test/fixtures/lightscript/now-reassignment/plus-eq/expected.json @@ -0,0 +1,103 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "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": "NumericLiteral", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 8, + "raw": "8" + }, + "value": 8 + }, + "isNowAssign": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/now-reassignment/plus-plus/actual.js b/test/fixtures/lightscript/now-reassignment/plus-plus/actual.js new file mode 100644 index 0000000000..036c85a05c --- /dev/null +++ b/test/fixtures/lightscript/now-reassignment/plus-plus/actual.js @@ -0,0 +1 @@ +now x++ diff --git a/test/fixtures/lightscript/now-reassignment/plus-plus/expected.json b/test/fixtures/lightscript/now-reassignment/plus-plus/expected.json new file mode 100644 index 0000000000..c89ea1c12a --- /dev/null +++ b/test/fixtures/lightscript/now-reassignment/plus-plus/expected.json @@ -0,0 +1,84 @@ +{ + "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": "UpdateExpression", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "isNowAssign": true + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/operators/and/actual.js b/test/fixtures/lightscript/operators/and/actual.js new file mode 100644 index 0000000000..4311933f0a --- /dev/null +++ b/test/fixtures/lightscript/operators/and/actual.js @@ -0,0 +1 @@ +x and y diff --git a/test/fixtures/lightscript/operators/and/expected.json b/test/fixtures/lightscript/operators/and/expected.json new file mode 100644 index 0000000000..a4d723065e --- /dev/null +++ b/test/fixtures/lightscript/operators/and/expected.json @@ -0,0 +1,96 @@ +{ + "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": "LogicalExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "&&", + "right": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "y" + } + } + } + ] + } +} diff --git a/test/fixtures/lightscript/operators/binary-then-logical/actual.js b/test/fixtures/lightscript/operators/binary-then-logical/actual.js new file mode 100644 index 0000000000..a5176e294f --- /dev/null +++ b/test/fixtures/lightscript/operators/binary-then-logical/actual.js @@ -0,0 +1 @@ +1 == 0 or 1 diff --git a/test/fixtures/lightscript/operators/binary-then-logical/expected.json b/test/fixtures/lightscript/operators/binary-then-logical/expected.json new file mode 100644 index 0000000000..3fdc6e3867 --- /dev/null +++ b/test/fixtures/lightscript/operators/binary-then-logical/expected.json @@ -0,0 +1,141 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "LogicalExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "NumericLiteral", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "operator": "===", + "right": { + "type": "NumericLiteral", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + "operator": "||", + "right": { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/operators/eq/actual.js b/test/fixtures/lightscript/operators/eq/actual.js new file mode 100644 index 0000000000..04dfc84773 --- /dev/null +++ b/test/fixtures/lightscript/operators/eq/actual.js @@ -0,0 +1 @@ +x == y diff --git a/test/fixtures/lightscript/operators/eq/expected.json b/test/fixtures/lightscript/operators/eq/expected.json new file mode 100644 index 0000000000..40f289ed6c --- /dev/null +++ b/test/fixtures/lightscript/operators/eq/expected.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "===", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "y" + }, + "name": "y" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/operators/not-eq/actual.js b/test/fixtures/lightscript/operators/not-eq/actual.js new file mode 100644 index 0000000000..348bb48b0f --- /dev/null +++ b/test/fixtures/lightscript/operators/not-eq/actual.js @@ -0,0 +1 @@ +x != y diff --git a/test/fixtures/lightscript/operators/not-eq/expected.json b/test/fixtures/lightscript/operators/not-eq/expected.json new file mode 100644 index 0000000000..f49e94403e --- /dev/null +++ b/test/fixtures/lightscript/operators/not-eq/expected.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "!==", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "y" + }, + "name": "y" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/operators/or/actual.js b/test/fixtures/lightscript/operators/or/actual.js new file mode 100644 index 0000000000..7edbe01c94 --- /dev/null +++ b/test/fixtures/lightscript/operators/or/actual.js @@ -0,0 +1 @@ +x or y diff --git a/test/fixtures/lightscript/operators/or/expected.json b/test/fixtures/lightscript/operators/or/expected.json new file mode 100644 index 0000000000..a9dd3c7041 --- /dev/null +++ b/test/fixtures/lightscript/operators/or/expected.json @@ -0,0 +1,96 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "LogicalExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "||", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + } + } + ] + } +} diff --git a/test/fixtures/lightscript/options.json b/test/fixtures/lightscript/options.json new file mode 100644 index 0000000000..d867818387 --- /dev/null +++ b/test/fixtures/lightscript/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["lightscript", "jsx", "flow"] +} diff --git a/test/fixtures/lightscript/paren-free/do-while-malformed/actual.js b/test/fixtures/lightscript/paren-free/do-while-malformed/actual.js new file mode 100644 index 0000000000..82a920ce00 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/do-while-malformed/actual.js @@ -0,0 +1 @@ +do {} while true false diff --git a/test/fixtures/lightscript/paren-free/do-while-malformed/options.json b/test/fixtures/lightscript/paren-free/do-while-malformed/options.json new file mode 100644 index 0000000000..e20a42a75d --- /dev/null +++ b/test/fixtures/lightscript/paren-free/do-while-malformed/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected ; (1:17)" +} diff --git a/test/fixtures/lightscript/paren-free/do-while-then-paren-unfortunate/actual.js b/test/fixtures/lightscript/paren-free/do-while-then-paren-unfortunate/actual.js new file mode 100644 index 0000000000..aec7fbe95b --- /dev/null +++ b/test/fixtures/lightscript/paren-free/do-while-then-paren-unfortunate/actual.js @@ -0,0 +1 @@ +do {} while (a) (b) diff --git a/test/fixtures/lightscript/paren-free/do-while-then-paren-unfortunate/expected.json b/test/fixtures/lightscript/paren-free/do-while-then-paren-unfortunate/expected.json new file mode 100644 index 0000000000..323c22311b --- /dev/null +++ b/test/fixtures/lightscript/paren-free/do-while-then-paren-unfortunate/expected.json @@ -0,0 +1,124 @@ +{ + "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": "DoWhileStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": { + "type": "BlockStatement", + "start": 3, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "test": { + "type": "CallExpression", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "callee": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "a" + }, + "name": "a", + "extra": { + "parenthesized": true, + "parenStart": 12 + } + }, + "arguments": [ + { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "b" + }, + "name": "b" + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/paren-free/do-while/actual.js b/test/fixtures/lightscript/paren-free/do-while/actual.js new file mode 100644 index 0000000000..57af195b1e --- /dev/null +++ b/test/fixtures/lightscript/paren-free/do-while/actual.js @@ -0,0 +1 @@ +do {} while true diff --git a/test/fixtures/lightscript/paren-free/do-while/expected.json b/test/fixtures/lightscript/paren-free/do-while/expected.json new file mode 100644 index 0000000000..54b3650b70 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/do-while/expected.json @@ -0,0 +1,85 @@ +{ + "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": "DoWhileStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "body": { + "type": "BlockStatement", + "start": 3, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "test": { + "type": "BooleanLiteral", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": true + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/paren-free/for-colon/actual.js b/test/fixtures/lightscript/paren-free/for-colon/actual.js new file mode 100644 index 0000000000..d42c22f36a --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for-colon/actual.js @@ -0,0 +1 @@ +for let i = 0; i < 10; i++: x() diff --git a/test/fixtures/lightscript/paren-free/for-colon/expected.json b/test/fixtures/lightscript/paren-free/for-colon/expected.json new file mode 100644 index 0000000000..2538ba58a0 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for-colon/expected.json @@ -0,0 +1,254 @@ +{ + "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": "ForStatement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "init": { + "type": "VariableDeclaration", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "i" + }, + "name": "i" + }, + "init": { + "type": "NumericLiteral", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ], + "kind": "let" + }, + "test": { + "type": "BinaryExpression", + "start": 15, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "left": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": "<", + "right": { + "type": "NumericLiteral", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + }, + "update": { + "type": "UpdateExpression", + "start": 23, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "i" + }, + "name": "i" + } + }, + "body": { + "type": "ExpressionStatement", + "start": 28, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "CallExpression", + "start": 28, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "callee": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "x" + }, + "name": "x" + }, + "arguments": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/paren-free/for-in-colon/actual.js b/test/fixtures/lightscript/paren-free/for-in-colon/actual.js new file mode 100644 index 0000000000..5065ce0b3d --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for-in-colon/actual.js @@ -0,0 +1 @@ +for const i in []: x() diff --git a/test/fixtures/lightscript/paren-free/for-in-colon/expected.json b/test/fixtures/lightscript/paren-free/for-in-colon/expected.json new file mode 100644 index 0000000000..79e93f9406 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for-in-colon/expected.json @@ -0,0 +1,164 @@ +{ + "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": "ForInStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "i" + }, + "name": "i" + }, + "init": null + } + ], + "kind": "const" + }, + "right": { + "type": "ArrayExpression", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "elements": [] + }, + "body": { + "type": "ExpressionStatement", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "CallExpression", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "callee": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "x" + }, + "name": "x" + }, + "arguments": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/paren-free/for-in/actual.js b/test/fixtures/lightscript/paren-free/for-in/actual.js new file mode 100644 index 0000000000..46eaf86eaf --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for-in/actual.js @@ -0,0 +1 @@ +for let x in [1, 2] {} diff --git a/test/fixtures/lightscript/paren-free/for-in/expected.json b/test/fixtures/lightscript/paren-free/for-in/expected.json new file mode 100644 index 0000000000..82f790431a --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for-in/expected.json @@ -0,0 +1,177 @@ +{ + "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": "ForInStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": null + } + ], + "kind": "let" + }, + "right": { + "type": "ArrayExpression", + "start": 13, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + ] + }, + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/paren-free/for-mismatched-paren-left/actual.js b/test/fixtures/lightscript/paren-free/for-mismatched-paren-left/actual.js new file mode 100644 index 0000000000..3c2d97fb6d --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for-mismatched-paren-left/actual.js @@ -0,0 +1 @@ +for (;; {} diff --git a/test/fixtures/lightscript/paren-free/for-mismatched-paren-left/options.json b/test/fixtures/lightscript/paren-free/for-mismatched-paren-left/options.json new file mode 100644 index 0000000000..a90d01d9f3 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for-mismatched-paren-left/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected ) (1:10)" +} diff --git a/test/fixtures/lightscript/paren-free/for-mismatched-paren-right/actual.js b/test/fixtures/lightscript/paren-free/for-mismatched-paren-right/actual.js new file mode 100644 index 0000000000..7641c90466 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for-mismatched-paren-right/actual.js @@ -0,0 +1 @@ +for ;;) {} diff --git a/test/fixtures/lightscript/paren-free/for-mismatched-paren-right/options.json b/test/fixtures/lightscript/paren-free/for-mismatched-paren-right/options.json new file mode 100644 index 0000000000..d75c9a4e85 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for-mismatched-paren-right/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Paren-free test expressions must be followed by braces or a colon. (1:6)" +} diff --git a/test/fixtures/lightscript/paren-free/for-of-colon/actual.js b/test/fixtures/lightscript/paren-free/for-of-colon/actual.js new file mode 100644 index 0000000000..6158e7276d --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for-of-colon/actual.js @@ -0,0 +1 @@ +for now {x} of []: x() diff --git a/test/fixtures/lightscript/paren-free/for-of-colon/expected.json b/test/fixtures/lightscript/paren-free/for-of-colon/expected.json new file mode 100644 index 0000000000..98397dc998 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for-of-colon/expected.json @@ -0,0 +1,186 @@ +{ + "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": "ForOfStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "left": { + "type": "ObjectPattern", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + }, + "value": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + }, + "extra": { + "shorthand": true + } + } + ], + "isNowAssign": true + }, + "right": { + "type": "ArrayExpression", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "elements": [] + }, + "body": { + "type": "ExpressionStatement", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "CallExpression", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "callee": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "x" + }, + "name": "x" + }, + "arguments": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/paren-free/for-of-const-destructured-array/actual.js b/test/fixtures/lightscript/paren-free/for-of-const-destructured-array/actual.js new file mode 100644 index 0000000000..f8245c3c43 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for-of-const-destructured-array/actual.js @@ -0,0 +1 @@ +for const [a] of [] {} 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 new file mode 100644 index 0000000000..7b6dfccc31 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for-of-const-destructured-array/expected.json @@ -0,0 +1,153 @@ +{ + "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": "ForOfStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "ArrayPattern", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "a" + }, + "name": "a" + } + ] + }, + "init": null + } + ], + "kind": "const" + }, + "right": { + "type": "ArrayExpression", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "elements": [] + }, + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/paren-free/for-of-const-destructured/actual.js b/test/fixtures/lightscript/paren-free/for-of-const-destructured/actual.js new file mode 100644 index 0000000000..9ba6cd6ca8 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for-of-const-destructured/actual.js @@ -0,0 +1 @@ +for const {a} of {a: 1} {} 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 new file mode 100644 index 0000000000..0ec9e4efd3 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for-of-const-destructured/expected.json @@ -0,0 +1,247 @@ +{ + "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": "ForOfStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "ObjectPattern", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "a" + }, + "name": "a" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": null + } + ], + "kind": "const" + }, + "right": { + "type": "ObjectExpression", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "NumericLiteral", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ] + }, + "body": { + "type": "BlockStatement", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/paren-free/for-of-const/actual.js b/test/fixtures/lightscript/paren-free/for-of-const/actual.js new file mode 100644 index 0000000000..cf623df0ea --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for-of-const/actual.js @@ -0,0 +1 @@ +for const x of {a: 1} {} diff --git a/test/fixtures/lightscript/paren-free/for-of-const/expected.json b/test/fixtures/lightscript/paren-free/for-of-const/expected.json new file mode 100644 index 0000000000..f0e4d7b3b8 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for-of-const/expected.json @@ -0,0 +1,192 @@ +{ + "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": "ForOfStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": null + } + ], + "kind": "const" + }, + "right": { + "type": "ObjectExpression", + "start": 15, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "NumericLiteral", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ] + }, + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/paren-free/for-of-mismatched-left/actual.js b/test/fixtures/lightscript/paren-free/for-of-mismatched-left/actual.js new file mode 100644 index 0000000000..a0f4ec7183 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for-of-mismatched-left/actual.js @@ -0,0 +1 @@ +for (let x of {a: 1} {} diff --git a/test/fixtures/lightscript/paren-free/for-of-mismatched-left/options.json b/test/fixtures/lightscript/paren-free/for-of-mismatched-left/options.json new file mode 100644 index 0000000000..5ceb74b6b9 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for-of-mismatched-left/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected ) (1:21)" +} diff --git a/test/fixtures/lightscript/paren-free/for-of-mismatched-right/actual.js b/test/fixtures/lightscript/paren-free/for-of-mismatched-right/actual.js new file mode 100644 index 0000000000..1556f642b0 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for-of-mismatched-right/actual.js @@ -0,0 +1 @@ +for let x of {a: 1}) {} diff --git a/test/fixtures/lightscript/paren-free/for-of-mismatched-right/options.json b/test/fixtures/lightscript/paren-free/for-of-mismatched-right/options.json new file mode 100644 index 0000000000..b9d084acb5 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for-of-mismatched-right/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Paren-free test expressions must be followed by braces or a colon. (1:19)" +} diff --git a/test/fixtures/lightscript/paren-free/for-of/actual.js b/test/fixtures/lightscript/paren-free/for-of/actual.js new file mode 100644 index 0000000000..c005ddf0d6 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for-of/actual.js @@ -0,0 +1 @@ +for let x of {a: 1} {} diff --git a/test/fixtures/lightscript/paren-free/for-of/expected.json b/test/fixtures/lightscript/paren-free/for-of/expected.json new file mode 100644 index 0000000000..731a459a2e --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for-of/expected.json @@ -0,0 +1,192 @@ +{ + "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": "ForOfStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": null + } + ], + "kind": "let" + }, + "right": { + "type": "ObjectExpression", + "start": 13, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "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": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ] + }, + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/paren-free/for/actual.js b/test/fixtures/lightscript/paren-free/for/actual.js new file mode 100644 index 0000000000..6a3a8a2700 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for/actual.js @@ -0,0 +1 @@ +for let i = 0; i < 10; i++ {} diff --git a/test/fixtures/lightscript/paren-free/for/expected.json b/test/fixtures/lightscript/paren-free/for/expected.json new file mode 100644 index 0000000000..b458108e7c --- /dev/null +++ b/test/fixtures/lightscript/paren-free/for/expected.json @@ -0,0 +1,226 @@ +{ + "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": "ForStatement", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "init": { + "type": "VariableDeclaration", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "i" + }, + "name": "i" + }, + "init": { + "type": "NumericLiteral", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ], + "kind": "let" + }, + "test": { + "type": "BinaryExpression", + "start": 15, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "left": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": "<", + "right": { + "type": "NumericLiteral", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + }, + "update": { + "type": "UpdateExpression", + "start": 23, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "i" + }, + "name": "i" + } + }, + "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/lightscript/paren-free/if-colon/actual.js b/test/fixtures/lightscript/paren-free/if-colon/actual.js new file mode 100644 index 0000000000..6f3e255cf5 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/if-colon/actual.js @@ -0,0 +1 @@ +if true: x() diff --git a/test/fixtures/lightscript/paren-free/if-colon/expected.json b/test/fixtures/lightscript/paren-free/if-colon/expected.json new file mode 100644 index 0000000000..3ba150fafd --- /dev/null +++ b/test/fixtures/lightscript/paren-free/if-colon/expected.json @@ -0,0 +1,114 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 3, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": true + }, + "consequent": { + "type": "ExpressionStatement", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "CallExpression", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "callee": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + }, + "arguments": [] + } + }, + "alternate": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/paren-free/if-malformed/actual.js b/test/fixtures/lightscript/paren-free/if-malformed/actual.js new file mode 100644 index 0000000000..ef0eae6f03 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/if-malformed/actual.js @@ -0,0 +1 @@ +if true x() diff --git a/test/fixtures/lightscript/paren-free/if-malformed/options.json b/test/fixtures/lightscript/paren-free/if-malformed/options.json new file mode 100644 index 0000000000..59737e18d2 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/if-malformed/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Paren-free test expressions must be followed by braces or a colon. (1:8)" +} diff --git a/test/fixtures/lightscript/paren-free/if/actual.js b/test/fixtures/lightscript/paren-free/if/actual.js new file mode 100644 index 0000000000..912c09ab18 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/if/actual.js @@ -0,0 +1 @@ +if true {} diff --git a/test/fixtures/lightscript/paren-free/if/expected.json b/test/fixtures/lightscript/paren-free/if/expected.json new file mode 100644 index 0000000000..9881087cbd --- /dev/null +++ b/test/fixtures/lightscript/paren-free/if/expected.json @@ -0,0 +1,86 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 3, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": true + }, + "consequent": { + "type": "BlockStatement", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "alternate": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/paren-free/multiline-cond-else-parens/actual.js b/test/fixtures/lightscript/paren-free/multiline-cond-else-parens/actual.js new file mode 100644 index 0000000000..4729ac7c02 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/multiline-cond-else-parens/actual.js @@ -0,0 +1,5 @@ +if true +and true: + x() +else: + y() diff --git a/test/fixtures/lightscript/paren-free/multiline-cond-else-parens/expected.json b/test/fixtures/lightscript/paren-free/multiline-cond-else-parens/expected.json new file mode 100644 index 0000000000..37ea09a383 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/multiline-cond-else-parens/expected.json @@ -0,0 +1,235 @@ +{ + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "test": { + "type": "LogicalExpression", + "start": 3, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "left": { + "type": "BooleanLiteral", + "start": 3, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": true + }, + "operator": "&&", + "right": { + "type": "BooleanLiteral", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "value": true + } + }, + "consequent": { + "type": "BlockStatement", + "start": 16, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "expression": { + "type": "CallExpression", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "callee": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + }, + "arguments": [] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": { + "type": "BlockStatement", + "start": 28, + "end": 35, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "expression": { + "type": "CallExpression", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "callee": { + "type": "Identifier", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + }, + "identifierName": "y" + }, + "name": "y" + }, + "arguments": [] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/paren-free/multiline-cond-else-wrong-indent/actual.js b/test/fixtures/lightscript/paren-free/multiline-cond-else-wrong-indent/actual.js new file mode 100644 index 0000000000..b2518f2bd7 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/multiline-cond-else-wrong-indent/actual.js @@ -0,0 +1,5 @@ +if true + and true: + x() + else: + y() diff --git a/test/fixtures/lightscript/paren-free/multiline-cond-else-wrong-indent/options.json b/test/fixtures/lightscript/paren-free/multiline-cond-else-wrong-indent/options.json new file mode 100644 index 0000000000..a46c7350a3 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/multiline-cond-else-wrong-indent/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unmatched `else` (must match indentation of the line with `if`). (4:2)" +} diff --git a/test/fixtures/lightscript/paren-free/multiline-cond-else/actual.js b/test/fixtures/lightscript/paren-free/multiline-cond-else/actual.js new file mode 100644 index 0000000000..d3a2a41438 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/multiline-cond-else/actual.js @@ -0,0 +1,5 @@ +if true + and true: + x() +else: + y() diff --git a/test/fixtures/lightscript/paren-free/multiline-cond-else/expected.json b/test/fixtures/lightscript/paren-free/multiline-cond-else/expected.json new file mode 100644 index 0000000000..24b322791b --- /dev/null +++ b/test/fixtures/lightscript/paren-free/multiline-cond-else/expected.json @@ -0,0 +1,235 @@ +{ + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "test": { + "type": "LogicalExpression", + "start": 3, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "left": { + "type": "BooleanLiteral", + "start": 3, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": true + }, + "operator": "&&", + "right": { + "type": "BooleanLiteral", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "value": true + } + }, + "consequent": { + "type": "BlockStatement", + "start": 18, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "expression": { + "type": "CallExpression", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "callee": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "arguments": [] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": { + "type": "BlockStatement", + "start": 32, + "end": 39, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 36, + "end": 39, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "expression": { + "type": "CallExpression", + "start": 36, + "end": 39, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "callee": { + "type": "Identifier", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + }, + "identifierName": "y" + }, + "name": "y" + }, + "arguments": [] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/paren-free/multiline-cond-no-indent/actual.js b/test/fixtures/lightscript/paren-free/multiline-cond-no-indent/actual.js new file mode 100644 index 0000000000..bf46c9711f --- /dev/null +++ b/test/fixtures/lightscript/paren-free/multiline-cond-no-indent/actual.js @@ -0,0 +1,7 @@ +if ( + true and + true +): + x() +else: + y() diff --git a/test/fixtures/lightscript/paren-free/multiline-cond-no-indent/expected.json b/test/fixtures/lightscript/paren-free/multiline-cond-no-indent/expected.json new file mode 100644 index 0000000000..038917a0b8 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/multiline-cond-no-indent/expected.json @@ -0,0 +1,236 @@ +{ + "type": "File", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "test": { + "type": "LogicalExpression", + "start": 7, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "left": { + "type": "BooleanLiteral", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "value": true + }, + "operator": "&&", + "right": { + "type": "BooleanLiteral", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "value": true + }, + "extra": {} + }, + "consequent": { + "type": "BlockStatement", + "start": 24, + "end": 31, + "loc": { + "start": { + "line": 4, + "column": 1 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 28, + "end": 31, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "expression": { + "type": "CallExpression", + "start": 28, + "end": 31, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "callee": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + }, + "arguments": [] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": { + "type": "BlockStatement", + "start": 36, + "end": 43, + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 40, + "end": 43, + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "expression": { + "type": "CallExpression", + "start": 40, + "end": 43, + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "callee": { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + }, + "identifierName": "y" + }, + "name": "y" + }, + "arguments": [] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/paren-free/multiline-cond/actual.js b/test/fixtures/lightscript/paren-free/multiline-cond/actual.js new file mode 100644 index 0000000000..5b35f6b50f --- /dev/null +++ b/test/fixtures/lightscript/paren-free/multiline-cond/actual.js @@ -0,0 +1,3 @@ +if true + and true: + x() diff --git a/test/fixtures/lightscript/paren-free/multiline-cond/expected.json b/test/fixtures/lightscript/paren-free/multiline-cond/expected.json new file mode 100644 index 0000000000..884c86b92b --- /dev/null +++ b/test/fixtures/lightscript/paren-free/multiline-cond/expected.json @@ -0,0 +1,167 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "test": { + "type": "LogicalExpression", + "start": 3, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "left": { + "type": "BooleanLiteral", + "start": 3, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": true + }, + "operator": "&&", + "right": { + "type": "BooleanLiteral", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "value": true + } + }, + "consequent": { + "type": "BlockStatement", + "start": 18, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "expression": { + "type": "CallExpression", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "callee": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "arguments": [] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/paren-free/paren-block-no-space/actual.js b/test/fixtures/lightscript/paren-free/paren-block-no-space/actual.js new file mode 100644 index 0000000000..28be2e8245 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/paren-block-no-space/actual.js @@ -0,0 +1 @@ +if (a){} 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 new file mode 100644 index 0000000000..adf7b67150 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/paren-block-no-space/expected.json @@ -0,0 +1,87 @@ +{ + "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": "IfStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "test": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "consequent": { + "type": "BlockStatement", + "start": 6, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "alternate": null + } + ], + "directives": [] + } +} diff --git a/test/fixtures/lightscript/paren-free/paren-identifier-body-no-space/actual.js b/test/fixtures/lightscript/paren-free/paren-identifier-body-no-space/actual.js new file mode 100644 index 0000000000..14d7c8eb8b --- /dev/null +++ b/test/fixtures/lightscript/paren-free/paren-identifier-body-no-space/actual.js @@ -0,0 +1 @@ +if (1)a; diff --git a/test/fixtures/lightscript/paren-free/paren-identifier-body-no-space/expected.json b/test/fixtures/lightscript/paren-free/paren-identifier-body-no-space/expected.json new file mode 100644 index 0000000000..ea08084671 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/paren-identifier-body-no-space/expected.json @@ -0,0 +1,102 @@ +{ + "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": "IfStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "test": { + "type": "NumericLiteral", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "consequent": { + "type": "ExpressionStatement", + "start": 6, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + "alternate": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/paren-free/paren-member-expression-block/actual.js b/test/fixtures/lightscript/paren-free/paren-member-expression-block/actual.js new file mode 100644 index 0000000000..0256b20c02 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/paren-member-expression-block/actual.js @@ -0,0 +1 @@ +if ('hi').indexOf('h') < 0 {} diff --git a/test/fixtures/lightscript/paren-free/paren-member-expression-block/expected.json b/test/fixtures/lightscript/paren-free/paren-member-expression-block/expected.json new file mode 100644 index 0000000000..fe69f7b532 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/paren-member-expression-block/expected.json @@ -0,0 +1,198 @@ +{ + "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": "IfStatement", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "test": { + "type": "BinaryExpression", + "start": 3, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "left": { + "type": "CallExpression", + "start": 3, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "callee": { + "type": "MemberExpression", + "start": 3, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "object": { + "type": "StringLiteral", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": "hi", + "raw": "'hi'", + "parenthesized": true, + "parenStart": 3 + }, + "value": "hi" + }, + "property": { + "type": "Identifier", + "start": 10, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "indexOf" + }, + "name": "indexOf" + }, + "computed": false + }, + "arguments": [ + { + "type": "StringLiteral", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "extra": { + "rawValue": "h", + "raw": "'h'" + }, + "value": "h" + } + ] + }, + "operator": "<", + "right": { + "type": "NumericLiteral", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + "consequent": { + "type": "BlockStatement", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "alternate": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/paren-free/paren-member-expression-invalid/actual.js b/test/fixtures/lightscript/paren-free/paren-member-expression-invalid/actual.js new file mode 100644 index 0000000000..1e4583e2ea --- /dev/null +++ b/test/fixtures/lightscript/paren-free/paren-member-expression-invalid/actual.js @@ -0,0 +1 @@ +if ('hi').indexOf('h') hi diff --git a/test/fixtures/lightscript/paren-free/paren-member-expression-invalid/options.json b/test/fixtures/lightscript/paren-free/paren-member-expression-invalid/options.json new file mode 100644 index 0000000000..2a28555f76 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/paren-member-expression-invalid/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:9)" +} diff --git a/test/fixtures/lightscript/paren-free/paren-semi-body-no-space/actual.js b/test/fixtures/lightscript/paren-free/paren-semi-body-no-space/actual.js new file mode 100644 index 0000000000..114343c3b7 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/paren-semi-body-no-space/actual.js @@ -0,0 +1 @@ +if (a); diff --git a/test/fixtures/lightscript/paren-free/paren-semi-body-no-space/expected.json b/test/fixtures/lightscript/paren-free/paren-semi-body-no-space/expected.json new file mode 100644 index 0000000000..81ba49a7ea --- /dev/null +++ b/test/fixtures/lightscript/paren-free/paren-semi-body-no-space/expected.json @@ -0,0 +1,82 @@ +{ + "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": "IfStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "test": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "consequent": { + "type": "EmptyStatement", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + "alternate": null + } + ], + "directives": [] + } +} diff --git a/test/fixtures/lightscript/paren-free/paren-then-decimal/actual.js b/test/fixtures/lightscript/paren-free/paren-then-decimal/actual.js new file mode 100644 index 0000000000..d3dfdeed9a --- /dev/null +++ b/test/fixtures/lightscript/paren-free/paren-then-decimal/actual.js @@ -0,0 +1 @@ +if (x) 0.1 diff --git a/test/fixtures/lightscript/paren-free/paren-then-decimal/expected.json b/test/fixtures/lightscript/paren-free/paren-then-decimal/expected.json new file mode 100644 index 0000000000..3c1b0586f8 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/paren-then-decimal/expected.json @@ -0,0 +1,102 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "test": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "consequent": { + "type": "ExpressionStatement", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 0.1, + "raw": "0.1" + }, + "value": 0.1 + } + }, + "alternate": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/paren-free/paren-then-numeric-member-illegal/actual.js b/test/fixtures/lightscript/paren-free/paren-then-numeric-member-illegal/actual.js new file mode 100644 index 0000000000..fc6944b683 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/paren-then-numeric-member-illegal/actual.js @@ -0,0 +1 @@ +if (x) .1 diff --git a/test/fixtures/lightscript/paren-free/paren-then-numeric-member-illegal/options.json b/test/fixtures/lightscript/paren-free/paren-then-numeric-member-illegal/options.json new file mode 100644 index 0000000000..bb2762c0cc --- /dev/null +++ b/test/fixtures/lightscript/paren-free/paren-then-numeric-member-illegal/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Decimal numbers must be prefixed with a `0` in LightScript (eg; `0.1`). (1:7)" +} diff --git a/test/fixtures/lightscript/paren-free/paren-then-numeric-member-no-space/actual.js b/test/fixtures/lightscript/paren-free/paren-then-numeric-member-no-space/actual.js new file mode 100644 index 0000000000..4d0768dacf --- /dev/null +++ b/test/fixtures/lightscript/paren-free/paren-then-numeric-member-no-space/actual.js @@ -0,0 +1 @@ +if (x).1 {} diff --git a/test/fixtures/lightscript/paren-free/paren-then-numeric-member-no-space/expected.json b/test/fixtures/lightscript/paren-free/paren-then-numeric-member-no-space/expected.json new file mode 100644 index 0000000000..adcb70d16a --- /dev/null +++ b/test/fixtures/lightscript/paren-free/paren-then-numeric-member-no-space/expected.json @@ -0,0 +1,127 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "test": { + "type": "MemberExpression", + "start": 3, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "object": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x", + "extra": { + "parenthesized": true, + "parenStart": 3 + } + }, + "property": { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "computed": true + }, + "consequent": { + "type": "BlockStatement", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "alternate": null + } + ], + "directives": [] + } +} diff --git a/test/fixtures/lightscript/paren-free/paren-then-numeric-member-space/actual.js b/test/fixtures/lightscript/paren-free/paren-then-numeric-member-space/actual.js new file mode 100644 index 0000000000..b65d78cffd --- /dev/null +++ b/test/fixtures/lightscript/paren-free/paren-then-numeric-member-space/actual.js @@ -0,0 +1 @@ +if (x) .1 {} diff --git a/test/fixtures/lightscript/paren-free/paren-then-numeric-member-space/expected.json b/test/fixtures/lightscript/paren-free/paren-then-numeric-member-space/expected.json new file mode 100644 index 0000000000..241052fb12 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/paren-then-numeric-member-space/expected.json @@ -0,0 +1,127 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "test": { + "type": "MemberExpression", + "start": 3, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "object": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x", + "extra": { + "parenthesized": true, + "parenStart": 3 + } + }, + "property": { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "computed": true + }, + "consequent": { + "type": "BlockStatement", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "alternate": null + } + ], + "directives": [] + } +} diff --git a/test/fixtures/lightscript/paren-free/paren-then-paren/actual.js b/test/fixtures/lightscript/paren-free/paren-then-paren/actual.js new file mode 100644 index 0000000000..74ac17403e --- /dev/null +++ b/test/fixtures/lightscript/paren-free/paren-then-paren/actual.js @@ -0,0 +1 @@ +if (x)(y) diff --git a/test/fixtures/lightscript/paren-free/paren-then-paren/expected.json b/test/fixtures/lightscript/paren-free/paren-then-paren/expected.json new file mode 100644 index 0000000000..7202d9c916 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/paren-then-paren/expected.json @@ -0,0 +1,103 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "test": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "consequent": { + "type": "ExpressionStatement", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "y" + }, + "name": "y", + "extra": { + "parenthesized": true, + "parenStart": 6 + } + } + }, + "alternate": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/paren-free/paren-then-update-expression/actual.js b/test/fixtures/lightscript/paren-free/paren-then-update-expression/actual.js new file mode 100644 index 0000000000..7f1ffd2d19 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/paren-then-update-expression/actual.js @@ -0,0 +1 @@ +while (x)-- > 0 {} diff --git a/test/fixtures/lightscript/paren-free/paren-then-update-expression/expected.json b/test/fixtures/lightscript/paren-free/paren-then-update-expression/expected.json new file mode 100644 index 0000000000..6a964fb501 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/paren-then-update-expression/expected.json @@ -0,0 +1,143 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "test": { + "type": "BinaryExpression", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "left": { + "type": "UpdateExpression", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "operator": "--", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x", + "extra": { + "parenthesized": true, + "parenStart": 6 + } + } + }, + "operator": ">", + "right": { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + "body": { + "type": "BlockStatement", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/paren-free/switch/actual.js b/test/fixtures/lightscript/paren-free/switch/actual.js new file mode 100644 index 0000000000..870f334594 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/switch/actual.js @@ -0,0 +1 @@ +switch x {} diff --git a/test/fixtures/lightscript/paren-free/switch/expected.json b/test/fixtures/lightscript/paren-free/switch/expected.json new file mode 100644 index 0000000000..6dbbb8ebb3 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/switch/expected.json @@ -0,0 +1,67 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "SwitchStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "discriminant": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + }, + "cases": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/paren-free/try-catch-mismatch-left/actual.js b/test/fixtures/lightscript/paren-free/try-catch-mismatch-left/actual.js new file mode 100644 index 0000000000..c080051eed --- /dev/null +++ b/test/fixtures/lightscript/paren-free/try-catch-mismatch-left/actual.js @@ -0,0 +1,5 @@ +try { + +} catch (err { + +} diff --git a/test/fixtures/lightscript/paren-free/try-catch-mismatch-left/options.json b/test/fixtures/lightscript/paren-free/try-catch-mismatch-left/options.json new file mode 100644 index 0000000000..d5f970007a --- /dev/null +++ b/test/fixtures/lightscript/paren-free/try-catch-mismatch-left/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected ) (3:13)" +} diff --git a/test/fixtures/lightscript/paren-free/try-catch-mismatch-right/actual.js b/test/fixtures/lightscript/paren-free/try-catch-mismatch-right/actual.js new file mode 100644 index 0000000000..01287e7399 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/try-catch-mismatch-right/actual.js @@ -0,0 +1,5 @@ +try { + +} catch err) { + +} diff --git a/test/fixtures/lightscript/paren-free/try-catch-mismatch-right/options.json b/test/fixtures/lightscript/paren-free/try-catch-mismatch-right/options.json new file mode 100644 index 0000000000..e0bf7718c3 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/try-catch-mismatch-right/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Paren-free test expressions must be followed by braces or a colon. (3:11)" +} diff --git a/test/fixtures/lightscript/paren-free/try-catch-no-block-or-paren/actual.js b/test/fixtures/lightscript/paren-free/try-catch-no-block-or-paren/actual.js new file mode 100644 index 0000000000..c24a86e044 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/try-catch-no-block-or-paren/actual.js @@ -0,0 +1,3 @@ +try { + +} catch err 1 diff --git a/test/fixtures/lightscript/paren-free/try-catch-no-block-or-paren/options.json b/test/fixtures/lightscript/paren-free/try-catch-no-block-or-paren/options.json new file mode 100644 index 0000000000..d79d39adb4 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/try-catch-no-block-or-paren/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Paren-free test expressions must be followed by braces or a colon. (3:12)" +} diff --git a/test/fixtures/lightscript/paren-free/try-catch/actual.js b/test/fixtures/lightscript/paren-free/try-catch/actual.js new file mode 100644 index 0000000000..80a3c9142d --- /dev/null +++ b/test/fixtures/lightscript/paren-free/try-catch/actual.js @@ -0,0 +1,5 @@ +try { + +} catch err { + +} diff --git a/test/fixtures/lightscript/paren-free/try-catch/expected.json b/test/fixtures/lightscript/paren-free/try-catch/expected.json new file mode 100644 index 0000000000..6db3bd8c40 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/try-catch/expected.json @@ -0,0 +1,123 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + }, + "handler": { + "type": "CatchClause", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "param": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 11 + }, + "identifierName": "err" + }, + "name": "err" + }, + "body": { + "type": "BlockStatement", + "start": 19, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + }, + "guardedHandlers": [], + "finalizer": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/paren-free/while-mismatched-paren-left/actual.js b/test/fixtures/lightscript/paren-free/while-mismatched-paren-left/actual.js new file mode 100644 index 0000000000..b086eb8036 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/while-mismatched-paren-left/actual.js @@ -0,0 +1 @@ +while (0 {} diff --git a/test/fixtures/lightscript/paren-free/while-mismatched-paren-left/options.json b/test/fixtures/lightscript/paren-free/while-mismatched-paren-left/options.json new file mode 100644 index 0000000000..60368e5bc9 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/while-mismatched-paren-left/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected ) (1:9)" +} diff --git a/test/fixtures/lightscript/paren-free/while-mismatched-paren-right/actual.js b/test/fixtures/lightscript/paren-free/while-mismatched-paren-right/actual.js new file mode 100644 index 0000000000..a0bb4913bd --- /dev/null +++ b/test/fixtures/lightscript/paren-free/while-mismatched-paren-right/actual.js @@ -0,0 +1 @@ +while 0) {} diff --git a/test/fixtures/lightscript/paren-free/while-mismatched-paren-right/options.json b/test/fixtures/lightscript/paren-free/while-mismatched-paren-right/options.json new file mode 100644 index 0000000000..54d200b06a --- /dev/null +++ b/test/fixtures/lightscript/paren-free/while-mismatched-paren-right/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Paren-free test expressions must be followed by braces or a colon. (1:7)" +} diff --git a/test/fixtures/lightscript/paren-free/while/actual.js b/test/fixtures/lightscript/paren-free/while/actual.js new file mode 100644 index 0000000000..5563321ceb --- /dev/null +++ b/test/fixtures/lightscript/paren-free/while/actual.js @@ -0,0 +1 @@ +while true {} diff --git a/test/fixtures/lightscript/paren-free/while/expected.json b/test/fixtures/lightscript/paren-free/while/expected.json new file mode 100644 index 0000000000..f178e85454 --- /dev/null +++ b/test/fixtures/lightscript/paren-free/while/expected.json @@ -0,0 +1,85 @@ +{ + "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": "WhileStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": true + }, + "body": { + "type": "BlockStatement", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/safe-member-expression/basic/actual.js b/test/fixtures/lightscript/safe-member-expression/basic/actual.js new file mode 100644 index 0000000000..f45302af16 --- /dev/null +++ b/test/fixtures/lightscript/safe-member-expression/basic/actual.js @@ -0,0 +1 @@ +x?.y diff --git a/test/fixtures/lightscript/safe-member-expression/basic/expected.json b/test/fixtures/lightscript/safe-member-expression/basic/expected.json new file mode 100644 index 0000000000..062c5f5ff1 --- /dev/null +++ b/test/fixtures/lightscript/safe-member-expression/basic/expected.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "SafeMemberExpression", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "property": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "y" + }, + "name": "y" + }, + "computed": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/safe-member-expression/chained/actual.js b/test/fixtures/lightscript/safe-member-expression/chained/actual.js new file mode 100644 index 0000000000..4249e41c2a --- /dev/null +++ b/test/fixtures/lightscript/safe-member-expression/chained/actual.js @@ -0,0 +1 @@ +x.y?.a?.b.c[d](e, f)[g]?.h diff --git a/test/fixtures/lightscript/safe-member-expression/chained/expected.json b/test/fixtures/lightscript/safe-member-expression/chained/expected.json new file mode 100644 index 0000000000..e6f6c2c71f --- /dev/null +++ b/test/fixtures/lightscript/safe-member-expression/chained/expected.json @@ -0,0 +1,348 @@ +{ + "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": "SafeMemberExpression", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "object": { + "type": "CallExpression", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "callee": { + "type": "MemberExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "object": { + "type": "SafeMemberExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "object": { + "type": "SafeMemberExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "property": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "y" + }, + "name": "y" + }, + "computed": false + }, + "property": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false + }, + "property": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "b" + }, + "name": "b" + }, + "computed": false + }, + "property": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "c" + }, + "name": "c" + }, + "computed": false + }, + "property": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "d" + }, + "name": "d" + }, + "computed": true + }, + "arguments": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "e" + }, + "name": "e" + }, + { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "f" + }, + "name": "f" + } + ] + }, + "property": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "g" + }, + "name": "g" + }, + "computed": true + }, + "property": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + }, + "identifierName": "h" + }, + "name": "h" + }, + "computed": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/safe-member-expression/computed/actual.js b/test/fixtures/lightscript/safe-member-expression/computed/actual.js new file mode 100644 index 0000000000..ffe21b97a0 --- /dev/null +++ b/test/fixtures/lightscript/safe-member-expression/computed/actual.js @@ -0,0 +1 @@ +x?[y + y] diff --git a/test/fixtures/lightscript/safe-member-expression/computed/expected.json b/test/fixtures/lightscript/safe-member-expression/computed/expected.json new file mode 100644 index 0000000000..c3870b58b9 --- /dev/null +++ b/test/fixtures/lightscript/safe-member-expression/computed/expected.json @@ -0,0 +1,132 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "SafeMemberExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "property": { + "type": "BinaryExpression", + "start": 3, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "left": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "y" + }, + "name": "y" + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "y" + }, + "name": "y" + } + }, + "computed": true + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/safe-member-expression/index/actual.js b/test/fixtures/lightscript/safe-member-expression/index/actual.js new file mode 100644 index 0000000000..cb475bd84e --- /dev/null +++ b/test/fixtures/lightscript/safe-member-expression/index/actual.js @@ -0,0 +1 @@ +x?.0 diff --git a/test/fixtures/lightscript/safe-member-expression/index/expected.json b/test/fixtures/lightscript/safe-member-expression/index/expected.json new file mode 100644 index 0000000000..2aca9d8bda --- /dev/null +++ b/test/fixtures/lightscript/safe-member-expression/index/expected.json @@ -0,0 +1,102 @@ +{ + "type": "File", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "SafeMemberExpression", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "property": { + "type": "NumericLiteral", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": 0, + "extra": { + "raw": "0", + "rawValue": 0 + } + }, + "computed": true + } + } + ], + "directives": [] + } +} diff --git a/test/fixtures/lightscript/safe-member-expression/not-indented-illegal/actual.js b/test/fixtures/lightscript/safe-member-expression/not-indented-illegal/actual.js new file mode 100644 index 0000000000..5a57b461f1 --- /dev/null +++ b/test/fixtures/lightscript/safe-member-expression/not-indented-illegal/actual.js @@ -0,0 +1,2 @@ +a +?.b() diff --git a/test/fixtures/lightscript/safe-member-expression/not-indented-illegal/options.json b/test/fixtures/lightscript/safe-member-expression/not-indented-illegal/options.json new file mode 100644 index 0000000000..15b72fccd0 --- /dev/null +++ b/test/fixtures/lightscript/safe-member-expression/not-indented-illegal/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Indentation required. (2:0)" +} diff --git a/test/fixtures/lightscript/tilde-calls/args/actual.js b/test/fixtures/lightscript/tilde-calls/args/actual.js new file mode 100644 index 0000000000..454a02f16d --- /dev/null +++ b/test/fixtures/lightscript/tilde-calls/args/actual.js @@ -0,0 +1 @@ +a~b(c) diff --git a/test/fixtures/lightscript/tilde-calls/args/expected.json b/test/fixtures/lightscript/tilde-calls/args/expected.json new file mode 100644 index 0000000000..501f5637e3 --- /dev/null +++ b/test/fixtures/lightscript/tilde-calls/args/expected.json @@ -0,0 +1,117 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "TildeCallExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "right": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + }, + "arguments": [ + { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "c" + }, + "name": "c" + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/tilde-calls/basic/actual.js b/test/fixtures/lightscript/tilde-calls/basic/actual.js new file mode 100644 index 0000000000..f03e3ab0f2 --- /dev/null +++ b/test/fixtures/lightscript/tilde-calls/basic/actual.js @@ -0,0 +1 @@ +a~b() diff --git a/test/fixtures/lightscript/tilde-calls/basic/expected.json b/test/fixtures/lightscript/tilde-calls/basic/expected.json new file mode 100644 index 0000000000..2127f03766 --- /dev/null +++ b/test/fixtures/lightscript/tilde-calls/basic/expected.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "TildeCallExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "right": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + }, + "arguments": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/tilde-calls/invalid-destructured-param/actual.js b/test/fixtures/lightscript/tilde-calls/invalid-destructured-param/actual.js new file mode 100644 index 0000000000..ed6473bf44 --- /dev/null +++ b/test/fixtures/lightscript/tilde-calls/invalid-destructured-param/actual.js @@ -0,0 +1 @@ +a~b({ c = 1 }) diff --git a/test/fixtures/lightscript/tilde-calls/invalid-destructured-param/options.json b/test/fixtures/lightscript/tilde-calls/invalid-destructured-param/options.json new file mode 100644 index 0000000000..9ce9658f7d --- /dev/null +++ b/test/fixtures/lightscript/tilde-calls/invalid-destructured-param/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:8)" +} diff --git a/test/fixtures/lightscript/tilde-calls/member-called/actual.js b/test/fixtures/lightscript/tilde-calls/member-called/actual.js new file mode 100644 index 0000000000..e3dfbf62d9 --- /dev/null +++ b/test/fixtures/lightscript/tilde-calls/member-called/actual.js @@ -0,0 +1 @@ +a~b().c() diff --git a/test/fixtures/lightscript/tilde-calls/member-called/expected.json b/test/fixtures/lightscript/tilde-calls/member-called/expected.json new file mode 100644 index 0000000000..a8bdfd03d1 --- /dev/null +++ b/test/fixtures/lightscript/tilde-calls/member-called/expected.json @@ -0,0 +1,148 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "callee": { + "type": "MemberExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "object": { + "type": "TildeCallExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "right": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + }, + "arguments": [] + }, + "property": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "c" + }, + "name": "c" + }, + "computed": false + }, + "arguments": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/tilde-calls/member/actual.js b/test/fixtures/lightscript/tilde-calls/member/actual.js new file mode 100644 index 0000000000..07cbefe18a --- /dev/null +++ b/test/fixtures/lightscript/tilde-calls/member/actual.js @@ -0,0 +1 @@ +a~b.c() diff --git a/test/fixtures/lightscript/tilde-calls/member/expected.json b/test/fixtures/lightscript/tilde-calls/member/expected.json new file mode 100644 index 0000000000..759f87deb5 --- /dev/null +++ b/test/fixtures/lightscript/tilde-calls/member/expected.json @@ -0,0 +1,132 @@ +{ + "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": "TildeCallExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "right": { + "type": "MemberExpression", + "start": 3, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "object": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + }, + "property": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "c" + }, + "name": "c" + }, + "computed": false + }, + "arguments": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/tilde-calls/multiple/actual.js b/test/fixtures/lightscript/tilde-calls/multiple/actual.js new file mode 100644 index 0000000000..78570c756c --- /dev/null +++ b/test/fixtures/lightscript/tilde-calls/multiple/actual.js @@ -0,0 +1 @@ +a~b()~c() diff --git a/test/fixtures/lightscript/tilde-calls/multiple/expected.json b/test/fixtures/lightscript/tilde-calls/multiple/expected.json new file mode 100644 index 0000000000..cbde54876b --- /dev/null +++ b/test/fixtures/lightscript/tilde-calls/multiple/expected.json @@ -0,0 +1,132 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "TildeCallExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "TildeCallExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "right": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + }, + "arguments": [] + }, + "right": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "c" + }, + "name": "c" + }, + "arguments": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/tilde-calls/not-indented-illegal/actual.js b/test/fixtures/lightscript/tilde-calls/not-indented-illegal/actual.js new file mode 100644 index 0000000000..81e8f27db2 --- /dev/null +++ b/test/fixtures/lightscript/tilde-calls/not-indented-illegal/actual.js @@ -0,0 +1,2 @@ +a +~b() diff --git a/test/fixtures/lightscript/tilde-calls/not-indented-illegal/options.json b/test/fixtures/lightscript/tilde-calls/not-indented-illegal/options.json new file mode 100644 index 0000000000..15b72fccd0 --- /dev/null +++ b/test/fixtures/lightscript/tilde-calls/not-indented-illegal/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Indentation required. (2:0)" +} diff --git a/test/fixtures/lightscript/tilde-calls/reserved-keyword/actual.js b/test/fixtures/lightscript/tilde-calls/reserved-keyword/actual.js new file mode 100644 index 0000000000..8eabca9d71 --- /dev/null +++ b/test/fixtures/lightscript/tilde-calls/reserved-keyword/actual.js @@ -0,0 +1 @@ +a~yield() diff --git a/test/fixtures/lightscript/tilde-calls/reserved-keyword/options.json b/test/fixtures/lightscript/tilde-calls/reserved-keyword/options.json new file mode 100644 index 0000000000..b465a8cba4 --- /dev/null +++ b/test/fixtures/lightscript/tilde-calls/reserved-keyword/options.json @@ -0,0 +1,3 @@ +{ + "throws": "yield is a reserved word (1:2)" +} diff --git a/test/fixtures/lightscript/tilde-calls/this-expression-member/actual.js b/test/fixtures/lightscript/tilde-calls/this-expression-member/actual.js new file mode 100644 index 0000000000..0fa2bec087 --- /dev/null +++ b/test/fixtures/lightscript/tilde-calls/this-expression-member/actual.js @@ -0,0 +1 @@ +a~this.method() diff --git a/test/fixtures/lightscript/tilde-calls/this-expression-member/expected.json b/test/fixtures/lightscript/tilde-calls/this-expression-member/expected.json new file mode 100644 index 0000000000..c6f90e3123 --- /dev/null +++ b/test/fixtures/lightscript/tilde-calls/this-expression-member/expected.json @@ -0,0 +1,130 @@ +{ + "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": "TildeCallExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "right": { + "type": "MemberExpression", + "start": 6, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "object": { + "type": "ThisExpression", + "start": 2, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 6 + } + } + }, + "property": { + "type": "Identifier", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "method" + }, + "name": "method" + }, + "computed": false + }, + "arguments": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/tilde-calls/this-expression/actual.js b/test/fixtures/lightscript/tilde-calls/this-expression/actual.js new file mode 100644 index 0000000000..06d9bc066d --- /dev/null +++ b/test/fixtures/lightscript/tilde-calls/this-expression/actual.js @@ -0,0 +1 @@ +a~this() diff --git a/test/fixtures/lightscript/tilde-calls/this-expression/expected.json b/test/fixtures/lightscript/tilde-calls/this-expression/expected.json new file mode 100644 index 0000000000..ec16426d38 --- /dev/null +++ b/test/fixtures/lightscript/tilde-calls/this-expression/expected.json @@ -0,0 +1,97 @@ +{ + "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": "TildeCallExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "right": { + "type": "ThisExpression", + "start": 2, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 6 + } + } + }, + "arguments": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/basic-for/actual.js b/test/fixtures/lightscript/whitespace/basic-for/actual.js new file mode 100644 index 0000000000..d4508967e2 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/basic-for/actual.js @@ -0,0 +1,3 @@ +for let i = 0; i < 10; i++: + x() + y() diff --git a/test/fixtures/lightscript/whitespace/basic-for/expected.json b/test/fixtures/lightscript/whitespace/basic-for/expected.json new file mode 100644 index 0000000000..4df413c2be --- /dev/null +++ b/test/fixtures/lightscript/whitespace/basic-for/expected.json @@ -0,0 +1,323 @@ +{ + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "init": { + "type": "VariableDeclaration", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "i" + }, + "name": "i" + }, + "init": { + "type": "NumericLiteral", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ], + "kind": "let" + }, + "test": { + "type": "BinaryExpression", + "start": 15, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "left": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": "<", + "right": { + "type": "NumericLiteral", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + }, + "update": { + "type": "UpdateExpression", + "start": 23, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "i" + }, + "name": "i" + } + }, + "body": { + "type": "BlockStatement", + "start": 26, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 30, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "expression": { + "type": "CallExpression", + "start": 30, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "callee": { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + }, + "arguments": [] + } + }, + { + "type": "ExpressionStatement", + "start": 36, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "expression": { + "type": "CallExpression", + "start": 36, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "callee": { + "type": "Identifier", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "y" + }, + "name": "y" + }, + "arguments": [] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/basic-if/actual.js b/test/fixtures/lightscript/whitespace/basic-if/actual.js new file mode 100644 index 0000000000..5202f55fec --- /dev/null +++ b/test/fixtures/lightscript/whitespace/basic-if/actual.js @@ -0,0 +1,3 @@ +if true: + x() + y() diff --git a/test/fixtures/lightscript/whitespace/basic-if/expected.json b/test/fixtures/lightscript/whitespace/basic-if/expected.json new file mode 100644 index 0000000000..2407b6957f --- /dev/null +++ b/test/fixtures/lightscript/whitespace/basic-if/expected.json @@ -0,0 +1,183 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 3, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": true + }, + "consequent": { + "type": "BlockStatement", + "start": 7, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "expression": { + "type": "CallExpression", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "callee": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + }, + "arguments": [] + } + }, + { + "type": "ExpressionStatement", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "expression": { + "type": "CallExpression", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "callee": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "y" + }, + "name": "y" + }, + "arguments": [] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": null + } + ], + "directives": [] + } +} diff --git a/test/fixtures/lightscript/whitespace/class-basic/actual.js b/test/fixtures/lightscript/whitespace/class-basic/actual.js new file mode 100644 index 0000000000..14131748c3 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/class-basic/actual.js @@ -0,0 +1,2 @@ +class A: + f() -> 1 diff --git a/test/fixtures/lightscript/whitespace/class-basic/expected.json b/test/fixtures/lightscript/whitespace/class-basic/expected.json new file mode 100644 index 0000000000..2cdc0e13ba --- /dev/null +++ b/test/fixtures/lightscript/whitespace/class-basic/expected.json @@ -0,0 +1,145 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "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": 7, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 11, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "f" + }, + "name": "f" + }, + "static": false, + "kind": "method", + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "NumericLiteral", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/class-extends/actual.js b/test/fixtures/lightscript/whitespace/class-extends/actual.js new file mode 100644 index 0000000000..1630faa901 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/class-extends/actual.js @@ -0,0 +1,2 @@ +class A extends B: + f() -> 1 diff --git a/test/fixtures/lightscript/whitespace/class-extends/expected.json b/test/fixtures/lightscript/whitespace/class-extends/expected.json new file mode 100644 index 0000000000..176c04ab65 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/class-extends/expected.json @@ -0,0 +1,161 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "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": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "B" + }, + "name": "B" + }, + "body": { + "type": "ClassBody", + "start": 17, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 21, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "f" + }, + "name": "f" + }, + "static": false, + "kind": "method", + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "NumericLiteral", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/class-multiple-methods/actual.js b/test/fixtures/lightscript/whitespace/class-multiple-methods/actual.js new file mode 100644 index 0000000000..c1f473bd44 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/class-multiple-methods/actual.js @@ -0,0 +1,8 @@ +class A: + f() -> + 1 + 2 + + g() -> + 3 + 4 diff --git a/test/fixtures/lightscript/whitespace/class-multiple-methods/expected.json b/test/fixtures/lightscript/whitespace/class-multiple-methods/expected.json new file mode 100644 index 0000000000..0e54d20a7a --- /dev/null +++ b/test/fixtures/lightscript/whitespace/class-multiple-methods/expected.json @@ -0,0 +1,348 @@ +{ + "type": "File", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "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": 7, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 11, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "f" + }, + "name": "f" + }, + "static": false, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 15, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "ExpressionStatement", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + }, + { + "type": "ClassMethod", + "start": 33, + "end": 51, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + }, + "identifierName": "g" + }, + "name": "g" + }, + "static": false, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 37, + "end": 51, + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 44, + "end": 45, + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 44, + "end": 45, + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + } + }, + { + "type": "ExpressionStatement", + "start": 50, + "end": 51, + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 50, + "end": 51, + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "extra": { + "rawValue": 4, + "raw": "4" + }, + "value": 4 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/class-two/actual.js b/test/fixtures/lightscript/whitespace/class-two/actual.js new file mode 100644 index 0000000000..e961a63060 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/class-two/actual.js @@ -0,0 +1,7 @@ +class A: + constructor() -> + 1 + +class B: + constructor() -> + 2 diff --git a/test/fixtures/lightscript/whitespace/class-two/expected.json b/test/fixtures/lightscript/whitespace/class-two/expected.json new file mode 100644 index 0000000000..da00aaa8ff --- /dev/null +++ b/test/fixtures/lightscript/whitespace/class-two/expected.json @@ -0,0 +1,328 @@ +{ + "type": "File", + "start": 0, + "end": 68, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 68, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "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": 7, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 11, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 11, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "static": false, + "kind": "constructor", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 25, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ] + } + }, + { + "type": "ClassDeclaration", + "start": 35, + "end": 68, + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + }, + "identifierName": "B" + }, + "name": "B" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 42, + "end": 68, + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 46, + "end": 68, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 46, + "end": 57, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 13 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "static": false, + "kind": "constructor", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "skinny": true, + "body": { + "type": "BlockStatement", + "start": 60, + "end": 68, + "loc": { + "start": { + "line": 6, + "column": 16 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 67, + "end": 68, + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 67, + "end": 68, + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/dedented-comment/actual.js b/test/fixtures/lightscript/whitespace/dedented-comment/actual.js new file mode 100644 index 0000000000..646c78069d --- /dev/null +++ b/test/fixtures/lightscript/whitespace/dedented-comment/actual.js @@ -0,0 +1,4 @@ +if true: + x() +// no dedent + y() diff --git a/test/fixtures/lightscript/whitespace/dedented-comment/expected.json b/test/fixtures/lightscript/whitespace/dedented-comment/expected.json new file mode 100644 index 0000000000..a11d053a46 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/dedented-comment/expected.json @@ -0,0 +1,240 @@ +{ + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 3, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": true + }, + "consequent": { + "type": "BlockStatement", + "start": 7, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "expression": { + "type": "CallExpression", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "callee": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + }, + "arguments": [], + "trailingComments": null + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " no dedent", + "start": 15, + "end": 27, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 12 + } + } + } + ] + }, + { + "type": "ExpressionStatement", + "start": 30, + "end": 33, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "expression": { + "type": "CallExpression", + "start": 30, + "end": 33, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "callee": { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + }, + "identifierName": "y" + }, + "name": "y", + "leadingComments": null + }, + "arguments": [], + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " no dedent", + "start": 15, + "end": 27, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 12 + } + } + } + ] + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": null + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " no dedent", + "start": 15, + "end": 27, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 12 + } + } + } + ] +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/do-while-dedented/actual.js b/test/fixtures/lightscript/whitespace/do-while-dedented/actual.js new file mode 100644 index 0000000000..dc2a4c5c49 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/do-while-dedented/actual.js @@ -0,0 +1,4 @@ +if false: + do: + x() +while false diff --git a/test/fixtures/lightscript/whitespace/do-while-dedented/options.json b/test/fixtures/lightscript/whitespace/do-while-dedented/options.json new file mode 100644 index 0000000000..b203b43baf --- /dev/null +++ b/test/fixtures/lightscript/whitespace/do-while-dedented/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Mismatched indent. (4:0)" +} diff --git a/test/fixtures/lightscript/whitespace/do-while/actual.js b/test/fixtures/lightscript/whitespace/do-while/actual.js new file mode 100644 index 0000000000..03075c7bb5 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/do-while/actual.js @@ -0,0 +1,3 @@ +do: + x() +while false diff --git a/test/fixtures/lightscript/whitespace/do-while/expected.json b/test/fixtures/lightscript/whitespace/do-while/expected.json new file mode 100644 index 0000000000..3e0dc15b94 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/do-while/expected.json @@ -0,0 +1,134 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "DoWhileStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "body": { + "type": "BlockStatement", + "start": 2, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "expression": { + "type": "CallExpression", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "callee": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + }, + "arguments": [] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "test": { + "type": "BooleanLiteral", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "value": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/for-if-nested/actual.js b/test/fixtures/lightscript/whitespace/for-if-nested/actual.js new file mode 100644 index 0000000000..e879152490 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/for-if-nested/actual.js @@ -0,0 +1,4 @@ +for i=0; i<10; i++: + if i: + x() + y() diff --git a/test/fixtures/lightscript/whitespace/for-if-nested/expected.json b/test/fixtures/lightscript/whitespace/for-if-nested/expected.json new file mode 100644 index 0000000000..78626b1245 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/for-if-nested/expected.json @@ -0,0 +1,361 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "init": { + "type": "AssignmentExpression", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "i" + }, + "name": "i" + }, + "right": { + "type": "NumericLiteral", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + "isNowAssign": false + }, + "test": { + "type": "BinaryExpression", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "left": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": "<", + "right": { + "type": "NumericLiteral", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + }, + "update": { + "type": "UpdateExpression", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "i" + }, + "name": "i" + } + }, + "body": { + "type": "BlockStatement", + "start": 18, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "IfStatement", + "start": 22, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "test": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "i" + }, + "name": "i" + }, + "consequent": { + "type": "BlockStatement", + "start": 26, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "expression": { + "type": "CallExpression", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "callee": { + "type": "Identifier", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "arguments": [] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": null + }, + { + "type": "ExpressionStatement", + "start": 38, + "end": 41, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "expression": { + "type": "CallExpression", + "start": 38, + "end": 41, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "callee": { + "type": "Identifier", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + }, + "identifierName": "y" + }, + "name": "y" + }, + "arguments": [] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/if-colon-malformed/actual.js b/test/fixtures/lightscript/whitespace/if-colon-malformed/actual.js new file mode 100644 index 0000000000..4d8ab14742 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/if-colon-malformed/actual.js @@ -0,0 +1,2 @@ +if true: +x() diff --git a/test/fixtures/lightscript/whitespace/if-colon-malformed/options.json b/test/fixtures/lightscript/whitespace/if-colon-malformed/options.json new file mode 100644 index 0000000000..35c3dcf432 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/if-colon-malformed/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Expected an Indent or Statement (1:7)" +} diff --git a/test/fixtures/lightscript/whitespace/jsx-expression-bad-indent/actual.js b/test/fixtures/lightscript/whitespace/jsx-expression-bad-indent/actual.js new file mode 100644 index 0000000000..2b426e2bf0 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/jsx-expression-bad-indent/actual.js @@ -0,0 +1,5 @@ +
+
+
+ {1} +
diff --git a/test/fixtures/lightscript/whitespace/jsx-expression-bad-indent/expected.json b/test/fixtures/lightscript/whitespace/jsx-expression-bad-indent/expected.json new file mode 100644 index 0000000000..cc54d87bd5 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/jsx-expression-bad-indent/expected.json @@ -0,0 +1,314 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 6 + } + }, + "expression": { + "type": "JSXElement", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 6 + } + }, + "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": 28, + "end": 34, + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 6 + } + }, + "name": { + "type": "JSXIdentifier", + "start": 30, + "end": 33, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "name": "div" + } + }, + "children": [ + { + "type": "JSXText", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "extra": null, + "value": "\n " + }, + { + "type": "JSXElement", + "start": 8, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "openingElement": { + "type": "JSXOpeningElement", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "name": "div" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 15, + "end": 21, + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "name": { + "type": "JSXIdentifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "name": "div" + } + }, + "children": [ + { + "type": "JSXText", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "extra": null, + "value": "\n " + } + ] + }, + { + "type": "JSXText", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 4, + "column": 2 + } + }, + "extra": null, + "value": "\n " + }, + { + "type": "JSXExpressionContainer", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 4, + "column": 3 + }, + "end": { + "line": 4, + "column": 4 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "JSXText", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 5, + "column": 0 + } + }, + "extra": null, + "value": "\n" + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/jsx-expression-indents/actual.js b/test/fixtures/lightscript/whitespace/jsx-expression-indents/actual.js new file mode 100644 index 0000000000..0db7e0b565 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/jsx-expression-indents/actual.js @@ -0,0 +1,5 @@ +
    + {[for const thing of things: + + ]} +
diff --git a/test/fixtures/lightscript/whitespace/jsx-expression-indents/expected.json b/test/fixtures/lightscript/whitespace/jsx-expression-indents/expected.json new file mode 100644 index 0000000000..d27a371da1 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/jsx-expression-indents/expected.json @@ -0,0 +1,363 @@ +{ + "type": "File", + "start": 0, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "expression": { + "type": "JSXElement", + "start": 0, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "ul" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 64, + "end": 69, + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "name": { + "type": "JSXIdentifier", + "start": 66, + "end": 68, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 4 + } + }, + "name": "ul" + } + }, + "children": [ + { + "type": "JSXText", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "extra": null, + "value": "\n " + }, + { + "type": "JSXExpressionContainer", + "start": 7, + "end": 63, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 4 + } + }, + "expression": { + "type": "ArrayComprehension", + "start": 8, + "end": 62, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "loop": { + "type": "ForOfStatement", + "start": 9, + "end": 58, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 3, + "column": 22 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 13, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 19, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 19, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 19 + }, + "identifierName": "thing" + }, + "name": "thing" + }, + "init": null + } + ], + "kind": "const" + }, + "right": { + "type": "Identifier", + "start": 28, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 29 + }, + "identifierName": "things" + }, + "name": "things" + }, + "body": { + "type": "BlockStatement", + "start": 34, + "end": 58, + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 3, + "column": 22 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 42, + "end": 58, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 22 + } + }, + "expression": { + "type": "JSXElement", + "start": 42, + "end": 58, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 22 + } + }, + "openingElement": { + "type": "JSXOpeningElement", + "start": 42, + "end": 58, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 22 + } + }, + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 43, + "end": 55, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 19 + } + }, + "name": "SpecialThing" + }, + "selfClosing": true + }, + "closingElement": null, + "children": [] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + } + }, + { + "type": "JSXText", + "start": 63, + "end": 64, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 5, + "column": 0 + } + }, + "extra": null, + "value": "\n" + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/malformed-oneline-dup/actual.js b/test/fixtures/lightscript/whitespace/malformed-oneline-dup/actual.js new file mode 100644 index 0000000000..9e1a20449d --- /dev/null +++ b/test/fixtures/lightscript/whitespace/malformed-oneline-dup/actual.js @@ -0,0 +1,2 @@ +if x: x() y() + diff --git a/test/fixtures/lightscript/whitespace/malformed-oneline-dup/options.json b/test/fixtures/lightscript/whitespace/malformed-oneline-dup/options.json new file mode 100644 index 0000000000..31a5910973 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/malformed-oneline-dup/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected ; (1:10)" +} diff --git a/test/fixtures/lightscript/whitespace/nested-if-mixed-syntax/actual.js b/test/fixtures/lightscript/whitespace/nested-if-mixed-syntax/actual.js new file mode 100644 index 0000000000..519561e39e --- /dev/null +++ b/test/fixtures/lightscript/whitespace/nested-if-mixed-syntax/actual.js @@ -0,0 +1,9 @@ +if (a) { +b +if c: + d +elif e: + f +} else { + g +} diff --git a/test/fixtures/lightscript/whitespace/nested-if-mixed-syntax/expected.json b/test/fixtures/lightscript/whitespace/nested-if-mixed-syntax/expected.json new file mode 100644 index 0000000000..630550274a --- /dev/null +++ b/test/fixtures/lightscript/whitespace/nested-if-mixed-syntax/expected.json @@ -0,0 +1,344 @@ +{ + "type": "File", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "test": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a", + "extra": {} + }, + "consequent": { + "type": "BlockStatement", + "start": 7, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "expression": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + }, + "identifierName": "b" + }, + "name": "b" + } + }, + { + "type": "IfStatement", + "start": 11, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "test": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 4 + }, + "identifierName": "c" + }, + "name": "c" + }, + "consequent": { + "type": "BlockStatement", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "expression": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + }, + "identifierName": "d" + }, + "name": "d" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": { + "type": "IfStatement", + "start": 21, + "end": 32, + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "test": { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 6 + }, + "identifierName": "e" + }, + "name": "e" + }, + "consequent": { + "type": "BlockStatement", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "expression": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + }, + "identifierName": "f" + }, + "name": "f" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": null + } + } + ], + "directives": [], + "extra": { + "curly": true + } + }, + "alternate": { + "type": "BlockStatement", + "start": 40, + "end": 47, + "loc": { + "start": { + "line": 7, + "column": 7 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 44, + "end": 45, + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 3 + } + }, + "expression": { + "type": "Identifier", + "start": 44, + "end": 45, + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 3 + }, + "identifierName": "g" + }, + "name": "g" + } + } + ], + "directives": [], + "extra": { + "curly": true + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/nested-if-oneline/actual.js b/test/fixtures/lightscript/whitespace/nested-if-oneline/actual.js new file mode 100644 index 0000000000..bfa22a84dd --- /dev/null +++ b/test/fixtures/lightscript/whitespace/nested-if-oneline/actual.js @@ -0,0 +1,3 @@ +if x: + if y: y() + x() diff --git a/test/fixtures/lightscript/whitespace/nested-if-oneline/expected.json b/test/fixtures/lightscript/whitespace/nested-if-oneline/expected.json new file mode 100644 index 0000000000..8bedbaf529 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/nested-if-oneline/expected.json @@ -0,0 +1,217 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "test": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + "consequent": { + "type": "BlockStatement", + "start": 4, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "body": [ + { + "type": "IfStatement", + "start": 8, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "test": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "y" + }, + "name": "y" + }, + "consequent": { + "type": "ExpressionStatement", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "expression": { + "type": "CallExpression", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "callee": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "y" + }, + "name": "y" + }, + "arguments": [] + } + }, + "alternate": null + }, + { + "type": "ExpressionStatement", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "expression": { + "type": "CallExpression", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "callee": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + }, + "arguments": [] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/nested-if-then-elif-expr/actual.js b/test/fixtures/lightscript/whitespace/nested-if-then-elif-expr/actual.js new file mode 100644 index 0000000000..b53e8cc5ef --- /dev/null +++ b/test/fixtures/lightscript/whitespace/nested-if-then-elif-expr/actual.js @@ -0,0 +1,5 @@ +x = if a: + if b: c + elif d: e +else: + f diff --git a/test/fixtures/lightscript/whitespace/nested-if-then-elif-expr/expected.json b/test/fixtures/lightscript/whitespace/nested-if-then-elif-expr/expected.json new file mode 100644 index 0000000000..c84d52480d --- /dev/null +++ b/test/fixtures/lightscript/whitespace/nested-if-then-elif-expr/expected.json @@ -0,0 +1,322 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "IfExpression", + "start": 4, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "test": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "a" + }, + "name": "a" + }, + "consequent": { + "type": "BlockStatement", + "start": 8, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "body": [ + { + "type": "IfStatement", + "start": 12, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "test": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "b" + }, + "name": "b" + }, + "consequent": { + "type": "ExpressionStatement", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "expression": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "c" + }, + "name": "c" + } + }, + "alternate": { + "type": "IfStatement", + "start": 22, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "test": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 8 + }, + "identifierName": "d" + }, + "name": "d" + }, + "consequent": { + "type": "ExpressionStatement", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "expression": { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + }, + "identifierName": "e" + }, + "name": "e" + } + }, + "alternate": null + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": { + "type": "BlockStatement", + "start": 36, + "end": 41, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "expression": { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + }, + "identifierName": "f" + }, + "name": "f" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/nested-if-then-elif-mixed/actual.js b/test/fixtures/lightscript/whitespace/nested-if-then-elif-mixed/actual.js new file mode 100644 index 0000000000..48a441d463 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/nested-if-then-elif-mixed/actual.js @@ -0,0 +1,6 @@ +x = if a: + if (b) { + c + } +else: + d diff --git a/test/fixtures/lightscript/whitespace/nested-if-then-elif-mixed/expected.json b/test/fixtures/lightscript/whitespace/nested-if-then-elif-mixed/expected.json new file mode 100644 index 0000000000..7f6110493b --- /dev/null +++ b/test/fixtures/lightscript/whitespace/nested-if-then-elif-mixed/expected.json @@ -0,0 +1,280 @@ +{ + "type": "File", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "IfExpression", + "start": 4, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "test": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "a" + }, + "name": "a" + }, + "consequent": { + "type": "BlockStatement", + "start": 8, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "body": [ + { + "type": "IfStatement", + "start": 12, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "test": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "b" + }, + "name": "b", + "extra": {} + }, + "consequent": { + "type": "BlockStatement", + "start": 19, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "c" + }, + "name": "c" + } + } + ], + "directives": [], + "extra": { + "curly": true + } + }, + "alternate": null + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": { + "type": "BlockStatement", + "start": 35, + "end": 40, + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "expression": { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + }, + "identifierName": "d" + }, + "name": "d" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/nested-if-then-elif/actual.js b/test/fixtures/lightscript/whitespace/nested-if-then-elif/actual.js new file mode 100644 index 0000000000..54cce4dd7b --- /dev/null +++ b/test/fixtures/lightscript/whitespace/nested-if-then-elif/actual.js @@ -0,0 +1,6 @@ +q = + if x: + if y: + y(x) + elif z: + z() diff --git a/test/fixtures/lightscript/whitespace/nested-if-then-elif/expected.json b/test/fixtures/lightscript/whitespace/nested-if-then-elif/expected.json new file mode 100644 index 0000000000..bbb18de63a --- /dev/null +++ b/test/fixtures/lightscript/whitespace/nested-if-then-elif/expected.json @@ -0,0 +1,362 @@ +{ + "type": "File", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "q" + }, + "name": "q" + }, + "init": { + "type": "IfExpression", + "start": 6, + "end": 50, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "test": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "x" + }, + "name": "x" + }, + "consequent": { + "type": "BlockStatement", + "start": 10, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "body": [ + { + "type": "IfStatement", + "start": 16, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "test": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 8 + }, + "identifierName": "y" + }, + "name": "y" + }, + "consequent": { + "type": "BlockStatement", + "start": 20, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 28, + "end": 32, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "expression": { + "type": "CallExpression", + "start": 28, + "end": 32, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "callee": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + }, + "identifierName": "y" + }, + "name": "y" + }, + "arguments": [ + { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + }, + "identifierName": "x" + }, + "name": "x" + } + ] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": null + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": { + "type": "IfExpression", + "start": 35, + "end": 50, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "test": { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 5, + "column": 8 + }, + "identifierName": "z" + }, + "name": "z" + }, + "consequent": { + "type": "BlockStatement", + "start": 41, + "end": 50, + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 47, + "end": 50, + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "expression": { + "type": "CallExpression", + "start": 47, + "end": 50, + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "callee": { + "type": "Identifier", + "start": 47, + "end": 48, + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + }, + "identifierName": "z" + }, + "name": "z" + }, + "arguments": [] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": null + } + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/nested-if-then-else-expr/actual.js b/test/fixtures/lightscript/whitespace/nested-if-then-else-expr/actual.js new file mode 100644 index 0000000000..4ad3765a68 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/nested-if-then-else-expr/actual.js @@ -0,0 +1,4 @@ +x = if a: + if b: c +else: + d diff --git a/test/fixtures/lightscript/whitespace/nested-if-then-else-expr/expected.json b/test/fixtures/lightscript/whitespace/nested-if-then-else-expr/expected.json new file mode 100644 index 0000000000..45538a4060 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/nested-if-then-else-expr/expected.json @@ -0,0 +1,258 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "IfExpression", + "start": 4, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "test": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "a" + }, + "name": "a" + }, + "consequent": { + "type": "BlockStatement", + "start": 8, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "body": [ + { + "type": "IfStatement", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "test": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "b" + }, + "name": "b" + }, + "consequent": { + "type": "ExpressionStatement", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "expression": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "c" + }, + "name": "c" + } + }, + "alternate": null + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": { + "type": "BlockStatement", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "expression": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + }, + "identifierName": "d" + }, + "name": "d" + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/nested-if-then-else/actual.js b/test/fixtures/lightscript/whitespace/nested-if-then-else/actual.js new file mode 100644 index 0000000000..ed02157d01 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/nested-if-then-else/actual.js @@ -0,0 +1,5 @@ +if x: + if y: + y(x) +else: + z() diff --git a/test/fixtures/lightscript/whitespace/nested-if-then-else/expected.json b/test/fixtures/lightscript/whitespace/nested-if-then-else/expected.json new file mode 100644 index 0000000000..91e33753a6 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/nested-if-then-else/expected.json @@ -0,0 +1,276 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "test": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + "consequent": { + "type": "BlockStatement", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "body": [ + { + "type": "IfStatement", + "start": 8, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "test": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "y" + }, + "name": "y" + }, + "consequent": { + "type": "BlockStatement", + "start": 12, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "expression": { + "type": "CallExpression", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "callee": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + }, + "arguments": [ + { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + }, + "identifierName": "x" + }, + "name": "x" + } + ] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": null + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": { + "type": "BlockStatement", + "start": 27, + "end": 34, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 31, + "end": 34, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "expression": { + "type": "CallExpression", + "start": 31, + "end": 34, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "callee": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + }, + "identifierName": "z" + }, + "name": "z" + }, + "arguments": [] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/nested-if/actual.js b/test/fixtures/lightscript/whitespace/nested-if/actual.js new file mode 100644 index 0000000000..7679877d38 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/nested-if/actual.js @@ -0,0 +1,4 @@ +if x: + if y: + y() + x() diff --git a/test/fixtures/lightscript/whitespace/nested-if/expected.json b/test/fixtures/lightscript/whitespace/nested-if/expected.json new file mode 100644 index 0000000000..c2365da04a --- /dev/null +++ b/test/fixtures/lightscript/whitespace/nested-if/expected.json @@ -0,0 +1,238 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "test": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + "consequent": { + "type": "BlockStatement", + "start": 4, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "IfStatement", + "start": 8, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "test": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "y" + }, + "name": "y" + }, + "consequent": { + "type": "BlockStatement", + "start": 12, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "expression": { + "type": "CallExpression", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "callee": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "y" + }, + "name": "y" + }, + "arguments": [] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": null + }, + { + "type": "ExpressionStatement", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "expression": { + "type": "CallExpression", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "callee": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + }, + "arguments": [] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/overindent-first-line/actual.js b/test/fixtures/lightscript/whitespace/overindent-first-line/actual.js new file mode 100644 index 0000000000..3aa41b9d91 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/overindent-first-line/actual.js @@ -0,0 +1,4 @@ + if true: + 1 + else: + 2 diff --git a/test/fixtures/lightscript/whitespace/overindent-first-line/expected.json b/test/fixtures/lightscript/whitespace/overindent-first-line/expected.json new file mode 100644 index 0000000000..0d6caabbdf --- /dev/null +++ b/test/fixtures/lightscript/whitespace/overindent-first-line/expected.json @@ -0,0 +1,177 @@ +{ + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 2, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 5, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "value": true + }, + "consequent": { + "type": "BlockStatement", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "alternate": { + "type": "BlockStatement", + "start": 23, + "end": 30, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/try-catch-brace-then-colon/actual.js b/test/fixtures/lightscript/whitespace/try-catch-brace-then-colon/actual.js new file mode 100644 index 0000000000..1fc0c583a0 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-catch-brace-then-colon/actual.js @@ -0,0 +1,4 @@ +try { + 1 +} catch err: + 2 diff --git a/test/fixtures/lightscript/whitespace/try-catch-brace-then-colon/options.json b/test/fixtures/lightscript/whitespace/try-catch-brace-then-colon/options.json new file mode 100644 index 0000000000..2421391133 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-catch-brace-then-colon/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected { (3:11)" +} diff --git a/test/fixtures/lightscript/whitespace/try-catch-colon-then-brace/actual.js b/test/fixtures/lightscript/whitespace/try-catch-colon-then-brace/actual.js new file mode 100644 index 0000000000..29655d868a --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-catch-colon-then-brace/actual.js @@ -0,0 +1,5 @@ +try: + 1 +catch (err) { + 2 +} diff --git a/test/fixtures/lightscript/whitespace/try-catch-colon-then-brace/options.json b/test/fixtures/lightscript/whitespace/try-catch-colon-then-brace/options.json new file mode 100644 index 0000000000..9c2308cfb2 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-catch-colon-then-brace/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected : (3:12)" +} diff --git a/test/fixtures/lightscript/whitespace/try-catch-curly-diff-indents/actual.js b/test/fixtures/lightscript/whitespace/try-catch-curly-diff-indents/actual.js new file mode 100644 index 0000000000..8e20a9afcf --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-catch-curly-diff-indents/actual.js @@ -0,0 +1,9 @@ + try { + 1 + } +catch err { + 2 +} + finally { + 3 + } diff --git a/test/fixtures/lightscript/whitespace/try-catch-curly-diff-indents/expected.json b/test/fixtures/lightscript/whitespace/try-catch-curly-diff-indents/expected.json new file mode 100644 index 0000000000..7012efb1f7 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-catch-curly-diff-indents/expected.json @@ -0,0 +1,250 @@ +{ + "type": "File", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 9, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 9, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 2, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 9, + "column": 5 + } + }, + "block": { + "type": "BlockStatement", + "start": 6, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "directives": [], + "extra": { + "curly": true + } + }, + "handler": { + "type": "CatchClause", + "start": 18, + "end": 35, + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "param": { + "type": "Identifier", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 9 + }, + "identifierName": "err" + }, + "name": "err" + }, + "body": { + "type": "BlockStatement", + "start": 28, + "end": 35, + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "directives": [], + "extra": { + "curly": true + } + } + }, + "guardedHandlers": [], + "finalizer": { + "type": "BlockStatement", + "start": 48, + "end": 63, + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 9, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 56, + "end": 57, + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 56, + "end": 57, + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + } + } + ], + "directives": [], + "extra": { + "curly": true + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/try-catch-dedent/actual.js b/test/fixtures/lightscript/whitespace/try-catch-dedent/actual.js new file mode 100644 index 0000000000..f698279bac --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-catch-dedent/actual.js @@ -0,0 +1,4 @@ + try: + 1 +catch err: + 2 diff --git a/test/fixtures/lightscript/whitespace/try-catch-dedent/options.json b/test/fixtures/lightscript/whitespace/try-catch-dedent/options.json new file mode 100644 index 0000000000..d141c19616 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-catch-dedent/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Missing catch or finally clause (1:2)" +} diff --git a/test/fixtures/lightscript/whitespace/try-catch-finally-dedent/actual.js b/test/fixtures/lightscript/whitespace/try-catch-finally-dedent/actual.js new file mode 100644 index 0000000000..5d3687357f --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-catch-finally-dedent/actual.js @@ -0,0 +1,6 @@ + try: + 1 + catch err: + 2 +finally: + 3 diff --git a/test/fixtures/lightscript/whitespace/try-catch-finally-dedent/options.json b/test/fixtures/lightscript/whitespace/try-catch-finally-dedent/options.json new file mode 100644 index 0000000000..ca47c17f5a --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-catch-finally-dedent/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (5:0)" +} diff --git a/test/fixtures/lightscript/whitespace/try-catch-finally/actual.js b/test/fixtures/lightscript/whitespace/try-catch-finally/actual.js new file mode 100644 index 0000000000..0bf3ddc280 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-catch-finally/actual.js @@ -0,0 +1,6 @@ +try: + 1 +catch err: + 2 +finally: + 3 diff --git a/test/fixtures/lightscript/whitespace/try-catch-finally/expected.json b/test/fixtures/lightscript/whitespace/try-catch-finally/expected.json new file mode 100644 index 0000000000..d01725737e --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-catch-finally/expected.json @@ -0,0 +1,250 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "block": { + "type": "BlockStatement", + "start": 3, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "handler": { + "type": "CatchClause", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "param": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 9 + }, + "identifierName": "err" + }, + "name": "err" + }, + "body": { + "type": "BlockStatement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + }, + "guardedHandlers": [], + "finalizer": { + "type": "BlockStatement", + "start": 31, + "end": 36, + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/try-catch-nested-mixed-2/actual.js b/test/fixtures/lightscript/whitespace/try-catch-nested-mixed-2/actual.js new file mode 100644 index 0000000000..3386daffdb --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-catch-nested-mixed-2/actual.js @@ -0,0 +1,9 @@ +try: + try { + 1 + } catch e { + 2 + } +finally { + 3 +} diff --git a/test/fixtures/lightscript/whitespace/try-catch-nested-mixed-2/options.json b/test/fixtures/lightscript/whitespace/try-catch-nested-mixed-2/options.json new file mode 100644 index 0000000000..daf899c4c9 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-catch-nested-mixed-2/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected : (7:8)" +} diff --git a/test/fixtures/lightscript/whitespace/try-catch-nested-mixed/actual.js b/test/fixtures/lightscript/whitespace/try-catch-nested-mixed/actual.js new file mode 100644 index 0000000000..25b31a18ab --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-catch-nested-mixed/actual.js @@ -0,0 +1,8 @@ +try: + try { + 1 + } catch e { + 2 + } +finally: + 3 diff --git a/test/fixtures/lightscript/whitespace/try-catch-nested-mixed/expected.json b/test/fixtures/lightscript/whitespace/try-catch-nested-mixed/expected.json new file mode 100644 index 0000000000..5694638cea --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-catch-nested-mixed/expected.json @@ -0,0 +1,288 @@ +{ + "type": "File", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 3 + } + }, + "block": { + "type": "BlockStatement", + "start": 3, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "body": [ + { + "type": "TryStatement", + "start": 7, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "block": { + "type": "BlockStatement", + "start": 11, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "directives": [], + "extra": { + "curly": true + } + }, + "handler": { + "type": "CatchClause", + "start": 23, + "end": 42, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "param": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 4, + "column": 11 + }, + "identifierName": "e" + }, + "name": "e" + }, + "body": { + "type": "BlockStatement", + "start": 31, + "end": 42, + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "directives": [], + "extra": { + "curly": true + } + } + }, + "guardedHandlers": [] + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "handler": null, + "guardedHandlers": [], + "finalizer": { + "type": "BlockStatement", + "start": 50, + "end": 55, + "loc": { + "start": { + "line": 7, + "column": 7 + }, + "end": { + "line": 8, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 54, + "end": 55, + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 54, + "end": 55, + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 3 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/try-catch-nested-no-catch-2/actual.js b/test/fixtures/lightscript/whitespace/try-catch-nested-no-catch-2/actual.js new file mode 100644 index 0000000000..8de2b44945 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-catch-nested-no-catch-2/actual.js @@ -0,0 +1,9 @@ +try: + try { + 1 + } +catch err { + 2 +} +finally: + 3 diff --git a/test/fixtures/lightscript/whitespace/try-catch-nested-no-catch-2/options.json b/test/fixtures/lightscript/whitespace/try-catch-nested-no-catch-2/options.json new file mode 100644 index 0000000000..bc22fedcc4 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-catch-nested-no-catch-2/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Missing catch or finally clause (2:2)" +} diff --git a/test/fixtures/lightscript/whitespace/try-catch-nested-no-catch/actual.js b/test/fixtures/lightscript/whitespace/try-catch-nested-no-catch/actual.js new file mode 100644 index 0000000000..71ffc7eeb1 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-catch-nested-no-catch/actual.js @@ -0,0 +1,8 @@ +try: + try { + 1 + } +catch err: + 2 +finally: + 3 diff --git a/test/fixtures/lightscript/whitespace/try-catch-nested-no-catch/options.json b/test/fixtures/lightscript/whitespace/try-catch-nested-no-catch/options.json new file mode 100644 index 0000000000..bc22fedcc4 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-catch-nested-no-catch/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Missing catch or finally clause (2:2)" +} diff --git a/test/fixtures/lightscript/whitespace/try-catch-nested/actual.js b/test/fixtures/lightscript/whitespace/try-catch-nested/actual.js new file mode 100644 index 0000000000..d0d81bb9b1 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-catch-nested/actual.js @@ -0,0 +1,7 @@ +try: + try: + a() + catch e: + b() +finally: + c() diff --git a/test/fixtures/lightscript/whitespace/try-catch-nested/expected.json b/test/fixtures/lightscript/whitespace/try-catch-nested/expected.json new file mode 100644 index 0000000000..a9abefcb0a --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-catch-nested/expected.json @@ -0,0 +1,328 @@ +{ + "type": "File", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "block": { + "type": "BlockStatement", + "start": 3, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "body": [ + { + "type": "TryStatement", + "start": 7, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "block": { + "type": "BlockStatement", + "start": 10, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "expression": { + "type": "CallExpression", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "callee": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "arguments": [] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "handler": { + "type": "CatchClause", + "start": 22, + "end": 38, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "param": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + }, + "identifierName": "e" + }, + "name": "e" + }, + "body": { + "type": "BlockStatement", + "start": 29, + "end": 38, + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 35, + "end": 38, + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "expression": { + "type": "CallExpression", + "start": 35, + "end": 38, + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "callee": { + "type": "Identifier", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + }, + "arguments": [] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + }, + "guardedHandlers": [], + "finalizer": null + } + ], + "directives": [], + "extra": { + "curly": false + } + }, + "handler": null, + "guardedHandlers": [], + "finalizer": { + "type": "BlockStatement", + "start": 46, + "end": 53, + "loc": { + "start": { + "line": 6, + "column": 7 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 50, + "end": 53, + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "expression": { + "type": "CallExpression", + "start": 50, + "end": 53, + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "callee": { + "type": "Identifier", + "start": 50, + "end": 51, + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + }, + "identifierName": "c" + }, + "name": "c" + }, + "arguments": [] + } + } + ], + "directives": [], + "extra": { + "curly": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/try-finally-brace-then-colon/actual.js b/test/fixtures/lightscript/whitespace/try-finally-brace-then-colon/actual.js new file mode 100644 index 0000000000..bb73ed72b2 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-finally-brace-then-colon/actual.js @@ -0,0 +1,4 @@ +try { + 1 +} finally: + 2 diff --git a/test/fixtures/lightscript/whitespace/try-finally-brace-then-colon/options.json b/test/fixtures/lightscript/whitespace/try-finally-brace-then-colon/options.json new file mode 100644 index 0000000000..c8bccb764b --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-finally-brace-then-colon/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected { (3:9)" +} diff --git a/test/fixtures/lightscript/whitespace/try-finally-colon-then-brace/actual.js b/test/fixtures/lightscript/whitespace/try-finally-colon-then-brace/actual.js new file mode 100644 index 0000000000..ac33b26d97 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-finally-colon-then-brace/actual.js @@ -0,0 +1,5 @@ +try: + 1 +finally { + 2 +} diff --git a/test/fixtures/lightscript/whitespace/try-finally-colon-then-brace/options.json b/test/fixtures/lightscript/whitespace/try-finally-colon-then-brace/options.json new file mode 100644 index 0000000000..8b108e2695 --- /dev/null +++ b/test/fixtures/lightscript/whitespace/try-finally-colon-then-brace/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected : (3:8)" +} 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 deleted file mode 100644 index e0d33212c9..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-empty-with-array/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index e52b51e72f..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-empty-with-array/expected.json +++ /dev/null @@ -1,136 +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": 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 deleted file mode 100644 index 2c899c5287..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-empty-with-leading/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 6e97288c68..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-empty-with-leading/expected.json +++ /dev/null @@ -1,136 +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": 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 deleted file mode 100644 index 454e0efeba..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-empty-with-object/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index fae5451a85..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-empty-with-object/expected.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "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 deleted file mode 100644 index 1c8813cc96..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-empty-with-rest/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 619f048343..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-empty-with-rest/expected.json +++ /dev/null @@ -1,151 +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": "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 deleted file mode 100644 index 3ce6694764..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-empty/actual.js +++ /dev/null @@ -1 +0,0 @@ -function empty(...[]) {} diff --git a/test/fixtures/test262/rest-parameter/array-pattern-empty/expected.json b/test/fixtures/test262/rest-parameter/array-pattern-empty/expected.json deleted file mode 100644 index 8fce044f0d..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-empty/expected.json +++ /dev/null @@ -1,119 +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": "FunctionDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "id": { - "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "empty" - }, - "name": "empty" - }, - "generator": false, - "expression": false, - "async": false, - "params": [ - { - "type": "RestElement", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "argument": { - "type": "ArrayPattern", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "elements": [] - } - } - ], - "body": { - "type": "BlockStatement", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "body": [], - "directives": [] - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-array/actual.js b/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-array/actual.js deleted file mode 100644 index 1b3f8e088c..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-array/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 365a587997..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-array/expected.json +++ /dev/null @@ -1,205 +0,0 @@ -{ - "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 deleted file mode 100644 index f27dd5f157..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-initializer/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 31e27ace56..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-initializer/expected.json +++ /dev/null @@ -1,241 +0,0 @@ -{ - "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 deleted file mode 100644 index b83b4bfe5c..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-leading/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index d2f274ab0a..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-leading/expected.json +++ /dev/null @@ -1,205 +0,0 @@ -{ - "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 deleted file mode 100644 index e391769f7c..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-object/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 1159886da3..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-object/expected.json +++ /dev/null @@ -1,368 +0,0 @@ -{ - "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 deleted file mode 100644 index b7700bbabe..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-rest/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index a37e75f801..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-rest/expected.json +++ /dev/null @@ -1,186 +0,0 @@ -{ - "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 deleted file mode 100644 index 2b5c439f44..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-multi-element/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 86cdf203a2..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-multi-element/expected.json +++ /dev/null @@ -1,171 +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": 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 deleted file mode 100644 index 5a02b39faf..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-array/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 7184320ff8..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-array/expected.json +++ /dev/null @@ -1,154 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, - "sourceType": "script", - "body": [ - { - "type": "FunctionDeclaration", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, - "id": { - "type": "Identifier", - "start": 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 deleted file mode 100644 index 4785727f45..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-initializer/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 300640612a..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-initializer/expected.json +++ /dev/null @@ -1,172 +0,0 @@ -{ - "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 deleted file mode 100644 index 00bbf0a1cb..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-leading/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 616bb91824..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-leading/expected.json +++ /dev/null @@ -1,154 +0,0 @@ -{ - "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 deleted file mode 100644 index 257baf6299..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-object/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2731def325..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-object/expected.json +++ /dev/null @@ -1,189 +0,0 @@ -{ - "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 deleted file mode 100644 index fde87d8d10..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-rest/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index faed59b185..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-rest/expected.json +++ /dev/null @@ -1,152 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, - "sourceType": "script", - "body": [ - { - "type": "FunctionDeclaration", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, - "id": { - "type": "Identifier", - "start": 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 deleted file mode 100644 index 945b43540d..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-single-element/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 0416e8d857..0000000000 --- a/test/fixtures/test262/rest-parameter/array-pattern-single-element/expected.json +++ /dev/null @@ -1,137 +0,0 @@ -{ - "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 deleted file mode 100644 index 93ea893190..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-empty-with-array/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index ce6d9fc36e..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-empty-with-array/expected.json +++ /dev/null @@ -1,171 +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": 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 deleted file mode 100644 index 0c8ec3596d..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-empty-with-leading/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 76ca5482f5..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-empty-with-leading/expected.json +++ /dev/null @@ -1,136 +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": 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 deleted file mode 100644 index 570a845e40..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-empty-with-object/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 732c68014c..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-empty-with-object/expected.json +++ /dev/null @@ -1,171 +0,0 @@ -{ - "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 deleted file mode 100644 index 35208e46a1..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-empty/actual.js +++ /dev/null @@ -1 +0,0 @@ -function empty(...{}) {} diff --git a/test/fixtures/test262/rest-parameter/object-pattern-empty/expected.json b/test/fixtures/test262/rest-parameter/object-pattern-empty/expected.json deleted file mode 100644 index 38447d9767..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-empty/expected.json +++ /dev/null @@ -1,119 +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": "FunctionDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "id": { - "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "empty" - }, - "name": "empty" - }, - "generator": false, - "expression": false, - "async": false, - "params": [ - { - "type": "RestElement", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "argument": { - "type": "ObjectPattern", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "properties": [] - } - } - ], - "body": { - "type": "BlockStatement", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "body": [], - "directives": [] - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-array/actual.js b/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-array/actual.js deleted file mode 100644 index 75b66ae975..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-array/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index b455a94709..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-array/expected.json +++ /dev/null @@ -1,313 +0,0 @@ -{ - "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 deleted file mode 100644 index 55fdf3b9be..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-initializer/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index f497d59bd3..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-initializer/expected.json +++ /dev/null @@ -1,346 +0,0 @@ -{ - "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 deleted file mode 100644 index 052c2356d3..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-leading/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 52d43f0153..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-leading/expected.json +++ /dev/null @@ -1,310 +0,0 @@ -{ - "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 deleted file mode 100644 index cae2002644..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-object/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 6c5d7cf14f..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-object/expected.json +++ /dev/null @@ -1,473 +0,0 @@ -{ - "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 deleted file mode 100644 index 2ea72fd00c..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-multi-element/actual.js +++ /dev/null @@ -1 +0,0 @@ -function multiElement(...{a: r, b: s, c: t}) {} diff --git a/test/fixtures/test262/rest-parameter/object-pattern-multi-element/expected.json b/test/fixtures/test262/rest-parameter/object-pattern-multi-element/expected.json deleted file mode 100644 index b95a4b6234..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-multi-element/expected.json +++ /dev/null @@ -1,276 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, - "sourceType": "script", - "body": [ - { - "type": "FunctionDeclaration", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, - "id": { - "type": "Identifier", - "start": 9, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "multiElement" - }, - "name": "multiElement" - }, - "generator": false, - "expression": false, - "async": false, - "params": [ - { - "type": "RestElement", - "start": 22, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 43 - } - }, - "argument": { - "type": "ObjectPattern", - "start": 25, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 43 - } - }, - "properties": [ - { - "type": "ObjectProperty", - "start": 26, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 30 - } - }, - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "a" - }, - "name": "a" - }, - "value": { - "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "r" - }, - "name": "r" - } - }, - { - "type": "ObjectProperty", - "start": 32, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 36 - } - }, - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "b" - }, - "name": "b" - }, - "value": { - "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "s" - }, - "name": "s" - } - }, - { - "type": "ObjectProperty", - "start": 38, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 42 - } - }, - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "c" - }, - "name": "c" - }, - "value": { - "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 42 - }, - "identifierName": "t" - }, - "name": "t" - } - } - ] - } - } - ], - "body": { - "type": "BlockStatement", - "start": 45, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 47 - } - }, - "body": [], - "directives": [] - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-array/actual.js b/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-array/actual.js deleted file mode 100644 index d448d7a728..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-array/actual.js +++ /dev/null @@ -1 +0,0 @@ -function singleElementWithArray(...{p: [a]}) {} diff --git a/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-array/expected.json b/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-array/expected.json deleted file mode 100644 index e9c4c2859a..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-array/expected.json +++ /dev/null @@ -1,189 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, - "sourceType": "script", - "body": [ - { - "type": "FunctionDeclaration", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, - "id": { - "type": "Identifier", - "start": 9, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "singleElementWithArray" - }, - "name": "singleElementWithArray" - }, - "generator": false, - "expression": false, - "async": false, - "params": [ - { - "type": "RestElement", - "start": 32, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 43 - } - }, - "argument": { - "type": "ObjectPattern", - "start": 35, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 43 - } - }, - "properties": [ - { - "type": "ObjectProperty", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 42 - } - }, - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "p" - }, - "name": "p" - }, - "value": { - "type": "ArrayPattern", - "start": 39, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 42 - } - }, - "elements": [ - { - "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "a" - }, - "name": "a" - } - ] - } - } - ] - } - } - ], - "body": { - "type": "BlockStatement", - "start": 45, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 47 - } - }, - "body": [], - "directives": [] - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-initializer/actual.js b/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-initializer/actual.js deleted file mode 100644 index 3417d7e1ee..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-initializer/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 9faf97f761..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-initializer/expected.json +++ /dev/null @@ -1,207 +0,0 @@ -{ - "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 deleted file mode 100644 index d69e8e13a4..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-leading/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index dc7c07c735..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-leading/expected.json +++ /dev/null @@ -1,189 +0,0 @@ -{ - "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 deleted file mode 100644 index a7de007cfc..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-object/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 35be5a85ee..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-object/expected.json +++ /dev/null @@ -1,224 +0,0 @@ -{ - "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 deleted file mode 100644 index aea7348b65..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-single-element/actual.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index f7e75584e0..0000000000 --- a/test/fixtures/test262/rest-parameter/object-pattern-single-element/expected.json +++ /dev/null @@ -1,172 +0,0 @@ -{ - "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/helpers/runFixtureTests.js b/test/helpers/runFixtureTests.js deleted file mode 100644 index c37edcff04..0000000000 --- a/test/helpers/runFixtureTests.js +++ /dev/null @@ -1,145 +0,0 @@ -import test from "ava"; -import { multiple as getFixtures } from "babel-helper-fixtures"; - -export function runFixtureTests(fixturesPath, parseFunction) { - var fixtures = getFixtures(fixturesPath); - - Object.keys(fixtures).forEach(function (name) { - fixtures[name].forEach(function (testSuite) { - testSuite.tests.forEach(function (task) { - var testFn = task.disabled ? test.skip : task.options.only ? test.only : test; - - testFn(name + "/" + testSuite.title + "/" + task.title, function (t) { - try { - runTest(task, parseFunction); - t.pass(); - } catch (err) { - const message = name + "/" + task.actual.filename + ": " + err.message; - t.fail(message); - } - }); - }); - }); - }); -}; - -export function runThrowTestsWithEstree(fixturesPath, parseFunction) { - var fixtures = getFixtures(fixturesPath); - - Object.keys(fixtures).forEach(function (name) { - fixtures[name].forEach(function (testSuite) { - testSuite.tests.forEach(function (task) { - if (!task.options.throws) return; - - task.options.plugins = task.options.plugins || []; - task.options.plugins.push("estree"); - - var testFn = task.disabled ? test.skip : task.options.only ? test.only : test; - - testFn(name + "/" + testSuite.title + "/" + task.title, function (t) { - try { - runTest(task, parseFunction); - t.pass(); - } catch (err) { - const message = name + "/" + task.actual.filename + ": " + err.message; - t.fail(message); - } - }); - }); - }); - }); -}; - -function save(test, ast) { - // 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 runTest(test, parseFunction) { - var opts = test.options; - - if (opts.throws && test.expect.code) { - throw new Error("File expected.json exists although options specify throws. Remove expected.json."); - } - - try { - var ast = parseFunction(test.actual.code, opts); - } catch (err) { - if (opts.throws) { - if (err.message === opts.throws) { - return; - } else { - err.message = "Expected error message: " + opts.throws + ". Got error message: " + err.message; - throw err; - } - } - - throw err; - } - - delete ast.tokens; - if (ast.comments && !ast.comments.length) delete ast.comments; - - if (!test.expect.code && !opts.throws && !process.env.CI) { - test.expect.loc += "on"; - return save(test, ast); - } - - if (opts.throws) { - throw new Error("Expected error message: " + opts.throws + ". But parsing succeeded."); - } else { - var mis = misMatch(JSON.parse(test.expect.code), ast); - - if (mis) { - throw new Error(mis); - } - } -} - -function ppJSON(v) { - v = v instanceof RegExp ? v.toString() : v; - return JSON.stringify(v, null, 2); -} - -function addPath(str, pt) { - if (str.charAt(str.length - 1) == ")") { - return str.slice(0, str.length - 1) + "/" + pt + ")"; - } else { - return str + " (" + pt + ")"; - } -} - -function misMatch(exp, act) { - if (exp instanceof RegExp || act instanceof RegExp) { - var left = ppJSON(exp), right = ppJSON(act); - if (left !== right) return left + " !== " + right; - } else if (Array.isArray(exp)) { - if (!Array.isArray(act)) return ppJSON(exp) + " != " + ppJSON(act); - if (act.length != exp.length) return "array length mismatch " + exp.length + " != " + act.length; - for (var i = 0; i < act.length; ++i) { - var mis = misMatch(exp[i], act[i]); - if (mis) return addPath(mis, i); - } - } else if (!exp || !act || (typeof exp != "object") || (typeof act != "object")) { - if (exp !== act && typeof exp != "function") - return ppJSON(exp) + " !== " + ppJSON(act); - } else { - for (var prop in exp) { - var mis = misMatch(exp[prop], act[prop]); - if (mis) return addPath(mis, prop); - } - - for (var prop in act) { - if (prop === "__clone") { - continue; - } - - if (!(prop in exp) && act[prop] !== undefined) { - return `Did not expect a property '${prop}'`; - } - } - } -} diff --git a/test/index.js b/test/index.js index 7ec91fb86a..2e07daa41b 100644 --- a/test/index.js +++ b/test/index.js @@ -1,5 +1,7 @@ import path from "path"; -import { runFixtureTests } from "./helpers/runFixtureTests"; -import { parse } from "../lib"; +import { runFixtureTests, runTestsWithLightScript } from "./utils/runFixtureTests"; +import { parse, parseExpression } from "../lib"; runFixtureTests(path.join(__dirname, "fixtures"), parse); +runTestsWithLightScript(path.join(__dirname, "fixtures"), parse); +runFixtureTests(path.join(__dirname, "expressions"), parseExpression); diff --git a/test/utils/runFixtureTests.js b/test/utils/runFixtureTests.js new file mode 100644 index 0000000000..aa5268066b --- /dev/null +++ b/test/utils/runFixtureTests.js @@ -0,0 +1,207 @@ +var test = require("ava"); +var getFixtures = require("babel-helper-fixtures").multiple; +var readFile = require("babel-helper-fixtures").readFile; +var resolve = require("try-resolve"); + +const only = { + topic: null, + suite: null, + task: null, +} + +exports.runFixtureTests = function runFixtureTests(fixturesPath, parseFunction) { + var fixtures = getFixtures(fixturesPath); + + Object.keys(fixtures).forEach(function (name) { + if (only.topic && name.indexOf(only.topic) < 0) return + fixtures[name].forEach(function (testSuite) { + if (only.suite && testSuite.title.indexOf(only.suite) < 0) return + testSuite.tests.forEach(function (task) { + 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 () { + try { + return runTest(task, parseFunction); + } catch (err) { + err.message = name + "/" + task.actual.filename + ": " + err.message; + throw err; + } + }); + }); + }); + }); +}; + +exports.runThrowTestsWithEstree = function runThrowTestsWithEstree(fixturesPath, parseFunction) { + var fixtures = getFixtures(fixturesPath); + + Object.keys(fixtures).forEach(function (name) { + + // for now, lightscript just won't support ESTree error messages + if (name.indexOf('lightscript') === 0) return + + if (only.topic && name.indexOf(only.topic) < 0) return + fixtures[name].forEach(function (testSuite) { + if (only.suite && testSuite.title.indexOf(only.suite) < 0) return + testSuite.tests.forEach(function (task) { + if (only.task && task.title.indexOf(only.task) < 0) return + if (!task.options.throws) return; + + task.options.plugins = task.options.plugins || []; + task.options.plugins.push("estree"); + + var testFn = task.disabled ? test.skip : task.options.only ? test.only : test; + + testFn(name + "/" + testSuite.title + "/" + task.title, function () { + try { + return runTest(task, parseFunction); + } catch (err) { + err.message = task.actual.loc + ": " + err.message; + throw err; + } + }); + }); + }); + }); +}; + +exports.runTestsWithLightScript = function runTestsWithLightScript(fixturesPath, parseFunction) { + var fixtures = getFixtures(fixturesPath); + + Object.keys(fixtures).forEach(function (name) { + + // don't need to double-test lightscript + if (name.indexOf('lightscript') === 0) return + + if (only.topic && name.indexOf(only.topic) < 0) return + fixtures[name].forEach(function (testSuite) { + if (only.suite && testSuite.title.indexOf(only.suite) < 0) return + testSuite.tests.forEach(function (task) { + if (only.task && task.title.indexOf(only.task) < 0) return + + task.options.plugins = task.options.plugins || []; + task.options.plugins.push("lightscript"); + + var testFn = task.disabled ? test.skip : task.options.only ? test.only : test; + + const lightOptionsLoc = resolve(task.actual.loc.replace("actual.js", "options.lightscript.json")); + if (lightOptionsLoc) { + const lightOptions = JSON.parse(readFile(lightOptionsLoc)); + task.options = Object.assign({}, task.options, lightOptions); + delete task.expect.code; + } + + const lightExpectLoc = resolve(task.actual.loc.replace("actual.js", "expected.lightscript.json")); + if (lightExpectLoc) { + task.expect = { + loc: lightExpectLoc, + code: readFile(lightExpectLoc), + filename: task.actual.filename.replace("actual.js", "expected.lightscript.json"), + } + delete task.options.throws; + } + + testFn(name + "/" + testSuite.title + "/" + task.title, function () { + try { + return runTest(task, parseFunction); + } catch (err) { + err.message = task.actual.loc + ": " + err.message; + throw err; + } + }); + }); + }); + }); +}; + +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 saveLscErr(test, msg) { + const lscOptionsLoc = test.actual.loc.replace("actual.js", "options.lightscript.json"); + require("fs").writeFileSync(lscOptionsLoc, JSON.stringify({ throws: msg }, null, " ")); +} + +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."); + } + + try { + var ast = parseFunction(test.actual.code, opts); + } catch (err) { + if (opts.throws) { + if (err.message === opts.throws) { + return; + } else { + err.message = "Expected error message: " + opts.throws + ". Got error message: " + err.message; + throw err; + } + } + // saveLscErr(test, err.message); + throw err; + } + + if (!test.expect.code && !opts.throws && !process.env.CI) { + if (test.expect.loc.indexOf(".json") < 0) test.expect.loc += "on"; + return save(test, ast); + } + + if (opts.throws) { + throw new Error("Expected error message: " + opts.throws + ". But parsing succeeded."); + } else { + var mis = misMatch(JSON.parse(test.expect.code), ast); + if (mis) { + //save(test, ast); + throw new Error(mis); + } + } +} + +function ppJSON(v) { + v = v instanceof RegExp ? v.toString() : v; + return JSON.stringify(v, null, 2); +} + +function addPath(str, pt) { + if (str.charAt(str.length - 1) == ")") { + return str.slice(0, str.length - 1) + "/" + pt + ")"; + } else { + return str + " (" + pt + ")"; + } +} + +function misMatch(exp, act) { + if (exp instanceof RegExp || act instanceof RegExp) { + var left = ppJSON(exp), right = ppJSON(act); + if (left !== right) return left + " !== " + right; + } else if (Array.isArray(exp)) { + if (!Array.isArray(act)) return ppJSON(exp) + " != " + ppJSON(act); + if (act.length != exp.length) return "array length mismatch " + exp.length + " != " + act.length; + for (var i = 0; i < act.length; ++i) { + var mis = misMatch(exp[i], act[i]); + if (mis) return addPath(mis, i); + } + } else if (!exp || !act || (typeof exp != "object") || (typeof act != "object")) { + if (exp !== act && typeof exp != "function") + return ppJSON(exp) + " !== " + ppJSON(act); + } else { + for (var prop in exp) { + var mis = misMatch(exp[prop], act[prop]); + if (mis) return addPath(mis, prop); + } + } +} diff --git a/yarn.lock b/yarn.lock index f9d3433784..35b98367ce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,44 +2,9 @@ # 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.1.0" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.0.tgz#d0554c2256636e2f56e7c2e5ad183f859428d81f" + version "1.0.9" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" acorn-jsx@^3.0.0: version "3.0.1" @@ -51,17 +16,17 @@ acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" -acorn@^5.0.1: - version "5.0.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.0.3.tgz#c460df08491463f028ccb82eab3730bf01087b3d" +acorn@^4.0.1: + version "4.0.4" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a" ajv-keywords@^1.0.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" + version "1.5.0" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.0.tgz#c11e6859eafff83e0dafc416929472eca946aa2c" -ajv@^4.7.0, ajv@^4.9.1: - version "4.11.5" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.5.tgz#b6ee74657b993a01dce44b7944d56f485828d5bd" +ajv@^4.7.0: + version "4.10.4" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.10.4.tgz#c0974dd00b3464984892d6010aa9c2c945933254" dependencies: co "^4.6.0" json-stable-stringify "^1.0.1" @@ -96,12 +61,6 @@ 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" @@ -120,8 +79,8 @@ append-transform@^0.4.0: default-require-extensions "^1.0.0" aproba@^1.0.3: - version "1.1.1" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.1.1.tgz#95d3600f07710aa0e9298c726ad5ecf2eacbabab" + version "1.0.4" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.0.4.tgz#2713680775e7614c8ba186c065d4e2e52d1072c0" archy@^1.0.0: version "1.0.0" @@ -140,6 +99,10 @@ 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" @@ -184,179 +147,187 @@ 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.0, async@^1.4.2: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" +async@~0.2.6: + version "0.2.10" + resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" -auto-bind@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/auto-bind/-/auto-bind-1.1.0.tgz#93b864dc7ee01a326281775d5c75ca0a751e5961" +auto-bind@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/auto-bind/-/auto-bind-0.1.0.tgz#7a29efc8c2388d3d578e02fc2df531c81ffc1ee1" -ava-init@^0.2.0: +ava-files@^0.2.0: version "0.2.0" - resolved "https://registry.yarnpkg.com/ava-init/-/ava-init-0.2.0.tgz#9304c8b4c357d66e3dfdae1fbff47b1199d5c55d" + 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" dependencies: arr-exclude "^1.0.0" - 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" + 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: arr-flatten "^1.0.1" array-union "^1.0.1" array-uniq "^1.0.2" arrify "^1.0.0" - auto-bind "^1.1.0" - ava-init "^0.2.0" + auto-bind "^0.1.0" + ava-files "^0.2.0" + ava-init "^0.1.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 "^2.1.0" - cli-spinners "^1.0.0" - cli-truncate "^1.0.0" + cli-cursor "^1.0.2" + cli-spinners "^0.1.2" + cli-truncate "^0.2.0" co-with-promise "^4.6.0" - code-excerpt "^2.1.0" common-path-prefix "^1.0.0" convert-source-map "^1.2.0" core-assert "^0.2.0" currently-unhandled "^0.4.1" debug "^2.2.0" - diff "^3.0.1" - diff-match-patch "^1.0.0" - dot-prop "^4.1.0" empower-core "^0.6.1" - equal-length "^1.0.0" - figures "^2.0.0" + figures "^1.4.0" find-cache-dir "^0.1.1" fn-name "^2.0.0" - get-port "^3.0.0" - globby "^6.0.0" + get-port "^2.1.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.flatten "^4.2.0" - lodash.isequal "^4.5.0" + lodash.isequal "^4.4.0" loud-rejection "^1.2.0" matcher "^0.1.1" - md5-hex "^2.0.0" + max-timeout "^1.0.0" + md5-hex "^1.2.0" meow "^3.7.0" - mkdirp "^0.5.1" ms "^0.7.1" - multimatch "^2.1.0" - observable-to-promise "^0.5.0" + object-assign "^4.0.1" + observable-to-promise "^0.4.0" option-chain "^0.1.0" - package-hash "^2.0.0" - pkg-conf "^2.0.0" + package-hash "^1.1.0" + pkg-conf "^1.0.1" 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" - slash "^1.0.0" + semver "^5.3.0" + set-immediate-shim "^1.0.1" source-map-support "^0.4.0" - stack-utils "^1.0.0" + stack-utils "^0.4.0" strip-ansi "^3.0.1" - strip-bom-buf "^1.0.0" - supports-color "^3.2.3" + strip-bom "^2.0.0" time-require "^0.1.2" unique-temp-dir "^1.0.0" - update-notifier "^2.1.0" + update-notifier "^1.0.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.6.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" + version "1.5.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.5.0.tgz#0a29ffb79c31c9e712eeb087e8e7a64b4a56d755" -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" +babel-cli@^6.14.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.18.0.tgz#92117f341add9dead90f6fa7d0a97c0cc08ec186" dependencies: - babel-core "7.0.0-alpha.6" - babel-polyfill "7.0.0-alpha.3" - babel-register "7.0.0-alpha.6" + babel-core "^6.18.0" + babel-polyfill "^6.16.0" + babel-register "^6.18.0" + babel-runtime "^6.9.0" commander "^2.8.1" convert-source-map "^1.1.0" fs-readdir-recursive "^1.0.0" - glob "^7.0.0" + glob "^5.0.5" lodash "^4.2.0" output-file-sync "^1.1.0" + path-is-absolute "^1.0.0" slash "^1.0.0" source-map "^0.5.0" v8flags "^2.0.10" optionalDependencies: - chokidar "^1.6.1" + chokidar "^1.0.0" -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" +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" dependencies: chalk "^1.1.0" esutils "^2.0.2" - js-tokens "^3.0.0" - -babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" - 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" + 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" babylon "^6.11.0" convert-source-map "^1.1.0" debug "^2.1.1" @@ -368,266 +339,178 @@ babel-core@6, babel-core@^6.17.0, babel-core@^6.24.0: slash "^1.0.0" source-map "^0.5.0" -babel-core@7.0.0-alpha.6: - version "7.0.0-alpha.6" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-7.0.0-alpha.6.tgz#a4c59f5cd5ef0374365a37937e5c585510eed718" - dependencies: - babel-code-frame "7.0.0-alpha.3" - babel-generator "7.0.0-alpha.3" - babel-helpers "7.0.0-alpha.3" - babel-messages "7.0.0-alpha.3" - babel-template "7.0.0-alpha.3" - babel-traverse "7.0.0-alpha.3" - babel-types "7.0.0-alpha.3" - babylon "7.0.0-beta.7" - convert-source-map "^1.1.0" - debug "^2.1.1" - json5 "^0.5.0" - lodash "^4.2.0" - micromatch "^2.3.11" - private "^0.1.6" - resolve "^1.3.2" - slash "^1.0.0" - source-map "^0.5.0" - babel-eslint@^7.0.0: - version "7.2.1" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-7.2.1.tgz#079422eb73ba811e3ca0865ce87af29327f8c52f" - dependencies: - babel-code-frame "^6.22.0" - babel-traverse "^6.23.1" - babel-types "^6.23.0" - babylon "^6.16.1" - -babel-generator@7.0.0-alpha.3: - version "7.0.0-alpha.3" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-7.0.0-alpha.3.tgz#92af29b9e75fbe6888ef0d28b39e34f9ec83a06c" + version "7.1.1" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-7.1.1.tgz#8a6a884f085aa7060af69cfc77341c2f99370fb2" dependencies: - babel-messages "7.0.0-alpha.3" - babel-types "7.0.0-alpha.3" - detect-indent "^4.0.0" - jsesc "^1.3.0" - lodash "^4.2.0" - source-map "^0.5.0" - trim-right "^1.0.1" + babel-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-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" +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" dependencies: - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-types "^6.23.0" + babel-messages "^6.8.0" + babel-runtime "^6.20.0" + babel-types "^6.21.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.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" +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" dependencies: - babel-helper-explode-assignable-expression "^6.22.0" - babel-runtime "^6.22.0" - babel-types "^6.22.0" + babel-runtime "^6.0.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" -babel-helper-call-delegate@7.0.0-alpha.3: - version "7.0.0-alpha.3" - resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-7.0.0-alpha.3.tgz#23c12acd22ade7ed05b27a51ad2c7d1016929dbf" +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" dependencies: - babel-helper-hoist-variables "7.0.0-alpha.3" - babel-traverse "7.0.0-alpha.3" - babel-types "7.0.0-alpha.3" + babel-helper-explode-assignable-expression "^6.18.0" + babel-runtime "^6.0.0" + babel-types "^6.18.0" -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" +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" dependencies: - babel-helper-hoist-variables "^6.22.0" - babel-runtime "^6.22.0" - babel-traverse "^6.22.0" - babel-types "^6.22.0" + babel-helper-hoist-variables "^6.18.0" + babel-runtime "^6.0.0" + babel-traverse "^6.18.0" + babel-types "^6.18.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" +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" dependencies: - babel-helper-function-name "7.0.0-alpha.3" - babel-types "7.0.0-alpha.3" + babel-helper-function-name "^6.18.0" + babel-runtime "^6.9.0" + babel-types "^6.18.0" lodash "^4.2.0" -babel-helper-define-map@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.23.0.tgz#1444f960c9691d69a2ced6a205315f8fd00804e7" +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" dependencies: - babel-helper-function-name "^6.23.0" - babel-runtime "^6.22.0" - babel-types "^6.23.0" - lodash "^4.2.0" + babel-runtime "^6.0.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" -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" +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" dependencies: - babel-runtime "^6.22.0" - babel-traverse "^6.22.0" - babel-types "^6.22.0" + babel-helper-bindify-decorators "^6.18.0" + babel-runtime "^6.0.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" -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" +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" dependencies: + babel-runtime "^6.20.0" lodash "^4.2.0" try-resolve "^1.0.0" -babel-helper-function-name@7.0.0-alpha.3: - version "7.0.0-alpha.3" - resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-7.0.0-alpha.3.tgz#c20acaadfff6632b7c7efccab31d60d5e8e59814" - dependencies: - babel-helper-get-function-arity "7.0.0-alpha.3" - babel-template "7.0.0-alpha.3" - babel-traverse "7.0.0-alpha.3" - babel-types "7.0.0-alpha.3" - -babel-helper-function-name@^6.22.0, babel-helper-function-name@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.23.0.tgz#25742d67175c8903dbe4b6cb9d9e1fcb8dcf23a6" - dependencies: - babel-helper-get-function-arity "^6.22.0" - babel-runtime "^6.22.0" - babel-template "^6.23.0" - babel-traverse "^6.23.0" - babel-types "^6.23.0" - -babel-helper-get-function-arity@7.0.0-alpha.3: - version "7.0.0-alpha.3" - resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-7.0.0-alpha.3.tgz#e2c2db48d65300da135cabd91d8e9629b07ca5e8" - dependencies: - babel-types "7.0.0-alpha.3" - -babel-helper-get-function-arity@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.22.0.tgz#0beb464ad69dc7347410ac6ade9f03a50634f5ce" +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" dependencies: - babel-runtime "^6.22.0" - babel-types "^6.22.0" - -babel-helper-hoist-variables@7.0.0-alpha.3: - version "7.0.0-alpha.3" - resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-7.0.0-alpha.3.tgz#6bd71cdea55d848877acf14c3751b8598c0fd198" - dependencies: - babel-types "7.0.0-alpha.3" - -babel-helper-hoist-variables@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.22.0.tgz#3eacbf731d80705845dd2e9718f600cfb9b4ba72" - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.22.0" + 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-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" +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" dependencies: - babel-types "7.0.0-alpha.3" + babel-runtime "^6.0.0" + babel-types "^6.18.0" -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" +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" dependencies: - babel-runtime "^6.22.0" - babel-types "^6.23.0" + babel-runtime "^6.0.0" + babel-types "^6.18.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" +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" dependencies: - babel-types "7.0.0-alpha.3" - lodash "^4.2.0" + babel-runtime "^6.0.0" + babel-types "^6.18.0" -babel-helper-regex@^6.18.0, babel-helper-regex@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.22.0.tgz#79f532be1647b1f0ee3474b5f5c3da58001d247d" +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" dependencies: - babel-runtime "^6.22.0" - babel-types "^6.22.0" + babel-runtime "^6.9.0" + babel-types "^6.18.0" lodash "^4.2.0" -babel-helper-remap-async-to-generator@7.0.0-alpha.3: - version "7.0.0-alpha.3" - resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-7.0.0-alpha.3.tgz#9b137a1222a186f1cfb6fa292af5d302085e1aa7" - dependencies: - babel-helper-function-name "7.0.0-alpha.3" - babel-template "7.0.0-alpha.3" - babel-traverse "7.0.0-alpha.3" - babel-types "7.0.0-alpha.3" - -babel-helper-remap-async-to-generator@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.22.0.tgz#2186ae73278ed03b8b15ced089609da981053383" +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" dependencies: - babel-helper-function-name "^6.22.0" - babel-runtime "^6.22.0" - babel-template "^6.22.0" - babel-traverse "^6.22.0" - babel-types "^6.22.0" + babel-helper-function-name "^6.18.0" + babel-runtime "^6.20.0" + babel-template "^6.16.0" + babel-traverse "^6.20.0" + babel-types "^6.20.0" -babel-helper-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" +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" dependencies: - babel-helper-optimise-call-expression "7.0.0-alpha.3" - babel-messages "7.0.0-alpha.3" - babel-template "7.0.0-alpha.3" - babel-traverse "7.0.0-alpha.3" - babel-types "7.0.0-alpha.3" + babel-helper-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-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" +babel-helpers@^6.16.0: + version "6.16.0" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.16.0.tgz#1095ec10d99279460553e67eb3eee9973d3867e3" dependencies: - 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-runtime "^6.0.0" + babel-template "^6.16.0" -babel-helpers@7.0.0-alpha.3: - version "7.0.0-alpha.3" - resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-7.0.0-alpha.3.tgz#e9a5362d84bfa6730dca16f762e185a077afc45e" +babel-messages@^6.8.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.8.0.tgz#bf504736ca967e6d65ef0adb5a2a5f947c8e0eb9" dependencies: - babel-template "7.0.0-alpha.3" + babel-runtime "^6.0.0" -babel-helpers@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.23.0.tgz#4f8f2e092d0b6a8808a4bde79c27f1e2ecf0d992" +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" 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-template "^6.7.0" + babel-types "^6.7.2" -babel-messages@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" +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" 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-runtime "^6.0.0" -babel-plugin-check-es2015-constants@^6.8.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" - dependencies: - babel-runtime "^6.22.0" +babel-plugin-detective@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-detective/-/babel-plugin-detective-2.0.0.tgz#6e642e83c22a335279754ebe2d754d2635f49f13" -babel-plugin-espower@^2.3.2: +babel-plugin-espower@^2.3.1: version "2.3.2" resolved "https://registry.yarnpkg.com/babel-plugin-espower/-/babel-plugin-espower-2.3.2.tgz#5516b8fcdb26c9f0e1d8160749f6e4c65e71271e" dependencies: @@ -639,553 +522,490 @@ babel-plugin-espower@^2.3.2: espurify "^1.6.0" estraverse "^4.1.1" -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" +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" dependencies: - find-up "^2.1.0" - istanbul-lib-instrument "^1.6.2" - test-exclude "^4.0.3" + find-up "^1.1.2" + istanbul-lib-instrument "^1.4.2" + object-assign "^4.1.0" + test-exclude "^3.3.0" 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@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-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-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-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-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-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-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-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-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-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-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@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-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-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-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-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-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-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-object-rest-spread@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" -babel-plugin-syntax-trailing-function-commas@^6.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-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-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" +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" dependencies: - babel-helper-remap-async-to-generator "7.0.0-alpha.3" - babel-plugin-syntax-async-generators "7.0.0-alpha.3" + babel-helper-remap-async-to-generator "^6.16.2" + babel-plugin-syntax-async-generators "^6.5.0" + babel-runtime "^6.0.0" babel-plugin-transform-async-to-generator@^6.16.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.22.0.tgz#194b6938ec195ad36efc4c33a971acf00d8cd35e" + 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" dependencies: - babel-helper-remap-async-to-generator "^6.22.0" + babel-helper-remap-async-to-generator "^6.16.0" babel-plugin-syntax-async-functions "^6.8.0" - babel-runtime "^6.22.0" + babel-runtime "^6.0.0" -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" +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" dependencies: - 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-syntax-class-constructor-call "^6.18.0" + babel-runtime "^6.0.0" + babel-template "^6.8.0" -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" +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" dependencies: - babel-plugin-syntax-decorators "7.0.0-alpha.3" - babel-runtime "7.0.0-alpha.3" - babel-template "7.0.0-alpha.3" + 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-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" +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" dependencies: - 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-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-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-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" +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" dependencies: - 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-syntax-do-expressions "^6.8.0" + babel-runtime "^6.0.0" -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" +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" dependencies: - 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-runtime "^6.0.0" -babel-plugin-transform-es2015-classes@^6.9.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.23.0.tgz#49b53f326202a2fd1b3bbaa5e2edd8a4f78643c1" +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" dependencies: - babel-helper-define-map "^6.23.0" - babel-helper-function-name "^6.23.0" - babel-helper-optimise-call-expression "^6.23.0" - babel-helper-replace-supers "^6.23.0" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.23.0" - babel-traverse "^6.23.0" - babel-types "^6.23.0" + babel-runtime "^6.0.0" -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" +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" dependencies: - babel-template "7.0.0-alpha.3" + 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-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-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@^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" +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" dependencies: - babel-runtime "^6.22.0" + babel-helper-define-map "^6.8.0" + babel-runtime "^6.0.0" + babel-template "^6.8.0" -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" +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" dependencies: - babel-types "7.0.0-alpha.3" - -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-runtime "^6.9.0" -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" +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" dependencies: - babel-helper-function-name "7.0.0-alpha.3" - babel-types "7.0.0-alpha.3" + babel-runtime "^6.0.0" + babel-types "^6.8.0" -babel-plugin-transform-es2015-function-name@^6.9.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.22.0.tgz#f5fcc8b09093f9a23c76ac3d9e392c3ec4b77104" +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" dependencies: - babel-helper-function-name "^6.22.0" - babel-runtime "^6.22.0" - babel-types "^6.22.0" + babel-runtime "^6.0.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-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" +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" dependencies: - babel-plugin-transform-es2015-modules-commonjs "7.0.0-alpha.3" - babel-template "7.0.0-alpha.3" + 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: - 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" +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" dependencies: - 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-runtime "^6.0.0" -babel-plugin-transform-es2015-modules-commonjs@^6.18.0: - version "6.24.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.24.0.tgz#e921aefb72c2cc26cb03d107626156413222134f" +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" dependencies: - 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-runtime "^6.0.0" + babel-template "^6.8.0" -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" +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" dependencies: - babel-helper-hoist-variables "7.0.0-alpha.3" - babel-template "7.0.0-alpha.3" + babel-plugin-transform-strict-mode "^6.18.0" + babel-runtime "^6.0.0" + babel-template "^6.16.0" + babel-types "^6.18.0" -babel-plugin-transform-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" +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" dependencies: - babel-plugin-transform-es2015-modules-amd "7.0.0-alpha.3" - babel-template "7.0.0-alpha.3" + babel-helper-hoist-variables "^6.18.0" + babel-runtime "^6.11.6" + babel-template "^6.14.0" -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" +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" dependencies: - babel-helper-replace-supers "7.0.0-alpha.3" + babel-plugin-transform-es2015-modules-amd "^6.18.0" + babel-runtime "^6.0.0" + babel-template "^6.8.0" -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" +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" dependencies: - babel-helper-call-delegate "7.0.0-alpha.3" - babel-helper-get-function-arity "7.0.0-alpha.3" - babel-template "7.0.0-alpha.3" - babel-traverse "7.0.0-alpha.3" - babel-types "7.0.0-alpha.3" + babel-helper-replace-supers "^6.8.0" + babel-runtime "^6.0.0" -babel-plugin-transform-es2015-parameters@^6.21.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.23.0.tgz#3a2aabb70c8af945d5ce386f1a4250625a83ae3b" +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" dependencies: - 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-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-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" +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" dependencies: - 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-runtime "^6.0.0" + babel-types "^6.18.0" -babel-plugin-transform-es2015-spread@^6.8.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" +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" dependencies: - babel-runtime "^6.22.0" + babel-runtime "^6.0.0" -babel-plugin-transform-es2015-sticky-regex@7.0.0-alpha.3: - version "7.0.0-alpha.3" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-7.0.0-alpha.3.tgz#abc021c8ad9a9ced19c27b0d94d1817abf2a8a2b" +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" dependencies: - babel-helper-regex "7.0.0-alpha.3" - babel-types "7.0.0-alpha.3" + babel-helper-regex "^6.8.0" + babel-runtime "^6.0.0" + babel-types "^6.8.0" -babel-plugin-transform-es2015-sticky-regex@^6.8.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.22.0.tgz#ab316829e866ee3f4b9eb96939757d19a5bc4593" +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" dependencies: - babel-helper-regex "^6.22.0" - babel-runtime "^6.22.0" - babel-types "^6.22.0" - -babel-plugin-transform-es2015-template-literals@7.0.0-alpha.3: - version "7.0.0-alpha.3" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-7.0.0-alpha.3.tgz#ccad4e75903dc5ee1989a5108b83740c80b3629a" + babel-runtime "^6.0.0" -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" +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" dependencies: - babel-helper-regex "7.0.0-alpha.3" - regexpu-core "^4.0.2" + babel-runtime "^6.0.0" -babel-plugin-transform-es2015-unicode-regex@^6.11.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.22.0.tgz#8d9cc27e7ee1decfe65454fb986452a04a613d20" +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" dependencies: - babel-helper-regex "^6.22.0" - babel-runtime "^6.22.0" + babel-helper-regex "^6.8.0" + babel-runtime "^6.0.0" regexpu-core "^2.0.0" -babel-plugin-transform-exponentiation-operator@^6.8.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.22.0.tgz#d57c8335281918e54ef053118ce6eb108468084d" +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" dependencies: - babel-helper-builder-binary-assignment-operator-visitor "^6.22.0" + babel-helper-builder-binary-assignment-operator-visitor "^6.8.0" babel-plugin-syntax-exponentiation-operator "^6.8.0" - babel-runtime "^6.22.0" + babel-runtime "^6.0.0" -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" +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" dependencies: - babel-plugin-syntax-export-extensions "7.0.0-alpha.3" + babel-plugin-syntax-export-extensions "^6.8.0" + babel-runtime "^6.0.0" -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" +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" dependencies: - babel-plugin-syntax-flow "7.0.0-alpha.3" + babel-plugin-syntax-flow "^6.18.0" + babel-runtime "^6.0.0" -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" +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" dependencies: - babel-plugin-syntax-function-bind "7.0.0-alpha.3" + babel-plugin-syntax-function-bind "^6.8.0" + babel-runtime "^6.0.0" -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" +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" dependencies: - babel-plugin-syntax-object-rest-spread "7.0.0-alpha.3" + babel-plugin-syntax-object-rest-spread "^6.8.0" + babel-runtime "^6.20.0" -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" +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" dependencies: - regenerator-transform "0.9.11" + regenerator-transform "0.9.8" -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" +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" dependencies: - babel-types "7.0.0-alpha.3" + babel-runtime "^6.9.0" -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" +babel-plugin-transform-strict-mode@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.18.0.tgz#df7cf2991fe046f44163dcd110d5ca43bc652b9d" dependencies: - babel-runtime "^6.22.0" - babel-types "^6.22.0" - -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-runtime "^6.0.0" + babel-types "^6.18.0" -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" +babel-polyfill@^6.16.0: + version "6.20.0" + resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.20.0.tgz#de4a371006139e20990aac0be367d398331204e7" dependencies: + babel-runtime "^6.20.0" core-js "^2.4.0" regenerator-runtime "^0.10.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-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-register@^6.24.0: - version "6.24.0" - resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.24.0.tgz#5e89f8463ba9970356d02eb07dabe3308b080cfd" +babel-register@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.18.0.tgz#892e2e03865078dd90ad2c715111ec4449b32a68" dependencies: - babel-core "^6.24.0" - babel-runtime "^6.22.0" + babel-core "^6.18.0" + babel-runtime "^6.11.6" 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@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" +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" dependencies: core-js "^2.4.0" regenerator-runtime "^0.10.0" -babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b" +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" dependencies: - core-js "^2.4.0" - regenerator-runtime "^0.10.0" - -babel-template@7.0.0-alpha.3: - version "7.0.0-alpha.3" - resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-7.0.0-alpha.3.tgz#eff537d49216ae6e70722f3556a17cc3de62b117" - dependencies: - babel-traverse "7.0.0-alpha.3" - babel-types "7.0.0-alpha.3" - babylon "7.0.0-beta.7" - lodash "^4.2.0" - -babel-template@^6.16.0, babel-template@^6.22.0, babel-template@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.23.0.tgz#04d4f270adbb3aa704a8143ae26faa529238e638" - dependencies: - babel-runtime "^6.22.0" - babel-traverse "^6.23.0" - babel-types "^6.23.0" + babel-runtime "^6.9.0" + babel-traverse "^6.16.0" + babel-types "^6.16.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" +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" 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" + babel-code-frame "^6.20.0" + babel-messages "^6.8.0" + babel-runtime "^6.20.0" + babel-types "^6.21.0" + babylon "^6.11.0" debug "^2.2.0" globals "^9.0.0" invariant "^2.2.0" lodash "^4.2.0" -babel-types@7.0.0-alpha.3: - version "7.0.0-alpha.3" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-7.0.0-alpha.3.tgz#36c20f7a4e4d3f32fc00ab38893004a6f52b22a8" +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" dependencies: + babel-runtime "^6.20.0" 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.22.0" - esutils "^2.0.2" - lodash "^4.2.0" - to-fast-properties "^1.0.1" - -babylon@7.0.0-beta.7: - version "7.0.0-beta.7" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.7.tgz#61454c26b0e285ffe826dd237d5b5d179f602e16" - -babylon@^6.1.0, babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0, babylon@^6.16.1: - version "6.16.1" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.16.1.tgz#30c5a22f481978a9e7f8cdfdf496b11d94b404d3" +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" 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.1" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" + version "1.0.0" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.0.tgz#3ca76b85241c7170bf7d9703e7b9aa74630040d4" dependencies: tweetnacl "^0.14.3" @@ -1199,9 +1019,9 @@ block-stream@*: dependencies: inherits "~2.0.0" -bluebird@^3.0.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.0.tgz#791420d7f551eea2897453a8a77653f96606d67c" +bluebird@^3.0.0, bluebird@^3.4.1: + version "3.4.7" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.4.7.tgz#f72d760be09b7f76d08ed8fae98b289a8d05fab3" boom@2.x.x: version "2.10.1" @@ -1209,16 +1029,18 @@ boom@2.x.x: dependencies: hoek "2.x.x" -boxen@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.0.0.tgz#b2694baf1f605f708ff0177c12193b22f29aaaab" +boxen@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-0.6.0.tgz#8364d4248ac34ff0ef1b2f2bf49a6c60ce0d81b6" dependencies: ansi-align "^1.1.0" - camelcase "^4.0.0" + camelcase "^2.1.0" chalk "^1.1.1" cli-boxes "^1.0.0" - string-width "^2.0.0" - term-size "^0.1.0" + filled-array "^1.0.0" + object-assign "^4.0.1" + repeating "^2.0.0" + string-width "^1.0.1" widest-line "^1.0.0" brace-expansion@^1.0.0: @@ -1296,7 +1118,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.0.0, camelcase@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" @@ -1304,17 +1126,13 @@ 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.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" +caseless@~0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7" center-align@^0.1.1: version "0.1.3" @@ -1341,7 +1159,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.4.2, chokidar@^1.6.1: +chokidar@^1.0.0, chokidar@^1.4.2: version "1.6.1" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.6.1.tgz#2f4447ab5e96e50fb3d789fd90d4c72e0e4c70c2" dependencies: @@ -1364,10 +1182,6 @@ 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" @@ -1376,28 +1190,22 @@ 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.1, cli-cursor@^1.0.2: 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-cursor@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" - dependencies: - restore-cursor "^2.0.0" - -cli-spinners@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-1.0.0.tgz#ef987ed3d48391ac3dab9180b406a742180d6e6a" +cli-spinners@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-0.1.2.tgz#bb764d88e185fb9e1e6a2a1f19772318f605e31c" -cli-truncate@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-1.0.0.tgz#21eb91f47b3f6560f004db77a769b4668d9c5518" +cli-truncate@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574" dependencies: slice-ansi "0.0.4" - string-width "^2.0.0" + string-width "^1.0.1" cli-width@^2.0.0: version "2.1.0" @@ -1429,25 +1237,18 @@ 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" -color-convert@^1.0.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a" +codecov@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/codecov/-/codecov-1.0.1.tgz#97260ceac0e96b8eda8d562006558a53a139dffd" dependencies: - color-name "^1.1.1" - -color-name@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.2.tgz#5c8ab72b64bd2215d617ae9559ebb148475cf98d" + argv ">=0.0.2" + execSync "1.0.2" + request ">=2.42.0" + urlgrey ">=0.4.0" combined-stream@^1.0.5, combined-stream@~1.0.5: version "1.0.5" @@ -1455,7 +1256,7 @@ combined-stream@^1.0.5, combined-stream@~1.0.5: dependencies: delayed-stream "~1.0.0" -commander@^2.8.1: +commander@^2.8.1, commander@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" dependencies: @@ -1473,7 +1274,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.5.2: +concat-stream@^1.4.6: version "1.6.0" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" dependencies: @@ -1481,28 +1282,27 @@ concat-stream@^1.5.2: readable-stream "^2.2.2" typedarray "^0.0.6" -configstore@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/configstore/-/configstore-3.0.0.tgz#e1b8669c1803ccc50b545e92f8e6e79aa80e0196" +configstore@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/configstore/-/configstore-2.1.0.tgz#737a3a7036e9886102aa6099e47bb33ab1aba1a1" dependencies: - dot-prop "^4.1.0" + dot-prop "^3.0.0" graceful-fs "^4.1.2" mkdirp "^0.5.0" - unique-string "^1.0.0" + object-assign "^4.0.1" + os-tmpdir "^1.0.0" + osenv "^0.1.0" + uuid "^2.0.1" write-file-atomic "^1.1.2" - xdg-basedir "^3.0.0" + xdg-basedir "^2.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.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" + version "1.3.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.3.0.tgz#e9f3e9c6e2728efc2676696a70eb382f73106a67" core-assert@^0.2.0: version "0.2.1" @@ -1519,25 +1319,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.0: +create-error-class@^3.0.1: 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@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-4.0.0.tgz#16083862d08275a4628b0b243b121bedaa55dd80" +cross-env@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-2.0.1.tgz#f283b4039ea759ada9ab7e987ad3bddb241b79a6" dependencies: - cross-spawn "^5.1.0" - is-windows "^1.0.0" + cross-spawn "^3.0.1" + lodash.assign "^3.2.0" -cross-spawn-async@^2.1.1: - version "2.2.5" - resolved "https://registry.yarnpkg.com/cross-spawn-async/-/cross-spawn-async-2.2.5.tgz#845ff0c0834a3ded9d160daca6d390906bb288cc" +cross-spawn@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-3.0.1.tgz#1256037ecb9f0c5f79e3d6ef135e30770184b982" dependencies: - lru-cache "^4.0.0" - which "^1.2.8" + lru-cache "^4.0.1" + which "^1.2.9" cross-spawn@^4, cross-spawn@^4.0.0: version "4.0.2" @@ -1546,35 +1346,23 @@ 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@1: - version "1.0.0" - resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" +d@^0.1.1, d@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/d/-/d-0.1.1.tgz#da184c535d18d8ee7ba2aa229b914009fae11309" dependencies: - es5-ext "^0.10.9" + es5-ext "~0.10.2" dashdash@^1.12.0: version "1.14.1" @@ -1591,11 +1379,17 @@ 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.3" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.3.tgz#0f7eb8c30965ec08c72accfa0130c8b79984141d" + version "2.6.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.0.tgz#bc596bcabe7617f11d9fa15361eded5608b8499b" 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" @@ -1644,30 +1438,28 @@ detect-indent@^4.0.0: dependencies: repeating "^2.0.0" -diff-match-patch@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/diff-match-patch/-/diff-match-patch-1.0.0.tgz#1cc3c83a490d67f95d91e39f6ad1f2e086b63048" - -diff@^3.0.0, diff@^3.0.1: - version "3.2.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" - -doctrine@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.0.0.tgz#c73d8d2909d22291e1a007a395804da8b665fe63" +doctrine@^1.2.2: + version "1.5.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" dependencies: esutils "^2.0.2" isarray "^1.0.0" -dot-prop@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.1.1.tgz#a8493f0b7b5eeec82525b5c7587fa7de7ca859c1" +dot-prop@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-3.0.0.tgz#1b708af094a49c9a0e7dbcad790aba539dac1177" dependencies: is-obj "^1.0.0" -duplexer3@^0.1.4: +duplexer2@^0.1.4: version "0.1.4" - resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" + resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" + dependencies: + readable-stream "^2.0.2" + +eastasianwidth@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.1.1.tgz#44d656de9da415694467335365fb3147b8572b7c" ecc-jsbn@~0.1.1: version "0.1.1" @@ -1682,71 +1474,63 @@ 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.1" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" + version "1.3.0" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.0.tgz#e67b43f3e82c96ea3a584ffee0b9fc3325d802d9" dependencies: is-arrayish "^0.2.1" -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" +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" dependencies: es6-iterator "2" es6-symbol "~3.1" -es6-error@^4.0.1, es6-error@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.0.2.tgz#eec5c726eacef51b7f6b73c20db6e1b13b069c98" - -es6-iterator@2, es6-iterator@^2.0.1, es6-iterator@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.1.tgz#8e319c9f0453bf575d374940a655920e59ca5512" +es6-iterator@2: + version "2.0.0" + resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.0.tgz#bd968567d61635e33c0b80727613c9cb4b096bac" dependencies: - d "1" - es5-ext "^0.10.14" - es6-symbol "^3.1" + d "^0.1.1" + es5-ext "^0.10.7" + es6-symbol "3" es6-map@^0.1.3: - version "0.1.5" - resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" + version "0.1.4" + resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.4.tgz#a34b147be224773a4d7da8072794cefa3632b897" dependencies: - 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" + 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" -es6-set@~0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" +es6-set@~0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.4.tgz#9516b6761c2964b92ff479456233a247dc707ce8" dependencies: - d "1" - es5-ext "~0.10.14" - es6-iterator "~2.0.1" - es6-symbol "3.1.1" - event-emitter "~0.3.5" + d "~0.1.1" + es5-ext "~0.10.11" + es6-iterator "2" + es6-symbol "3" + event-emitter "~0.3.4" -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" +es6-symbol@3, es6-symbol@~3.1, es6-symbol@~3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.0.tgz#94481c655e7a7cad82eba832d97d5433496d7ffa" dependencies: - d "1" - es5-ext "~0.10.14" + d "~0.1.1" + es5-ext "~0.10.11" es6-weak-map@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" + version "2.0.1" + resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.1.tgz#0d2bbd8827eb5fb4ba8f97fbfea50d43db21ea81" dependencies: - d "1" - es5-ext "^0.10.14" - es6-iterator "^2.0.1" - es6-symbol "^3.1.1" + d "^0.1.1" + es5-ext "^0.10.8" + es6-iterator "2" + es6-symbol "3" escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.4, escape-string-regexp@^1.0.5: version "1.0.5" @@ -1766,23 +1550,22 @@ 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.4" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.30.4.tgz#771d6bb4578ab8598e9c58018fea2e1a22946249" + version "2.30.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.30.0.tgz#3054a265f9c8afe3046c3d41b72d32a736f9b4ae" dependencies: lodash "^4.15.0" eslint@^3.7.1: - version "3.19.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.19.0.tgz#c8fc6201c7f40dd08941b87c085767386a679acc" + version "3.13.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.13.1.tgz#564d2646b5efded85df96985332edd91a23bff25" dependencies: babel-code-frame "^6.16.0" chalk "^1.1.3" - concat-stream "^1.5.2" + concat-stream "^1.4.6" debug "^2.1.1" - doctrine "^2.0.0" + doctrine "^1.2.2" escope "^3.6.0" - espree "^3.4.0" - esquery "^1.0.0" + espree "^3.3.1" estraverse "^4.2.0" esutils "^2.0.2" file-entry-cache "^2.0.0" @@ -1820,29 +1603,23 @@ espower-location-detector@^1.0.0: source-map "^0.5.0" xtend "^4.0.0" -espree@^3.4.0: - version "3.4.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.1.tgz#28a83ab4aaed71ed8fe0f5efe61b76a05c13c4d2" +espree@^3.3.1: + version "3.3.2" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.3.2.tgz#dbf3fadeb4ecb4d4778303e50103b3d36c88b89c" dependencies: - acorn "^5.0.1" + acorn "^4.0.1" acorn-jsx "^3.0.0" -esprima@^3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" +esprima@^2.6.0: + version "2.7.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" espurify@^1.6.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/espurify/-/espurify-1.7.0.tgz#1c5cf6cbccc32e6f639380bd4f991fab9ba9d226" + version "1.6.0" + resolved "https://registry.yarnpkg.com/espurify/-/espurify-1.6.0.tgz#6cb993582d9422bd6f2d4b258aadb14833f394f0" 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" @@ -1850,7 +1627,7 @@ esrecurse@^4.1.0: estraverse "~4.1.0" object-assign "^4.0.1" -estraverse@^4.0.0, estraverse@^4.1.1, estraverse@^4.2.0: +estraverse@^4.0.0, estraverse@^4.1.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" @@ -1866,35 +1643,18 @@ esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" -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 "1" - es5-ext "~0.10.14" - -execa@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.4.0.tgz#4eb6467a36a095fabb2970ff9d5e3fb7bce6ebc3" +event-emitter@~0.3.4: + version "0.3.4" + resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.4.tgz#8d63ddfb4cfe1fae3b32ca265c4c720222080bb5" 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" + d "~0.1.1" + es5-ext "~0.10.7" -execa@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.5.1.tgz#de3fb85cb8d6e91c85bcbceb164581785cb57b36" +execSync@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/execSync/-/execSync-1.0.2.tgz#1f42eda582225180053224ecdd3fd1960fdb3139" dependencies: - cross-spawn "^4.0.0" - get-stream "^2.2.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" + temp "~0.5.1" exit-hook@^1.0.0: version "1.1.1" @@ -1930,19 +1690,13 @@ 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.3.5, figures@^1.4.0: 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" @@ -1964,6 +1718,10 @@ 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" @@ -1979,12 +1737,6 @@ 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" @@ -1994,23 +1746,23 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.44.0: - version "0.44.2" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.44.2.tgz#3893c7db5de043ed82674f327a04b1309db208b5" +flow-bin@^0.40.0: + version "0.40.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.40.0.tgz#e10d60846d923124e47f548f16ba60fd8baff5a5" fn-name@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/fn-name/-/fn-name-2.0.1.tgz#5214d7537a4d06a4a301c0cc262feb84188002e7" -for-in@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" +for-in@^0.1.5: + version "0.1.6" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.6.tgz#c9f96e89bfad18a545af5ec3ed352a1d9e5b4dc8" for-own@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + version "0.1.4" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.4.tgz#0149b41a39088c7515f51ebe1c1386d45f935072" dependencies: - for-in "^1.0.1" + for-in "^0.1.5" foreground-child@^1.3.3, foreground-child@^1.5.3: version "1.5.6" @@ -2040,13 +1792,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.1.1" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.1.tgz#f19fd28f43eeaf761680e519a203c4d0b3d31aff" + version "1.0.17" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.0.17.tgz#8537f3f12272678765b4fd6528c0f1f66f8f4558" 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: @@ -2054,9 +1806,9 @@ fstream-ignore@^1.0.5: inherits "2" minimatch "^3.0.0" -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" +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" dependencies: graceful-fs "^4.1.2" inherits "~2.0.0" @@ -2064,8 +1816,8 @@ fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2: rimraf "2" gauge@~2.7.1: - version "2.7.3" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.3.tgz#1c23855f962f17b3ad3d0dc7443f304542edfe09" + version "2.7.2" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.2.tgz#15cecc31b02d05345a5d6b0e171cdb3ad2307774" dependencies: aproba "^1.0.3" console-control-strings "^1.0.0" @@ -2074,6 +1826,7 @@ 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: @@ -2090,25 +1843,16 @@ 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@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/get-port/-/get-port-3.1.0.tgz#ef01b18a84ca6486970ff99e54446141a73ffd3e" +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-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" @@ -2128,6 +1872,16 @@ 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" @@ -2140,8 +1894,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.17.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-9.17.0.tgz#0c0ca696d9b9bb694d2e5470bd37777caad50286" + version "9.14.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.14.0.tgz#8859936af0038741263053b39d0e76ca241e4034" globby@^5.0.0: version "5.0.0" @@ -2164,26 +1918,34 @@ globby@^6.0.0: pify "^2.0.0" pinkie-promise "^2.0.0" -got@^6.7.1: - version "6.7.1" - resolved "https://registry.yarnpkg.com/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" +got@^5.0.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/got/-/got-5.7.1.tgz#5f81635a61e4a6589f180569ea4e381680a51f35" dependencies: - create-error-class "^3.0.0" - duplexer3 "^0.1.4" - get-stream "^3.0.0" + create-error-class "^3.0.1" + duplexer2 "^0.1.4" is-redirect "^1.0.0" is-retry-allowed "^1.0.0" is-stream "^1.0.0" lowercase-keys "^1.0.0" - safe-buffer "^5.0.1" - timed-out "^4.0.0" - unzip-response "^2.0.1" + 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" url-parse-lax "^1.0.0" -graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6: +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4: 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" @@ -2198,16 +1960,14 @@ handlebars@^4.0.3: optionalDependencies: uglify-js "^2.6" -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" +har-validator@~2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" dependencies: - ajv "^4.9.1" - har-schema "^1.0.5" + chalk "^1.1.1" + commander "^2.9.0" + is-my-json-valid "^2.12.4" + pinkie-promise "^2.0.0" has-ansi@^2.0.0: version "2.0.0" @@ -2231,10 +1991,6 @@ 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" @@ -2255,13 +2011,9 @@ 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.4.1" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.4.1.tgz#4b0445e41c004a8bd1337773a4ff790ca40318c8" + version "2.1.5" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.1.5.tgz#0ba81d90da2e25ab34a332e6ec77936e1598118b" http-signature@~1.1.0: version "1.1.1" @@ -2271,31 +2023,13 @@ http-signature@~1.1.0: jsprim "^1.2.2" sshpk "^1.7.0" -hullabaloo-config-manager@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/hullabaloo-config-manager/-/hullabaloo-config-manager-1.0.0.tgz#70403e68afa009a577bb134306bb71b6b45aaa70" - dependencies: - dot-prop "^4.1.0" - es6-error "^4.0.2" - graceful-fs "^4.1.11" - indent-string "^3.1.0" - json5 "^0.5.1" - lodash.clonedeep "^4.5.0" - lodash.clonedeepwith "^4.5.0" - lodash.isequal "^4.5.0" - lodash.merge "^4.6.0" - md5-hex "^2.0.0" - package-hash "^2.0.0" - pkg-dir "^1.0.0" - resolve-from "^2.0.0" - -ignore-by-default@^1.0.0: +ignore-by-default@^1.0.0, ignore-by-default@^1.0.1: 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.6" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.6.tgz#26e8da0644be0bb4cb39516f6c79f0e0f4ffe48c" + version "3.2.0" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.0.tgz#8d88f03c3002a0ac52114db25d2c673b0bf1e435" imurmurhash@^0.1.4: version "0.1.4" @@ -2307,10 +2041,6 @@ 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" @@ -2345,8 +2075,8 @@ inquirer@^0.12.0: through "^2.3.6" interpret@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.2.tgz#f4f623f0bb7122f15f5717c8e254b8161b5c5b2d" + version "1.0.1" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.1.tgz#d579fb7f693b858004947af39fa0db49f795602c" invariant@^2.2.0: version "2.2.2" @@ -2373,8 +2103,8 @@ is-binary-path@^1.0.0: binary-extensions "^1.0.0" is-buffer@^1.0.2: - version "1.1.5" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc" + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.4.tgz#cfc86ccd5dc5a52fa80489111c6920c457e2d98b" is-builtin-module@^1.0.0: version "1.0.0" @@ -2436,13 +2166,9 @@ is-glob@^2.0.0, is-glob@^2.0.1: dependencies: is-extglob "^1.0.0" -is-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" - -is-my-json-valid@^2.10.0: - version "2.16.0" - resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693" +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" dependencies: generate-function "^2.0.0" generate-object-property "^1.1.0" @@ -2519,7 +2245,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.1.0: +is-stream@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -2531,21 +2257,17 @@ 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.1: +is-utf8@^0.2.0: 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@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" +isexe@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-1.1.2.tgz#36f3e22e60750920f5e7241a476a8c6a42275ad0" isobject@^2.0.0: version "2.1.0" @@ -2557,137 +2279,78 @@ 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.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.0.2.tgz#87a0c015b6910651cb3b184814dfb339337e25e1" +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-hook@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.5.tgz#6ca3d16d60c5f4082da39f7c5cd38ea8a772b88e" +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" dependencies: append-transform "^0.4.0" -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" +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" 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.2" + istanbul-lib-coverage "^1.0.0" semver "^5.3.0" -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" +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" dependencies: - istanbul-lib-coverage "^1.0.2" + async "^1.4.2" + istanbul-lib-coverage "^1.0.0-alpha" mkdirp "^0.5.1" path-parse "^1.0.5" + rimraf "^2.4.3" supports-color "^3.1.2" -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" +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" dependencies: - istanbul-lib-coverage "^1.0.2" + istanbul-lib-coverage "^1.0.0-alpha.0" mkdirp "^0.5.1" rimraf "^2.4.4" source-map "^0.5.3" -istanbul-reports@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.0.2.tgz#4e8366abe6fa746cc1cd6633f108de12cc6ac6fa" +istanbul-reports@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.0.0.tgz#24b4eb2b1d29d50f103b369bd422f6e640aa0777" 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.1" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" + version "3.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.0.tgz#a2f2a969caae142fb3cd56228358c89366957bd1" -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" +js-yaml@^3.5.1: + version "3.7.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.7.0.tgz#5c967ddd837a9bfdca5f2de84253abe8a1c03b80" dependencies: argparse "^1.0.7" - esprima "^3.1.1" + esprima "^2.6.0" jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + version "0.1.0" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.0.tgz#650987da0dd74f4ebf5a11377a2aa2d273e97dfd" jsesc@^1.3.0: version "1.3.0" @@ -2711,7 +2374,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.1: +json5@^0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" @@ -2724,10 +2387,9 @@ jsonpointer@^4.0.0: resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" jsprim@^1.2.2: - version "1.4.0" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.0.tgz#a3b87e40298d8c380552d8cc7628a0bb95a22918" + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.3.1.tgz#2a7256f70412a29ee3670aaca625994c4dcff252" dependencies: - assert-plus "1.0.0" extsprintf "1.0.2" json-schema "0.2.3" verror "1.3.6" @@ -2744,19 +2406,19 @@ last-line-stream@^1.0.0: dependencies: through2 "^2.0.0" -latest-version@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-3.1.0.tgz#a205383fea322b33b5ae3b18abee0dc2f356ee15" +latest-version@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-2.0.0.tgz#56f8d6139620847b8017f8f1f4d78e211324168b" dependencies: - package-json "^4.0.0" + package-json "^2.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@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lazy-req/-/lazy-req-2.0.0.tgz#c9450a363ecdda2e6f0c70132ad4f37f8f06f2b4" +lazy-req@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/lazy-req/-/lazy-req-1.1.0.tgz#bdaebead30f8d824039ce0ce149d4daa07ba1fac" lcid@^1.0.0: version "1.0.0" @@ -2764,10 +2426,6 @@ 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" @@ -2775,7 +2433,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.0.0, load-json-file@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" dependencies: @@ -2785,29 +2443,44 @@ load-json-file@^1.0.0: pinkie-promise "^2.0.0" strip-bom "^2.0.0" -load-json-file@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" +lodash._baseassign@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e" dependencies: - graceful-fs "^4.1.2" - parse-json "^2.2.0" - pify "^2.0.0" - strip-bom "^3.0.0" + lodash._basecopy "^3.0.0" + lodash.keys "^3.0.0" -locate-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" +lodash._basecopy@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" + +lodash._bindcallback@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e" + +lodash._createassigner@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lodash._createassigner/-/lodash._createassigner-3.1.1.tgz#838a5bae2fdaca63ac22dee8e19fa4e6d6970b11" dependencies: - p-locate "^2.0.0" - path-exists "^3.0.0" + lodash._bindcallback "^3.0.0" + lodash._isiterateecall "^3.0.0" + lodash.restparam "^3.0.0" -lodash.clonedeep@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" +lodash._getnative@^3.0.0: + version "3.9.1" + resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" -lodash.clonedeepwith@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.clonedeepwith/-/lodash.clonedeepwith-4.5.0.tgz#6ee30573a03a1a60d670a62ef33c10cf1afdbdd4" +lodash._isiterateecall@^3.0.0: + version "3.0.9" + resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" + +lodash.assign@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-3.2.0.tgz#3ce9f0234b4b2223e296b8fa0ac1fee8ebca64fa" + dependencies: + lodash._baseassign "^3.0.0" + lodash._createassigner "^3.0.0" + lodash.keys "^3.0.0" lodash.debounce@^4.0.3: version "4.0.8" @@ -2821,17 +2494,33 @@ lodash.flatten@^4.2.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f" -lodash.flattendeep@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" +lodash.isarguments@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" + +lodash.isarray@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" -lodash.isequal@^4.5.0: +lodash.isequal@^4.4.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" -lodash.merge@^4.6.0: +lodash.keys@^3.0.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" + dependencies: + lodash._getnative "^3.0.0" + lodash.isarguments "^3.0.0" + lodash.isarray "^3.0.0" + +lodash.pickby@^4.6.0: version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.0.tgz#69884ba144ac33fe699737a6086deffadd0f89c5" + resolved "https://registry.yarnpkg.com/lodash.pickby/-/lodash.pickby-4.6.0.tgz#7dea21d8c18d7703a27c704c15d3b84a67e33aff" + +lodash.restparam@^3.0.0: + version "3.6.1" + resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" lodash@^4.0.0, lodash@^4.15.0, lodash@^4.2.0, lodash@^4.3.0: version "4.17.4" @@ -2858,7 +2547,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.0, lru-cache@^4.0.1: +lru-cache@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.0.2.tgz#1d17679c069cda5d040991a09dbc2c0db377e55e" dependencies: @@ -2875,18 +2564,16 @@ 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" @@ -2930,21 +2617,17 @@ micromatch@^2.1.5, micromatch@^2.3.11: parse-glob "^3.0.4" regex-cache "^0.4.2" -mime-db@~1.27.0: - version "1.27.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.27.0.tgz#820f572296bbd20ec25ed55e5b5de869e5436eb1" +mime-db@~1.26.0: + version "1.26.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.26.0.tgz#eaffcd0e4fc6935cf8134da246e2e6c35305adff" mime-types@^2.1.12, mime-types@~2.1.7: - version "2.1.15" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.15.tgz#a4ebf5064094569237b8cf70046776d09fc92aed" + version "2.1.14" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.14.tgz#f7ef7d97583fcaf3b7d282b6f8b5679dab1e94ee" dependencies: - mime-db "~1.27.0" - -mimic-fn@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" + mime-db "~1.26.0" -minimatch@^3.0.0, minimatch@^3.0.2: +"minimatch@2 || 3", 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: @@ -2958,12 +2641,16 @@ 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 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: minimist "0.0.8" +ms@0.7.1: + 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" @@ -2982,37 +2669,40 @@ 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.1" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.5.1.tgz#d5b01691253326a97a2bbee9e61c55d8d60351e2" + version "2.5.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.5.0.tgz#aa8f1e34531d807e9e27755b234b4a6ec0c152a8" 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.34" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.34.tgz#94ad1c798a11d7fc67381b50d47f8cc18d9799f7" + version "0.6.32" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.32.tgz#fc452b376e7319b3d255f5f34853ef6fd8fe1fd5" dependencies: - mkdirp "^0.5.1" - nopt "^4.0.1" - npmlog "^4.0.2" - rc "^1.1.7" - request "^2.81.0" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^2.2.1" - tar-pack "^3.4.0" + 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" -nopt@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" +node-status-codes@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/node-status-codes/-/node-status-codes-1.0.0.tgz#5ae5541d024645d32a58fcddc9ceecea7ae3ac2f" + +nopt@~3.0.6: + version "3.0.6" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" dependencies: abbrev "1" - osenv "^0.1.4" normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: - version "2.3.6" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.6.tgz#498fa420c96401f787402ba21e600def9f981fff" + version "2.3.5" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.5.tgz#8d924f142960e1777e7ffe170543631cc7cb02df" dependencies: hosted-git-info "^2.1.4" is-builtin-module "^1.0.0" @@ -3020,24 +2710,10 @@ normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: validate-npm-package-license "^3.0.1" normalize-path@^2.0.1: - version "2.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" + version "2.0.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.0.1.tgz#47886ac1662760d4261b7d979d241709d3ce3f7a" -npmlog@^4.0.2: +npmlog@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.0.2.tgz#d03950e0e78ce1527ba26d2a7592e9348ac3e75f" dependencies: @@ -3051,8 +2727,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.2.0" - resolved "https://registry.yarnpkg.com/nyc/-/nyc-10.2.0.tgz#facd90240600c9aa4dd81ea99c2fb6a85c53de0c" + version "10.1.2" + resolved "https://registry.yarnpkg.com/nyc/-/nyc-10.1.2.tgz#ea7acaa20a235210101604f4e7d56d28453b0274" dependencies: archy "^1.0.0" arrify "^1.0.1" @@ -3064,12 +2740,12 @@ nyc@^10.0.0: find-up "^1.1.2" foreground-child "^1.5.3" glob "^7.0.6" - 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" + 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" md5-hex "^1.2.0" merge-source-map "^1.0.2" micromatch "^2.3.11" @@ -3078,8 +2754,8 @@ nyc@^10.0.0: rimraf "^2.5.4" signal-exit "^3.0.1" spawn-wrap "1.2.4" - test-exclude "^4.0.0" - yargs "^7.0.2" + test-exclude "^3.3.0" + yargs "^6.6.0" yargs-parser "^4.0.2" oauth-sign@~0.8.1: @@ -3097,29 +2773,29 @@ object.omit@^2.0.0: for-own "^0.1.4" is-extendable "^0.1.1" -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" +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" dependencies: is-observable "^0.2.0" - symbol-observable "^1.0.4" + symbol-observable "^0.2.2" -once@^1.3.0, once@^1.3.3: +once@^1.3.0: 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" @@ -3158,7 +2834,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.4: +osenv@^0.1.0: version "0.1.4" resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.4.tgz#42fe6d5953df06c8064be6f176c3d05aaaa34644" dependencies: @@ -3173,40 +2849,17 @@ output-file-sync@^1.1.0: mkdirp "^0.5.1" object-assign "^4.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: +package-hash@^1.1.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-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" +package-json@^2.0.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/package-json/-/package-json-2.4.0.tgz#0d15bd67d1cbbddbb2ca222ff2edb86bcb31a8bb" dependencies: - got "^6.7.1" + got "^5.0.0" registry-auth-token "^3.0.1" registry-url "^3.0.3" semver "^5.1.0" @@ -3220,7 +2873,7 @@ parse-glob@^3.0.4: is-extglob "^1.0.0" is-glob "^2.0.0" -parse-json@^2.2.0: +parse-json@^2.1.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: @@ -3240,10 +2893,6 @@ 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" @@ -3252,14 +2901,6 @@ 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" @@ -3272,16 +2913,6 @@ 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" @@ -3306,12 +2937,14 @@ pinkie@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" -pkg-conf@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-conf/-/pkg-conf-2.0.0.tgz#071c87650403bccfb9c627f58751bfe47c067279" +pkg-conf@^1.0.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/pkg-conf/-/pkg-conf-1.1.3.tgz#378e56d6fd13e88bfb6f4a25df7a83faabddba5b" dependencies: - find-up "^2.0.0" - load-json-file "^2.0.0" + find-up "^1.0.0" + load-json-file "^1.1.0" + object-assign "^4.0.1" + symbol "^0.2.1" pkg-dir@^1.0.0: version "1.0.0" @@ -3333,6 +2966,53 @@ 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" @@ -3345,12 +3025,6 @@ 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" @@ -3366,8 +3040,8 @@ pretty-ms@^2.0.0: plur "^1.0.0" private@^0.1.6: - version "0.1.7" - resolved "https://registry.yarnpkg.com/private/-/private-0.1.7.tgz#68ce5e8a1ef0a23bb570cc28537b5332aba63ef1" + version "0.1.6" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.6.tgz#55c6a976d0f9bafb9924851350fe47b9b5fbb7c1" process-nextick-args@~1.0.6: version "1.0.7" @@ -3385,9 +3059,9 @@ punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" -qs@~6.4.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" +qs@~6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.0.tgz#f403b264f23bc01228c74131b407f18d5ea5d442" randomatic@^1.1.3: version "1.1.6" @@ -3396,14 +3070,21 @@ 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.7: - version "1.2.1" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.1.tgz#2e03e8e42ee450b8cb3dce65be1bf8974e1dfd95" +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" dependencies: deep-extend "~0.4.0" ini "~1.3.0" minimist "^1.2.0" - strip-json-comments "~2.0.1" + 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" read-pkg-up@^1.0.1: version "1.0.1" @@ -3412,13 +3093,6 @@ 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" @@ -3427,17 +3101,21 @@ read-pkg@^1.0.0: normalize-package-data "^2.3.2" path-type "^1.0.0" -read-pkg@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" +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" dependencies: - load-json-file "^2.0.0" - normalize-package-data "^2.3.2" - path-type "^2.0.0" + 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" -"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" +readable-stream@~2.1.4: + version "2.1.5" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0" dependencies: buffer-shims "^1.0.0" core-util-is "~1.0.0" @@ -3477,23 +3155,17 @@ redent@^1.0.0: indent-string "^2.1.0" strip-indent "^1.0.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: +regenerate@^1.2.1: version "1.3.2" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.2.tgz#d1941c67bad437e1be76433add5b385f95b19260" regenerator-runtime@^0.10.0: - version "0.10.3" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.3.tgz#8c4367a904b51ea62a908ac310bf99ff90a82a3e" + version "0.10.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.1.tgz#257f41961ce44558b18f7814af48c17559f9faeb" -regenerator-transform@0.9.11: - version "0.9.11" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.9.11.tgz#3a7d067520cb7b7176769eb5ff868691befe1283" +regenerator-transform@0.9.8: + version "0.9.8" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.9.8.tgz#0f88bb2bc03932ddb7b6b7312e68078f01026d6c" dependencies: babel-runtime "^6.18.0" babel-types "^6.19.0" @@ -3514,17 +3186,6 @@ 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" @@ -3541,32 +3202,12 @@ 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" @@ -3581,18 +3222,18 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" -request@^2.81.0: - version "2.81.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" +request@>=2.42.0, request@^2.79.0: + version "2.79.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" dependencies: aws-sign2 "~0.6.0" aws4 "^1.2.1" - caseless "~0.12.0" + caseless "~0.11.0" combined-stream "~1.0.5" extend "~3.0.0" forever-agent "~0.6.1" form-data "~2.1.1" - har-validator "~4.2.1" + har-validator "~2.0.6" hawk "~3.1.3" http-signature "~1.1.0" is-typedarray "~1.0.0" @@ -3600,12 +3241,10 @@ request@^2.81.0: json-stringify-safe "~5.0.1" mime-types "~2.1.7" oauth-sign "~0.8.1" - performance-now "^0.2.0" - qs "~6.4.0" - safe-buffer "^5.0.1" + qs "~6.3.0" stringstream "~0.0.4" tough-cookie "~2.3.0" - tunnel-agent "^0.6.0" + tunnel-agent "~0.4.1" uuid "^3.0.0" require-directory@^2.1.1: @@ -3620,10 +3259,6 @@ 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" @@ -3649,11 +3284,9 @@ resolve@1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" -resolve@^1.1.6, resolve@^1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.2.tgz#1f0442c9e0cbb8136e87b9305f932f46c7f28235" - dependencies: - path-parse "^1.0.5" +resolve@^1.1.6: + version "1.2.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.2.0.tgz#9589c3f2f6149d1417a40becc1663db6ec6bc26c" restore-cursor@^1.0.1: version "1.0.1" @@ -3662,25 +3295,24 @@ 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.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" +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" 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" @@ -3690,13 +3322,12 @@ rollup-plugin-babel@^2.6.1: object-assign "^4.1.0" rollup-pluginutils "^1.5.0" -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" +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" 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: @@ -3706,15 +3337,9 @@ 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.6" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.6.tgz#e0d05497877a398c104d816d2733a718a7a94e2a" + version "0.41.4" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.4.tgz#a970580176329f9ead86854d7fd4c46de752aef8" dependencies: source-map-support "^0.4.0" @@ -3728,17 +3353,13 @@ 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@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -3750,19 +3371,9 @@ 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.7" - resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.7.tgz#b2f5c77ef97148f4b4f6e22682e10bba8667cff1" + version "0.7.6" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.6.tgz#379cccfb56b91c8601e4793356eb5382924de9ad" dependencies: glob "^7.0.0" interpret "^1.0.0" @@ -3772,7 +3383,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.2: +signal-exit@^3.0.0, signal-exit@^3.0.1: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -3794,17 +3405,17 @@ sntp@1.x.x: dependencies: hoek "2.x.x" -sort-keys@^1.1.1, sort-keys@^1.1.2: +sort-keys@^1.1.1: 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.14" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.14.tgz#9d4463772598b86271b4f523f6c1f4e02a7d6aef" + version "0.4.10" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.10.tgz#d7b19038040a14c0837a18e630a196453952b378" dependencies: - source-map "^0.5.6" + source-map "^0.5.3" source-map@^0.4.4: version "0.4.4" @@ -3812,7 +3423,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.6, source-map@~0.5.1: +source-map@^0.5.0, source-map@^0.5.3, source-map@~0.5.1: version "0.5.6" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" @@ -3846,8 +3457,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.11.0" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.11.0.tgz#2d8d5ebb4a6fab28ffba37fa62a90f4a3ea59d77" + version "1.10.2" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.10.2.tgz#d5a804ce22695515638e798dbe23273de070a5fa" dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" @@ -3860,9 +3471,9 @@ sshpk@^1.7.0: jsbn "~0.1.0" tweetnacl "~0.14.0" -stack-utils@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.0.tgz#2392cd8ddbd222492ed6c047960f7414b46c0f83" +stack-utils@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-0.4.0.tgz#940cb82fccfa84e8ff2f3fdf293fe78016beccd1" string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" @@ -3883,6 +3494,14 @@ 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" @@ -3897,12 +3516,6 @@ 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" @@ -3913,25 +3526,29 @@ 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.2.3: +supports-color@^3.1.2: version "3.2.3" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" dependencies: @@ -3941,9 +3558,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-observable@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d" +symbol@^0.2.1: + version "0.2.3" + resolved "https://registry.yarnpkg.com/symbol/-/symbol-0.2.3.tgz#3b9873b8a901e47c6efe21526a3ac372ef28bbc7" table@^3.7.8: version "3.8.3" @@ -3956,20 +3573,20 @@ table@^3.7.8: slice-ansi "0.0.4" string-width "^2.0.0" -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: +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: version "2.2.1" resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" dependencies: @@ -3977,15 +3594,15 @@ tar@^2.2.1: fstream "^1.0.2" inherits "2" -term-size@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/term-size/-/term-size-0.1.1.tgz#87360b96396cab5760963714cda0d0cbeecad9ca" +temp@~0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/temp/-/temp-0.5.1.tgz#77ab19c79aa7b593cbe4fac2441768cad987b8df" dependencies: - execa "^0.4.0" + rimraf "~2.1.4" -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" +test-exclude@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-3.3.0.tgz#7a17ca1239988c98367b0621456dbb7d4bc38977" dependencies: arrify "^1.0.1" micromatch "^2.3.11" @@ -3997,6 +3614,10 @@ text-table@^0.2.0, text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" +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" @@ -4017,9 +3638,9 @@ time-require@^0.1.2: pretty-ms "^0.2.1" text-table "^0.2.0" -timed-out@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" +timed-out@^3.0.0: + version "3.1.3" + resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-3.1.3.tgz#95860bfcc5c76c277f8f8326fd0f5b2e20eba217" to-fast-properties@^1.0.1: version "1.0.2" @@ -4031,15 +3652,15 @@ 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.0, try-resolve@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/try-resolve/-/try-resolve-1.0.1.tgz#cfde6fabd72d63e5797cfaab873abbe8e700e912" @@ -4047,11 +3668,9 @@ tryit@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" -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" +tunnel-agent@~0.4.1: + version "0.4.3" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb" tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" @@ -4063,24 +3682,28 @@ 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.8.21" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.21.tgz#1733f669ae6f82fc90c7b25ec0f5c783ee375314" + version "2.7.5" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.7.5.tgz#4612c0c7baaee2ba7c487de4904ae122079f2ca8" dependencies: + async "~0.2.6" source-map "~0.5.1" - yargs "~3.10.0" - optionalDependencies: uglify-to-browserify "~1.0.0" + yargs "~3.10.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" @@ -4092,37 +3715,6 @@ 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" @@ -4131,22 +3723,22 @@ unique-temp-dir@^1.0.0: os-tmpdir "^1.0.1" uid2 "0.0.3" -unzip-response@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" +unzip-response@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-1.0.2.tgz#b984f0877fc0a89c2c773cc1ef7b5b232b5b06fe" -update-notifier@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-2.1.0.tgz#ec0c1e53536b76647a24b77cb83966d9315123d9" +update-notifier@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-1.0.3.tgz#8f92c515482bd6831b7c93013e70f87552c7cf5a" dependencies: - boxen "^1.0.0" + boxen "^0.6.0" chalk "^1.0.0" - configstore "^3.0.0" + configstore "^2.0.0" is-npm "^1.0.0" - latest-version "^3.0.0" - lazy-req "^2.0.0" + latest-version "^2.0.0" + lazy-req "^1.1.0" semver-diff "^2.0.0" - xdg-basedir "^3.0.0" + xdg-basedir "^2.0.0" url-parse-lax@^1.0.0: version "1.0.0" @@ -4154,6 +3746,10 @@ 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" @@ -4168,13 +3764,17 @@ 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.12" - resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.0.12.tgz#73235d9f7176f8e8833fb286795445f7938d84e5" + version "2.0.11" + resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.0.11.tgz#bca8f30f0d6d60612cc2c00641e6962d42ae6881" dependencies: user-home "^1.1.1" @@ -4195,11 +3795,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.8, which@^1.2.9: - version "1.2.14" - resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" +which@^1.2.4, which@^1.2.9: + version "1.2.12" + resolved "https://registry.yarnpkg.com/which/-/which-1.2.12.tgz#de67b5e450269f194909ef23ece4ebe416fa1192" dependencies: - isexe "^2.0.0" + isexe "^1.1.1" wide-align@^1.1.0: version "1.1.0" @@ -4248,22 +3848,23 @@ write-file-atomic@^1.1.2, write-file-atomic@^1.1.4: imurmurhash "^0.1.4" slide "^1.1.5" -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" +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" 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@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/write-pkg/-/write-pkg-2.1.0.tgz#353aa44c39c48c21440f5c08ce6abd46141c9c08" +write-pkg@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/write-pkg/-/write-pkg-1.0.0.tgz#aeb8aa9d4d788e1d893dfb0854968b543a919f57" dependencies: - sort-keys "^1.1.2" - write-json-file "^2.0.0" + write-json-file "^1.1.0" write@^0.2.1: version "0.2.1" @@ -4271,9 +3872,11 @@ write@^0.2.1: dependencies: mkdirp "^0.5.1" -xdg-basedir@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" +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" xtend@^4.0.0, xtend@~4.0.1: version "4.0.1" @@ -4284,24 +3887,18 @@ y18n@^3.2.1: resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" yallist@^2.0.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + version "2.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.0.0.tgz#306c543835f09ee1a4cb23b7bce9ab341c91cdd4" -yargs-parser@^4.0.2: +yargs-parser@^4.0.2, yargs-parser@^4.2.0: version "4.2.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.2.1.tgz#29cceac0dc4f03c6c87b4a9f217dd18c9f74871c" dependencies: camelcase "^3.0.0" -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" +yargs@^6.6.0: + version "6.6.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.6.0.tgz#782ec21ef403345f830a808ca3d513af56065208" dependencies: camelcase "^3.0.0" cliui "^3.2.0" @@ -4315,7 +3912,7 @@ yargs@^7.0.2: string-width "^1.0.2" which-module "^1.0.0" y18n "^3.2.1" - yargs-parser "^5.0.0" + yargs-parser "^4.2.0" yargs@~3.10.0: version "3.10.0"