diff --git a/.eslintrc.js b/.eslintrc.js index 6ae76ac3b6cb..337e239983b8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -35,6 +35,7 @@ module.exports = { // 'comma-dangle': ['error', 'always-multiline'], + 'constructor-super': 'off', curly: ['error', 'all'], 'no-mixed-operators': 'error', 'no-console': 'error', @@ -113,7 +114,8 @@ module.exports = { ecmaFeatures: { jsx: false, }, - project: './tsconfig.base.json', + project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'], + tsconfigRootDir: __dirname, }, overrides: [ { diff --git a/.gitignore b/.gitignore index 3a06baccf6f5..582f78d2d60e 100644 --- a/.gitignore +++ b/.gitignore @@ -57,9 +57,12 @@ jspm_packages/ # next.js build output .next -.DS_Store -.idea -dist # Editor-specific metadata folders .vs + +.DS_Store +.idea +dist +*.tsbuildinfo +.watchmanconfig diff --git a/.vscode/launch.json b/.vscode/launch.json index 1c2b4b3dd803..6552aae66136 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -12,6 +12,7 @@ "program": "${workspaceFolder}/node_modules/jest/bin/jest.js", "args": [ "--runInBand", + "--no-coverage", // needs the '' around it so that the () are properly handled "'tests/(.+/)?${fileBasenameNoExtension}'" ], @@ -27,6 +28,24 @@ "program": "${workspaceFolder}/node_modules/jest/bin/jest.js", "args": [ "--runInBand", + "--no-cache", + "--no-coverage", + "${relativeFile}" + ], + "sourceMaps": true, + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen" + }, + { + "type": "node", + "request": "launch", + "name": "Run currently opened parser test", + "cwd": "${workspaceFolder}/packages/parser/", + "program": "${workspaceFolder}/node_modules/jest/bin/jest.js", + "args": [ + "--runInBand", + "--no-cache", + "--no-coverage", "${relativeFile}" ], "sourceMaps": true, diff --git a/.vscode/settings.json b/.vscode/settings.json index adcf2422e8f3..0174acc7be36 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -22,5 +22,6 @@ "javascript.preferences.importModuleSpecifier": "auto", "typescript.preferences.importModuleSpecifier": "auto", "javascript.preferences.quoteStyle": "single", - "typescript.preferences.quoteStyle": "single" + "typescript.preferences.quoteStyle": "single", + "editor.defaultFormatter": "esbenp.prettier-vscode" } diff --git a/CHANGELOG.md b/CHANGELOG.md index ac7f8e0ca8a1..f800e619f2dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,109 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.1...v2.7.0) (2019-11-11) + + +### Bug Fixes + +* **eslint-plugin:** crash fixing readonly arrays to generic ([#1172](https://github.com/typescript-eslint/typescript-eslint/issues/1172)) ([2b2f2d7](https://github.com/typescript-eslint/typescript-eslint/commit/2b2f2d7)) +* **typescript-estree:** hash code to reduce update frequency ([#1179](https://github.com/typescript-eslint/typescript-eslint/issues/1179)) ([96d1cc3](https://github.com/typescript-eslint/typescript-eslint/commit/96d1cc3)) +* **typescript-estree:** reduce bundle footprint of tsutils ([#1177](https://github.com/typescript-eslint/typescript-eslint/issues/1177)) ([c8fe515](https://github.com/typescript-eslint/typescript-eslint/commit/c8fe515)) + + +### Features + +* **eslint-plugin:** [no-unused-expressions] extend for optional chaining ([#1175](https://github.com/typescript-eslint/typescript-eslint/issues/1175)) ([57d63b7](https://github.com/typescript-eslint/typescript-eslint/commit/57d63b7)) +* **parser:** handle optional chaining in scope analysis ([#1169](https://github.com/typescript-eslint/typescript-eslint/issues/1169)) ([026ceb9](https://github.com/typescript-eslint/typescript-eslint/commit/026ceb9)) + + + + + +## [2.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.0...v2.6.1) (2019-11-04) + + +### Bug Fixes + +* **typescript-estree:** don't use typescript's synthetic default ([#1156](https://github.com/typescript-eslint/typescript-eslint/issues/1156)) ([17c956e](https://github.com/typescript-eslint/typescript-eslint/commit/17c956e)), closes [#1153](https://github.com/typescript-eslint/typescript-eslint/issues/1153) +* **typescript-estree:** fix filename handling for vue JSX + markdown ([#1127](https://github.com/typescript-eslint/typescript-eslint/issues/1127)) ([366518f](https://github.com/typescript-eslint/typescript-eslint/commit/366518f)) +* **typescript-estree:** improve comment parsing code ([#1120](https://github.com/typescript-eslint/typescript-eslint/issues/1120)) ([e54998d](https://github.com/typescript-eslint/typescript-eslint/commit/e54998d)) + + + + + +# [2.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.5.0...v2.6.0) (2019-10-28) + + +### Bug Fixes + +* **parser:** adds TTY check before logging the version mismatch warning ([#1121](https://github.com/typescript-eslint/typescript-eslint/issues/1121)) ([768ef63](https://github.com/typescript-eslint/typescript-eslint/commit/768ef63)) +* **typescript-estree:** better handle canonical paths ([#1111](https://github.com/typescript-eslint/typescript-eslint/issues/1111)) ([8dcbf4c](https://github.com/typescript-eslint/typescript-eslint/commit/8dcbf4c)) +* **typescript-estree:** correct parenthesized optional chain AST ([#1141](https://github.com/typescript-eslint/typescript-eslint/issues/1141)) ([5ae286e](https://github.com/typescript-eslint/typescript-eslint/commit/5ae286e)) +* **typescript-estree:** ensure parent pointers are set ([#1129](https://github.com/typescript-eslint/typescript-eslint/issues/1129)) ([d4703e1](https://github.com/typescript-eslint/typescript-eslint/commit/d4703e1)) +* **typescript-estree:** normalize paths to fix cache miss on windows ([#1128](https://github.com/typescript-eslint/typescript-eslint/issues/1128)) ([6d0f2ce](https://github.com/typescript-eslint/typescript-eslint/commit/6d0f2ce)) + + +### Features + +* **typescript-estree:** add support for declare class properties ([#1136](https://github.com/typescript-eslint/typescript-eslint/issues/1136)) ([1508670](https://github.com/typescript-eslint/typescript-eslint/commit/1508670)) + + + + + +# [2.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.4.0...v2.5.0) (2019-10-21) + + +### Bug Fixes + +* **eslint-plugin:** [no-magic-numbers] Support negative numbers ([#1072](https://github.com/typescript-eslint/typescript-eslint/issues/1072)) ([0c85ac3](https://github.com/typescript-eslint/typescript-eslint/commit/0c85ac3)) +* **typescript-estree:** correct semver check range ([#1109](https://github.com/typescript-eslint/typescript-eslint/issues/1109)) ([2fc9bd2](https://github.com/typescript-eslint/typescript-eslint/commit/2fc9bd2)) +* **typescript-estree:** handle running out of fs watchers ([#1088](https://github.com/typescript-eslint/typescript-eslint/issues/1088)) ([ec62747](https://github.com/typescript-eslint/typescript-eslint/commit/ec62747)) +* **typescript-estree:** parsing error for vue sfc ([#1083](https://github.com/typescript-eslint/typescript-eslint/issues/1083)) ([7a8cce6](https://github.com/typescript-eslint/typescript-eslint/commit/7a8cce6)) +* **typescript-estree:** remove now unneeded dep on chokidar ([088a691](https://github.com/typescript-eslint/typescript-eslint/commit/088a691)) + + +### Features + +* **eslint-plugin:** Support abstract members in member-ordering rule ([#395](https://github.com/typescript-eslint/typescript-eslint/issues/395)) ([#1004](https://github.com/typescript-eslint/typescript-eslint/issues/1004)) ([5f093ac](https://github.com/typescript-eslint/typescript-eslint/commit/5f093ac)) +* **typescript-estree:** support long running lint without watch ([#1106](https://github.com/typescript-eslint/typescript-eslint/issues/1106)) ([ed5564d](https://github.com/typescript-eslint/typescript-eslint/commit/ed5564d)) + + + + + +# [2.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.3...v2.4.0) (2019-10-14) + + +### Bug Fixes + +* **eslint-plugin:** [promise-function-async] Should not report… ([#1023](https://github.com/typescript-eslint/typescript-eslint/issues/1023)) ([514bed9](https://github.com/typescript-eslint/typescript-eslint/commit/514bed9)) +* support long running "watch" lint sessions ([#973](https://github.com/typescript-eslint/typescript-eslint/issues/973)) ([854620e](https://github.com/typescript-eslint/typescript-eslint/commit/854620e)) + + +### Features + +* **typescript-estree:** support for parsing 3.7 features ([#1045](https://github.com/typescript-eslint/typescript-eslint/issues/1045)) ([623febf](https://github.com/typescript-eslint/typescript-eslint/commit/623febf)) + + + + + +## [2.3.3](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.2...v2.3.3) (2019-10-07) + + +### Bug Fixes + +* **eslint-plugin:** [class-name-casing] allow unicode letters ([#1043](https://github.com/typescript-eslint/typescript-eslint/issues/1043)) ([47895c0](https://github.com/typescript-eslint/typescript-eslint/commit/47895c0)) +* **eslint-plugin:** [efrt] support constructor arguments ([#1021](https://github.com/typescript-eslint/typescript-eslint/issues/1021)) ([60943e6](https://github.com/typescript-eslint/typescript-eslint/commit/60943e6)) +* **experimental-utils:** remove Rule.meta.extraDescription ([#1036](https://github.com/typescript-eslint/typescript-eslint/issues/1036)) ([192e23d](https://github.com/typescript-eslint/typescript-eslint/commit/192e23d)) + + + + + ## [2.3.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.1...v2.3.2) (2019-09-30) diff --git a/README.md b/README.md index b57368515235..f296ee034eff 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,25 @@
+## Table of Contents + +- [Getting Started](#getting-started) +- [What are ESLint and TypeScript, and how do they compare?](#what-are-eslint-and-typescript-and-how-do-they-compare) +- [Why does this project exist?](#why-does-this-project-exist) +- [What about TSLint?](#what-about-tslint) +- [How does typescript-eslint work and why do you have multiple packages?](#how-does-typescript-eslint-work-and-why-do-you-have-multiple-packages) +- [Can I use all of the existing ESLint plugins and rules without any changes?](#can-i-use-all-of-the-existing-eslint-plugins-and-rules-without-any-changes) +- [Can we write rules which leverage type information?](#can-we-write-rules-which-leverage-type-information) +- [What about Babel and babel-eslint?](#what-about-babel-and-babel-eslint) +- [How can I help?](#how-can-i-help) +- [How do I configure my project to use typescript-eslint?](#how-do-i-configure-my-project-to-use-typescript-eslint) +- [Package Versions](#package-versions) +- [Supported TypeScript Version](#supported-typescript-version) +- [Supported ESLint version](#supported-eslint-version) +- [License](#license) +- [Contributors](#contributors) +- [Contributing Guide](#contributing-guide) + ## Getting Started The following sections will give you an overview of what this project is, why it exists and how it works at a high level. @@ -216,9 +235,9 @@ The latest version under the `canary` tag **(latest commit to master)** is: ## Supported TypeScript Version -We will always endeavor to support the latest stable version of TypeScript. Sometimes, but not always, changes in TypeScript will not require breaking changes in this project, and so we are able to support more than one version of TypeScript. +We will always endeavor to support the latest stable version of TypeScript. Sometimes, but not always, changes in TypeScript will not require breaking changes in this project, and so we are able to support more than one version of TypeScript. In some cases, we may even be able to support additional pre-releases (i.e. betas and release candidates) of TypeScript, but only if doing so does not require us to compromise on support for the latest stable version. -**The version range of TypeScript currently supported by this parser is `>=3.2.1 <3.7.0`.** +**The version range of TypeScript currently supported by this parser is `>=3.2.1 <3.8.0`.** This is reflected in the `devDependency` requirement within the package.json file, and it is what the tests will be run against. We have an open `peerDependency` requirement in order to allow for experimentation on newer/beta versions of TypeScript. @@ -228,6 +247,10 @@ If you use a non-supported version of TypeScript, the parser will log a warning
+## Supported ESLint version + +See the value of `eslint` declared in `@typescript-eslint/eslint-plugin`'s [package.json](./packages/eslint-plugin/package.json). + ## License TypeScript ESLint inherits from the the original TypeScript ESLint Parser license, as the majority of the work began there. It is licensed under a permissive BSD 2-clause license. diff --git a/lerna.json b/lerna.json index 16ca1c0d0e88..991899f51336 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.3.2", + "version": "2.7.0", "npmClient": "yarn", "useWorkspaces": true, "stream": true diff --git a/package.json b/package.json index 2dce8eb93355..559b4e792715 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "pre-push": "yarn format-check", "postinstall": "lerna bootstrap && yarn build && lerna link && npm run check-clean-workspace-after-install && opencollective-postinstall", "check-clean-workspace-after-install": "git diff --quiet --exit-code", - "test": "lerna run test --parallel", + "test": "lerna run test --concurrency 1", "typecheck": "lerna run typecheck" }, "config": { @@ -70,14 +70,16 @@ "lint-staged": "^9.2.5", "opencollective-postinstall": "^2.0.2", "prettier": "^1.18.2", - "rimraf": "^3.0.0", "ts-jest": "^24.0.0", "ts-node": "^8.3.0", "tslint": "^5.19.0", - "typescript": ">=3.2.1 <3.7.0" + "typescript": ">=3.2.1 <3.8.0 || >3.7.0-dev.0" }, "collective": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + }, + "resolutions": { + "typescript": "^3.7.0-dev.20191021" } } diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md index bebccf5ca5ef..9613287c0606 100644 --- a/packages/eslint-plugin-tslint/CHANGELOG.md +++ b/packages/eslint-plugin-tslint/CHANGELOG.md @@ -3,6 +3,62 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.1...v2.7.0) (2019-11-11) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint + + + + + +## [2.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.0...v2.6.1) (2019-11-04) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint + + + + + +# [2.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.5.0...v2.6.0) (2019-10-28) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint + + + + + +# [2.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.4.0...v2.5.0) (2019-10-21) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint + + + + + +# [2.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.3...v2.4.0) (2019-10-14) + + +### Bug Fixes + +* support long running "watch" lint sessions ([#973](https://github.com/typescript-eslint/typescript-eslint/issues/973)) ([854620e](https://github.com/typescript-eslint/typescript-eslint/commit/854620e)) + + +### Features + +* **typescript-estree:** support for parsing 3.7 features ([#1045](https://github.com/typescript-eslint/typescript-eslint/issues/1045)) ([623febf](https://github.com/typescript-eslint/typescript-eslint/commit/623febf)) + + + + + +## [2.3.3](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.2...v2.3.3) (2019-10-07) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint + + + + + ## [2.3.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.1...v2.3.2) (2019-09-30) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint diff --git a/packages/eslint-plugin-tslint/package.json b/packages/eslint-plugin-tslint/package.json index 0d1dd95c219c..b23071880ad8 100644 --- a/packages/eslint-plugin-tslint/package.json +++ b/packages/eslint-plugin-tslint/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin-tslint", - "version": "2.3.2", + "version": "2.7.0", "main": "dist/index.js", "typings": "src/index.ts", "description": "TSLint wrapper plugin for ESLint", @@ -23,15 +23,15 @@ }, "license": "MIT", "scripts": { - "build": "tsc -p tsconfig.build.json", - "clean": "rimraf dist/", + "build": "tsc -b tsconfig.build.json", + "clean": "tsc -b tsconfig.build.json --clean", "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", - "prebuild": "npm run clean", + "lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'", "test": "jest --coverage", - "typecheck": "tsc --noEmit" + "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "2.3.2", + "@typescript-eslint/experimental-utils": "2.7.0", "lodash.memoize": "^4.1.2" }, "peerDependencies": { @@ -41,6 +41,6 @@ }, "devDependencies": { "@types/lodash.memoize": "^4.1.4", - "@typescript-eslint/parser": "2.3.2" + "@typescript-eslint/parser": "2.7.0" } } diff --git a/packages/eslint-plugin-tslint/tsconfig.build.json b/packages/eslint-plugin-tslint/tsconfig.build.json index b0fced27d72d..d6987c27afe7 100644 --- a/packages/eslint-plugin-tslint/tsconfig.build.json +++ b/packages/eslint-plugin-tslint/tsconfig.build.json @@ -1,7 +1,14 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./dist" + "outDir": "./dist", + "rootDir": "./src", + "resolveJsonModule": true }, - "include": ["src"] + "include": ["src"], + "references": [ + { "path": "../experimental-utils/tsconfig.build.json" }, + { "path": "../parser/tsconfig.build.json" }, + { "path": "../typescript-estree/tsconfig.build.json" } + ] } diff --git a/packages/eslint-plugin-tslint/tsconfig.json b/packages/eslint-plugin-tslint/tsconfig.json index 7db2d0520ffa..65fc5ce65848 100644 --- a/packages/eslint-plugin-tslint/tsconfig.json +++ b/packages/eslint-plugin-tslint/tsconfig.json @@ -1,5 +1,9 @@ { "extends": "./tsconfig.build.json", + "compilerOptions": { + "composite": false, + "rootDir": "." + }, "include": ["src", "tests"], "exclude": ["tests/test-project", "tests/test-tslint-rules-directory"] } diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index d9be8637d98c..1759b88a3c13 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -3,6 +3,88 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.1...v2.7.0) (2019-11-11) + + +### Bug Fixes + +* **eslint-plugin:** crash fixing readonly arrays to generic ([#1172](https://github.com/typescript-eslint/typescript-eslint/issues/1172)) ([2b2f2d7](https://github.com/typescript-eslint/typescript-eslint/commit/2b2f2d7)) + + +### Features + +* **eslint-plugin:** [no-unused-expressions] extend for optional chaining ([#1175](https://github.com/typescript-eslint/typescript-eslint/issues/1175)) ([57d63b7](https://github.com/typescript-eslint/typescript-eslint/commit/57d63b7)) +* **parser:** handle optional chaining in scope analysis ([#1169](https://github.com/typescript-eslint/typescript-eslint/issues/1169)) ([026ceb9](https://github.com/typescript-eslint/typescript-eslint/commit/026ceb9)) + + + + + +## [2.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.0...v2.6.1) (2019-11-04) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin + + + + + +# [2.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.5.0...v2.6.0) (2019-10-28) + + +### Features + +* **typescript-estree:** add support for declare class properties ([#1136](https://github.com/typescript-eslint/typescript-eslint/issues/1136)) ([1508670](https://github.com/typescript-eslint/typescript-eslint/commit/1508670)) + + + + + +# [2.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.4.0...v2.5.0) (2019-10-21) + + +### Bug Fixes + +* **eslint-plugin:** [no-magic-numbers] Support negative numbers ([#1072](https://github.com/typescript-eslint/typescript-eslint/issues/1072)) ([0c85ac3](https://github.com/typescript-eslint/typescript-eslint/commit/0c85ac3)) + + +### Features + +* **eslint-plugin:** Support abstract members in member-ordering rule ([#395](https://github.com/typescript-eslint/typescript-eslint/issues/395)) ([#1004](https://github.com/typescript-eslint/typescript-eslint/issues/1004)) ([5f093ac](https://github.com/typescript-eslint/typescript-eslint/commit/5f093ac)) +* **typescript-estree:** support long running lint without watch ([#1106](https://github.com/typescript-eslint/typescript-eslint/issues/1106)) ([ed5564d](https://github.com/typescript-eslint/typescript-eslint/commit/ed5564d)) + + + + + +# [2.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.3...v2.4.0) (2019-10-14) + + +### Bug Fixes + +* **eslint-plugin:** [promise-function-async] Should not report… ([#1023](https://github.com/typescript-eslint/typescript-eslint/issues/1023)) ([514bed9](https://github.com/typescript-eslint/typescript-eslint/commit/514bed9)) +* support long running "watch" lint sessions ([#973](https://github.com/typescript-eslint/typescript-eslint/issues/973)) ([854620e](https://github.com/typescript-eslint/typescript-eslint/commit/854620e)) + + +### Features + +* **typescript-estree:** support for parsing 3.7 features ([#1045](https://github.com/typescript-eslint/typescript-eslint/issues/1045)) ([623febf](https://github.com/typescript-eslint/typescript-eslint/commit/623febf)) + + + + + +## [2.3.3](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.2...v2.3.3) (2019-10-07) + + +### Bug Fixes + +* **eslint-plugin:** [class-name-casing] allow unicode letters ([#1043](https://github.com/typescript-eslint/typescript-eslint/issues/1043)) ([47895c0](https://github.com/typescript-eslint/typescript-eslint/commit/47895c0)) +* **eslint-plugin:** [efrt] support constructor arguments ([#1021](https://github.com/typescript-eslint/typescript-eslint/issues/1021)) ([60943e6](https://github.com/typescript-eslint/typescript-eslint/commit/60943e6)) + + + + + ## [2.3.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.1...v2.3.2) (2019-09-30) diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index baec8f2426e6..9f82b851d29b 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -10,7 +10,7 @@ ## Installation -Make sure you have TypeScript and @typescript-eslint/parser installed, then install the plugin: +Make sure you have TypeScript and `@typescript-eslint/parser` installed, then install the plugin: ```sh npm i @typescript-eslint/eslint-plugin --save-dev @@ -145,7 +145,7 @@ Then you should add `airbnb` (or `airbnb-base`) to your `extends` section of `.e | [`@typescript-eslint/await-thenable`](./docs/rules/await-thenable.md) | Disallows awaiting a value that is not a Thenable | :heavy_check_mark: | | :thought_balloon: | | [`@typescript-eslint/ban-ts-ignore`](./docs/rules/ban-ts-ignore.md) | Bans β€œ// @ts-ignore” comments from being used | :heavy_check_mark: | | | | [`@typescript-eslint/ban-types`](./docs/rules/ban-types.md) | Bans specific types from being used | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/brace-style`](./docs/rules/brace-style.md) | Enforce consistent brace style for blocks | | :wrench: | | +| [`@typescript-eslint/brace-style`](./docs/rules/brace-style.md) | Enforce consistent brace style for blocks | | :wrench: | | | [`@typescript-eslint/camelcase`](./docs/rules/camelcase.md) | Enforce camelCase naming convention | :heavy_check_mark: | | | | [`@typescript-eslint/class-name-casing`](./docs/rules/class-name-casing.md) | Require PascalCased class and interface names | :heavy_check_mark: | | | | [`@typescript-eslint/consistent-type-assertions`](./docs/rules/consistent-type-assertions.md) | Enforces consistent usage of type assertions. | :heavy_check_mark: | | | @@ -160,6 +160,7 @@ Then you should add `airbnb` (or `airbnb-base`) to your `extends` section of `.e | [`@typescript-eslint/member-naming`](./docs/rules/member-naming.md) | Enforces naming conventions for class members by visibility | | | | | [`@typescript-eslint/member-ordering`](./docs/rules/member-ordering.md) | Require a consistent member declaration order | | | | | [`@typescript-eslint/no-array-constructor`](./docs/rules/no-array-constructor.md) | Disallow generic `Array` constructors | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/no-dynamic-delete`](./docs/rules/no-dynamic-delete.md) | Bans usage of the delete operator with computed key expressions | | :wrench: | | | [`@typescript-eslint/no-empty-function`](./docs/rules/no-empty-function.md) | Disallow empty functions | :heavy_check_mark: | | | | [`@typescript-eslint/no-empty-interface`](./docs/rules/no-empty-interface.md) | Disallow the declaration of empty interfaces | :heavy_check_mark: | | | | [`@typescript-eslint/no-explicit-any`](./docs/rules/no-explicit-any.md) | Disallow usage of the `any` type | :heavy_check_mark: | :wrench: | | @@ -181,6 +182,8 @@ Then you should add `airbnb` (or `airbnb-base`) to your `extends` section of `.e | [`@typescript-eslint/no-unnecessary-qualifier`](./docs/rules/no-unnecessary-qualifier.md) | Warns when a namespace qualifier is unnecessary | | :wrench: | :thought_balloon: | | [`@typescript-eslint/no-unnecessary-type-arguments`](./docs/rules/no-unnecessary-type-arguments.md) | Warns if an explicitly specified type argument is the default for that type parameter | | :wrench: | :thought_balloon: | | [`@typescript-eslint/no-unnecessary-type-assertion`](./docs/rules/no-unnecessary-type-assertion.md) | Warns if a type assertion does not change the type of an expression | :heavy_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-untyped-public-signature`](./docs/rules/no-untyped-public-signature.md) | Requires that all public method arguments and return type will be explicitly typed | | | | +| [`@typescript-eslint/no-unused-expressions`](./docs/rules/no-unused-expressions.md) | Disallow unused expressions | | | | | [`@typescript-eslint/no-unused-vars`](./docs/rules/no-unused-vars.md) | Disallow unused variables | :heavy_check_mark: | | | | [`@typescript-eslint/no-use-before-define`](./docs/rules/no-use-before-define.md) | Disallow the use of variables before they are defined | :heavy_check_mark: | | | | [`@typescript-eslint/no-useless-constructor`](./docs/rules/no-useless-constructor.md) | Disallow unnecessary constructors | | | | @@ -193,11 +196,12 @@ Then you should add `airbnb` (or `airbnb-base`) to your `extends` section of `.e | [`@typescript-eslint/prefer-regexp-exec`](./docs/rules/prefer-regexp-exec.md) | Prefer RegExp#exec() over String#match() if no global flag is provided | :heavy_check_mark: | | :thought_balloon: | | [`@typescript-eslint/prefer-string-starts-ends-with`](./docs/rules/prefer-string-starts-ends-with.md) | Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings | :heavy_check_mark: | :wrench: | :thought_balloon: | | [`@typescript-eslint/promise-function-async`](./docs/rules/promise-function-async.md) | Requires any function or method that returns a Promise to be marked async | | | :thought_balloon: | -| [`@typescript-eslint/quotes`](./docs/rules/quotes.md) | Enforce the consistent use of either backticks, double, or single quotes | | :wrench: | | +| [`@typescript-eslint/quotes`](./docs/rules/quotes.md) | Enforce the consistent use of either backticks, double, or single quotes | | :wrench: | | | [`@typescript-eslint/require-array-sort-compare`](./docs/rules/require-array-sort-compare.md) | Enforce giving `compare` argument to `Array#sort` | | | :thought_balloon: | | [`@typescript-eslint/require-await`](./docs/rules/require-await.md) | Disallow async functions which have no `await` expression | :heavy_check_mark: | | :thought_balloon: | | [`@typescript-eslint/restrict-plus-operands`](./docs/rules/restrict-plus-operands.md) | When adding two variables, operands must both be of type number or of type string | | | :thought_balloon: | | [`@typescript-eslint/semi`](./docs/rules/semi.md) | Require or disallow semicolons instead of ASI | | :wrench: | | +| [`@typescript-eslint/space-before-function-paren`](./docs/rules/space-before-function-paren.md) | enforce consistent spacing before `function` definition opening parenthesis | | :wrench: | | | [`@typescript-eslint/strict-boolean-expressions`](./docs/rules/strict-boolean-expressions.md) | Restricts the types allowed in boolean expressions | | | :thought_balloon: | | [`@typescript-eslint/triple-slash-reference`](./docs/rules/triple-slash-reference.md) | Sets preference level for triple slash directives versus ES6-style import declarations | :heavy_check_mark: | | | | [`@typescript-eslint/type-annotation-spacing`](./docs/rules/type-annotation-spacing.md) | Require consistent spacing around type annotations | :heavy_check_mark: | :wrench: | | diff --git a/packages/eslint-plugin/ROADMAP.md b/packages/eslint-plugin/ROADMAP.md index 06326a5439ec..2d4e37bded7e 100644 --- a/packages/eslint-plugin/ROADMAP.md +++ b/packages/eslint-plugin/ROADMAP.md @@ -60,7 +60,7 @@ | [`no-duplicate-super`] | 🌟 | [`constructor-super`][constructor-super] | | [`no-duplicate-switch-case`] | 🌟 | [`no-duplicate-case`][no-duplicate-case] | | [`no-duplicate-variable`] | 🌟 | [`no-redeclare`][no-redeclare] | -| [`no-dynamic-delete`] | πŸ›‘ | N/A | +| [`no-dynamic-delete`] | βœ… | [`@typescript-eslint/no-dynamic-delete`] | | [`no-empty`] | 🌟 | [`no-empty`][no-empty] | | [`no-eval`] | 🌟 | [`no-eval`][no-eval] | | [`no-floating-promises`] | βœ… | [`@typescript-eslint/no-floating-promises`] | @@ -169,7 +169,7 @@ | [`number-literal-format`] | πŸ›‘ | N/A | | [`object-literal-key-quotes`] | 🌟 | [`quote-props`][quote-props] | | [`object-literal-shorthand`] | 🌟 | [`object-shorthand`][object-shorthand] | -| [`one-line`] | πŸ›‘ | N/A | +| [`one-line`] | 🌟 | [`brace-style`][brace-style] or [Prettier] | | [`one-variable-per-declaration`] | 🌟 | [`one-var`][one-var] | | [`ordered-imports`] | πŸŒ“ | [`import/order`] | | [`prefer-function-over-method`] | 🌟 | [`class-methods-use-this`][class-methods-use-this] | @@ -545,6 +545,7 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- [no-undef-init]: https://eslint.org/docs/rules/no-undef-init [quote-props]: https://eslint.org/docs/rules/quote-props [object-shorthand]: https://eslint.org/docs/rules/object-shorthand +[brace-style]: https://eslint.org/docs/rules/brace-style [one-var]: https://eslint.org/docs/rules/one-var [class-methods-use-this]: https://eslint.org/docs/rules/class-methods-use-this [prefer-template]: https://eslint.org/docs/rules/prefer-template @@ -613,6 +614,7 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- [`@typescript-eslint/member-delimiter-style`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/member-delimiter-style.md [`@typescript-eslint/prefer-for-of`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-for-of.md [`@typescript-eslint/no-array-constructor`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-array-constructor.md +[`@typescript-eslint/no-dynamic-delete`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-dynamic-delete.md [`@typescript-eslint/prefer-function-type`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-function-type.md [`@typescript-eslint/prefer-readonly`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-readonly.md [`@typescript-eslint/require-await`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-await.md diff --git a/packages/eslint-plugin/docs/rules/member-ordering.md b/packages/eslint-plugin/docs/rules/member-ordering.md index 50c4a7eacd33..517673f09d68 100644 --- a/packages/eslint-plugin/docs/rules/member-ordering.md +++ b/packages/eslint-plugin/docs/rules/member-ordering.md @@ -37,6 +37,9 @@ There are multiple ways to specify the member types. The most explicit and granu 'public-instance-field', 'protected-instance-field', 'private-instance-field', + 'public-abstract-field', + 'protected-abstract-field', + 'private-abstract-field', // Constructors 'public-constructor', @@ -50,6 +53,9 @@ There are multiple ways to specify the member types. The most explicit and granu 'public-instance-method', 'protected-instance-method', 'private-instance-method', + 'public-abstract-method', + 'protected-abstract-method', + 'private-abstract-method', ] ``` @@ -57,7 +63,7 @@ Note: If you only specify some of the possible types, the non-specified ones can ### Member group types (with accessibility, ignoring scope) -It is also possible to group member types by their accessibility (`static`, `instance`), ignoring their scope. +It is also possible to group member types by their accessibility (`static`, `instance`, `abstract`), ignoring their scope. ```json5 [ @@ -85,13 +91,15 @@ Another option is to group the member types by their scope (`public`, `protected // Fields 'static-field', // = ['public-static-field', 'protected-static-field', 'private-static-field']) 'instance-field', // = ['public-instance-field', 'protected-instance-field', 'private-instance-field']) + 'abstract-field', // = ['public-abstract-field', 'protected-abstract-field', 'private-abstract-field']) // Constructors 'constructor', // = ['public-constructor', 'protected-constructor', 'private-constructor']) // Methods 'static-method', // = ['public-static-method', 'protected-static-method', 'private-static-method']) - 'instance-method', // = ['public-instance-method', 'protected-instance-method', 'private-instance-method'] + 'instance-method', // = ['public-instance-method', 'protected-instance-method', 'private-instance-method']) + 'abstract-method', // = ['public-abstract-method', 'protected-abstract-method', 'private-abstract-method']) ] ``` @@ -102,13 +110,15 @@ The third grouping option is to ignore both scope and accessibility. ```json5 [ // Fields - 'field', // = ['public-static-field', 'protected-static-field', 'private-static-field', 'public-instance-field', 'protected-instance-field', 'private-instance-field']) + 'field', // = ['public-static-field', 'protected-static-field', 'private-static-field', 'public-instance-field', 'protected-instance-field', 'private-instance-field', + // 'public-abstract-field', 'protected-abstract-field', private-abstract-field']) // Constructors // Only the accessibility of constructors is configurable. See above. // Methods - 'method', // = ['public-static-method', 'protected-static-method', 'private-static-method', 'public-instance-method', 'protected-instance-method', 'private-instance-method']) + 'method', // = ['public-static-method', 'protected-static-method', 'private-static-method', 'public-instance-method', 'protected-instance-method', 'private-instance-method', + // 'public-abstract-method', 'protected-abstract-method', 'private-abstract-method']) ] ``` @@ -127,12 +137,17 @@ The default configuration looks as follows: "protected-instance-field", "private-instance-field", + "public-abstract-field", + "protected-abstract-field", + "private-abstract-field", + "public-field", "protected-field", "private-field", "static-field", "instance-field", + "abstract-field", "field", @@ -146,12 +161,17 @@ The default configuration looks as follows: "protected-instance-method", "private-instance-method", + "public-abstract-method", + "protected-abstract-method", + "private-abstract-method", + "public-method", "protected-method", "private-method", "static-method", "instance-method", + "abstract-method", "method" ] diff --git a/packages/eslint-plugin/docs/rules/no-dynamic-delete.md b/packages/eslint-plugin/docs/rules/no-dynamic-delete.md new file mode 100644 index 000000000000..630046823387 --- /dev/null +++ b/packages/eslint-plugin/docs/rules/no-dynamic-delete.md @@ -0,0 +1,49 @@ +# Disallow the delete operator with computed key expressions (no-dynamic-delete) + +Deleting dynamically computed keys can be dangerous and in some cases not well optimized. + +## Rule Details + +Using the `delete` operator on keys that aren't runtime constants could be a sign that you're using the wrong data structures. +Using `Object`s with added and removed keys can cause occasional edge case bugs, such as if a key is named `"hasOwnProperty"`. +Consider using a `Map` or `Set` if you’re storing collections of objects. + +Examples of **correct** code wth this rule: + +```ts +const container: { [i: string]: number } = { + /* ... */ +}; + +// Constant runtime lookups by string index +delete container.aaa; + +// Constants that must be accessed by [] +delete container[7]; +delete container['-Infinity']; +``` + +Examples of **incorrect** code with this rule: + +```ts +// Can be replaced with the constant equivalents, such as container.aaa +delete container['aaa']; +delete container['Infinity']; + +// Dynamic, difficult-to-reason-about lookups +const name = 'name'; +delete container[name]; +delete container[name.toUpperCase()]; +``` + +## When Not To Use It + +When you know your keys are safe to delete, this rule can be unnecessary. +Some environments such as older browsers might not support `Map` and `Set`. + +Do not consider this rule as performance advice before profiling your code's bottlenecks. +Even repeated minor performance slowdowns likely do not significantly affect your application's general perceived speed. + +## Related to + +- TSLint: [no-dynamic-delete](https://palantir.github.io/tslint/rules/no-dynamic-delete) diff --git a/packages/eslint-plugin/docs/rules/no-type-alias.md b/packages/eslint-plugin/docs/rules/no-type-alias.md index 46230f3d3293..496188d4c0a4 100644 --- a/packages/eslint-plugin/docs/rules/no-type-alias.md +++ b/packages/eslint-plugin/docs/rules/no-type-alias.md @@ -84,6 +84,7 @@ or more of the following you may pass an object with the options set as follows: - `allowAliases` set to `"always"` will allow you to do aliasing (Defaults to `"never"`). - `allowCallbacks` set to `"always"` will allow you to use type aliases with callbacks (Defaults to `"never"`) +- `allowConstructors` set to `"always"` will allow you to use type aliases with constructors (Defaults to `"never"`) - `allowLiterals` set to `"always"` will allow you to use type aliases with literal objects (Defaults to `"never"`) - `allowMappedTypes` set to `"always"` will allow you to use type aliases as mapping tools (Defaults to `"never"`) - `allowTupleTypes` set to `"always"` will allow you to use type aliases with tuples (Defaults to `"never"`) @@ -248,6 +249,20 @@ type Foo = (name: string, age: number) => string | Person; type Foo = (name: string, age: number) => string & Person; ``` +### allowConstructors + +This applies to constructor types. + +The setting accepts the following values: + +- `"always"` or `"never"` to active or deactivate the feature. + +Examples of **correct** code for the `{ "allowConstructors": "always" }` option: + +```ts +type Foo = new () => void; +``` + ### allowLiterals This applies to literal types (`type Foo = { ... }`). diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md b/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md index ac54dba64ca3..48b98849c41e 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md @@ -59,6 +59,6 @@ The main downside to using this rule is the need for type information. ## Related To -- ESLint: [no-constant-condition](https://eslint.org/docs/rules/no-constant-condition) - this rule is essentially a stronger versison +- ESLint: [no-constant-condition](https://eslint.org/docs/rules/no-constant-condition) - `no-unnecessary-condition` is essentially a stronger version of `no-constant-condition`, but requires type information. -- [strict-boolean-expression](./strict-boolean-expressions.md) - a stricter alternative to this rule. +- [strict-boolean-expressions](./strict-boolean-expressions.md) - a more opinionated version of `no-unnecessary-condition`. `strict-boolean-expressions` enforces a specific code style, while `no-unnecessary-condition` is about correctness. diff --git a/packages/eslint-plugin/docs/rules/no-untyped-public-signature.md b/packages/eslint-plugin/docs/rules/no-untyped-public-signature.md new file mode 100644 index 000000000000..7ffafd5a5ae7 --- /dev/null +++ b/packages/eslint-plugin/docs/rules/no-untyped-public-signature.md @@ -0,0 +1,57 @@ +# Disallow untyped public methods (no-untyped-public-signature) + +public methods are meant to be used by code outside of your class. By typing both the parameters and the return type of public methods they will be more readable and easy to use. + +## Rule Details + +This rule aims to ensure that only typed public methods are declared in the code. + +The following patterns are considered warnings: + +```ts +// untyped parameter +public foo(param1): void { +} + +// untyped parameter +public foo(param1: any): void { +} + +// untyped return type +public foo(param1: string) { +} + +// untyped return type +public foo(param1: string): any { +} +``` + +The following patterns are not warnings: + +```ts +// typed public method +public foo(param1: string): void { +} + +// untyped private method +private foo(param1) { +} +``` + +## Options + +This rule, in its default state, does not require any argument. + +### ignoredMethods + +You may pass method names you would like this rule to ignore, like so: + +```cjson +{ + "@typescript-eslint/no-untyped-public-signature": ["error", { "ignoredMethods": ["ignoredMethodName"] }] +} +``` + +## When Not To Use It + +If you don't wish to type public methods. diff --git a/packages/eslint-plugin/docs/rules/no-unused-expressions.md b/packages/eslint-plugin/docs/rules/no-unused-expressions.md new file mode 100644 index 000000000000..7da998ab2c6c --- /dev/null +++ b/packages/eslint-plugin/docs/rules/no-unused-expressions.md @@ -0,0 +1,25 @@ +# require or disallow semicolons instead of ASI (semi) + +This rule aims to eliminate unused expressions which have no effect on the state of the program. + +## Rule Details + +This rule extends the base [eslint/no-unused-expressions](https://eslint.org/docs/rules/no-unused-expressions) rule. +It supports all options and features of the base rule. +This version adds support for numerous typescript features. + +## How to use + +```cjson +{ + // note you must disable the base rule as it can report incorrect errors + "no-unused-expressions": "off", + "@typescript-eslint/no-unused-expressions": ["error"] +} +``` + +## Options + +See [eslint/no-unused-expressions options](https://eslint.org/docs/rules/no-unused-expressions#options). + +Taken with ❀️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-unused-expressions.md) diff --git a/packages/eslint-plugin/docs/rules/promise-function-async.md b/packages/eslint-plugin/docs/rules/promise-function-async.md index 5ccddf45ed47..79000974cead 100644 --- a/packages/eslint-plugin/docs/rules/promise-function-async.md +++ b/packages/eslint-plugin/docs/rules/promise-function-async.md @@ -6,7 +6,7 @@ Ensures that each function is only capable of: - returning a rejected promise, or - throwing an Error object. -In contrast, non-`async` `Promise`-returning functions are technically capable of either. +In contrast, non-`async` `Promise` - returning functions are technically capable of either. Code that handles the results of those functions will often need to handle both cases, which can get complex. This rule's practice removes a requirement for creating code to handle both cases. @@ -17,18 +17,18 @@ Examples of **incorrect** code for this rule ```ts const arrowFunctionReturnsPromise = () => Promise.resolve('value'); -function functionDeturnsPromise() { - return Math.random() > 0.5 ? Promise.resolve('value') : false; +function functionReturnsPromise() { + return Promise.resolve('value'); } ``` Examples of **correct** code for this rule ```ts -const arrowFunctionReturnsPromise = async () => 'value'; +const arrowFunctionReturnsPromise = async () => Promise.resolve('value'); -async function functionDeturnsPromise() { - return Math.random() > 0.5 ? 'value' : false; +async function functionReturnsPromise() { + return Promise.resolve('value'); } ``` diff --git a/packages/eslint-plugin/docs/rules/space-before-function-paren.md b/packages/eslint-plugin/docs/rules/space-before-function-paren.md new file mode 100644 index 000000000000..df8d848c7b42 --- /dev/null +++ b/packages/eslint-plugin/docs/rules/space-before-function-paren.md @@ -0,0 +1,42 @@ +# Require or disallow a space before function parenthesis (space-before-function-paren) + +When formatting a function, whitespace is allowed between the function name or `function` keyword and the opening paren. Named functions also require a space between the `function` keyword and the function name, but anonymous functions require no whitespace. For example: + + +```ts +function withoutSpace (x) { + // ... +} + +function withSpace (x) { + // ... +} + +var anonymousWithoutSpace = function () {}; + +var anonymousWithSpace = function () {}; +``` + +Style guides may require a space after the `function` keyword for anonymous functions, while others specify no whitespace. Similarly, the space after a function name may or may not be required. + +## Rule Details + +This rule extends the base [eslint/func-call-spacing](https://eslint.org/docs/rules/space-before-function-paren) rule. +It supports all options and features of the base rule. +This version adds support for generic type parameters on function calls. + +## How to use + +```cjson +{ + // note you must disable the base rule as it can report incorrect errors + "space-before-function-paren": "off", + "@typescript-eslint/space-before-function-paren": ["error"] +} +``` + +## Options + +See [eslint/space-before-function-paren options](https://eslint.org/docs/rules/space-before-function-paren#options). + +Taken with ❀️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/space-before-function-paren.md) diff --git a/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md b/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md index 72d38f1ed66c..fd23d75cb5ef 100644 --- a/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md +++ b/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md @@ -63,4 +63,4 @@ Options may be provided as an object with: - TSLint: [strict-boolean-expressions](https://palantir.github.io/tslint/rules/strict-boolean-expressions) -- [no-unnecessary-condition](./no-unnecessary-condition.md) - a looser alternative to this rule. +- [no-unnecessary-condition](./no-unnecessary-condition.md) - essentially a less opinionated alternative to this rule. `strict-boolean-expressions` enforces a specific code style, while `no-unnecessary-condition` is about correctness. diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 3251f3b93cd9..b315da580591 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "2.3.2", + "version": "2.7.0", "description": "TypeScript plugin for ESLint", "keywords": [ "eslint", @@ -29,18 +29,18 @@ "license": "MIT", "main": "dist/index.js", "scripts": { - "build": "tsc -p tsconfig.build.json", + "build": "tsc -b tsconfig.build.json", "check:docs": "../../node_modules/.bin/ts-node --files ./tools/validate-docs/index.ts", "check:configs": "../../node_modules/.bin/ts-node --files ./tools/validate-configs/index.ts", - "clean": "rimraf dist/", + "clean": "tsc -b tsconfig.build.json --clean", "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", "generate:configs": "../../node_modules/.bin/ts-node --files tools/generate-configs.ts", - "prebuild": "npm run clean", + "lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'", "test": "jest --coverage", - "typecheck": "tsc --noEmit" + "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "2.3.2", + "@typescript-eslint/experimental-utils": "2.7.0", "eslint-utils": "^1.4.2", "functional-red-black-tree": "^1.0.1", "regexpp": "^2.0.1", @@ -58,5 +58,10 @@ "peerDependencies": { "@typescript-eslint/parser": "^2.0.0", "eslint": "^5.0.0 || ^6.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } } diff --git a/packages/eslint-plugin/src/configs/all.json b/packages/eslint-plugin/src/configs/all.json index 377f4b58f0e4..23b38b458a3b 100644 --- a/packages/eslint-plugin/src/configs/all.json +++ b/packages/eslint-plugin/src/configs/all.json @@ -26,6 +26,7 @@ "@typescript-eslint/member-ordering": "error", "no-array-constructor": "off", "@typescript-eslint/no-array-constructor": "error", + "@typescript-eslint/no-dynamic-delete": "error", "no-empty-function": "off", "@typescript-eslint/no-empty-function": "error", "@typescript-eslint/no-empty-interface": "error", @@ -50,6 +51,9 @@ "@typescript-eslint/no-unnecessary-qualifier": "error", "@typescript-eslint/no-unnecessary-type-arguments": "error", "@typescript-eslint/no-unnecessary-type-assertion": "error", + "@typescript-eslint/no-untyped-public-signature": "error", + "no-unused-expressions": "off", + "@typescript-eslint/no-unused-expressions": "error", "no-unused-vars": "off", "@typescript-eslint/no-unused-vars": "error", "no-use-before-define": "off", @@ -73,6 +77,8 @@ "@typescript-eslint/restrict-plus-operands": "error", "semi": "off", "@typescript-eslint/semi": "error", + "space-before-function-paren": "off", + "@typescript-eslint/space-before-function-paren": "error", "@typescript-eslint/strict-boolean-expressions": "error", "@typescript-eslint/triple-slash-reference": "error", "@typescript-eslint/type-annotation-spacing": "error", diff --git a/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts b/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts index b2f22b8a0aa6..6f3f31c9c6e0 100644 --- a/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts +++ b/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts @@ -90,8 +90,6 @@ export default util.createRule({ case AST_NODE_TYPES.TSTypeLiteral: return node.members; } - - return []; } /** diff --git a/packages/eslint-plugin/src/rules/array-type.ts b/packages/eslint-plugin/src/rules/array-type.ts index b9977618c40c..0ed4266a240d 100644 --- a/packages/eslint-plugin/src/rules/array-type.ts +++ b/packages/eslint-plugin/src/rules/array-type.ts @@ -146,7 +146,8 @@ export default util.createRule({ return false; } - if (node.range[0] - prevToken.range[1] > 0) { + const nextToken = sourceCode.getTokenAfter(prevToken); + if (nextToken && sourceCode.isSpaceBetweenTokens(prevToken, nextToken)) { return false; } @@ -168,6 +169,21 @@ export default util.createRule({ return 'T'; } + /** + * @param node the node to be evaluated + */ + function getTypeOpNodeRange( + node: TSESTree.Node | null, + ): [number, number] | undefined { + if (!node) { + return undefined; + } + + const firstToken = sourceCode.getFirstToken(node)!; + const nextToken = sourceCode.getTokenAfter(firstToken)!; + return [firstToken.range[0], nextToken.range[0]]; + } + return { TSArrayType(node): void { if ( @@ -208,24 +224,27 @@ export default util.createRule({ type: getMessageType(node.elementType), }, fix(fixer) { - const startText = requireWhitespaceBefore(node); const toFix = [ fixer.replaceTextRange([node.range[1] - 2, node.range[1]], '>'), - fixer.insertTextBefore( - node, - `${startText ? ' ' : ''}${isReadonly ? 'Readonly' : ''}Array<`, - ), ]; - if (typeOpNode) { - // remove the readonly operator if it exists - toFix.unshift( - fixer.removeRange([ - typeOpNode.range[0], - typeOpNode.range[0] + 'readonly '.length, - ]), + const startText = requireWhitespaceBefore(node); + const typeOpNodeRange = getTypeOpNodeRange(typeOpNode); + + if (typeOpNodeRange) { + toFix.unshift(fixer.removeRange(typeOpNodeRange)); + } else { + toFix.push( + fixer.insertTextBefore(node, `${startText ? ' ' : ''}`), ); } + toFix.push( + fixer.insertTextBefore( + node, + `${isReadonly ? 'Readonly' : ''}Array<`, + ), + ); + if (node.elementType.type === AST_NODE_TYPES.TSParenthesizedType) { const first = sourceCode.getFirstToken(node.elementType); const last = sourceCode.getLastToken(node.elementType); diff --git a/packages/eslint-plugin/src/rules/camelcase.ts b/packages/eslint-plugin/src/rules/camelcase.ts index 4bb614cba9d7..0928484b629d 100644 --- a/packages/eslint-plugin/src/rules/camelcase.ts +++ b/packages/eslint-plugin/src/rules/camelcase.ts @@ -72,23 +72,28 @@ export default util.createRule({ * @private */ function isTSPropertyType(node: TSESTree.Node): boolean { - if (!node.parent) { - return false; - } - if (TS_PROPERTY_TYPES.includes(node.parent.type)) { + if (TS_PROPERTY_TYPES.includes(node.type)) { return true; } - if (node.parent.type === AST_NODE_TYPES.AssignmentPattern) { + if (node.type === AST_NODE_TYPES.AssignmentPattern) { return ( - node.parent.parent !== undefined && - TS_PROPERTY_TYPES.includes(node.parent.parent.type) + node.parent !== undefined && + TS_PROPERTY_TYPES.includes(node.parent.type) ); } return false; } + function report(node: TSESTree.Identifier): void { + context.report({ + node, + messageId: 'notCamelCase', + data: { name: node.name }, + }); + } + return { Identifier(node): void { /* @@ -103,13 +108,24 @@ export default util.createRule({ } // Check TypeScript specific nodes - if (isTSPropertyType(node)) { + const parent = node.parent; + if (parent && isTSPropertyType(parent)) { if (properties === 'always' && isUnderscored(name)) { - context.report({ - node, - messageId: 'notCamelCase', - data: { name: node.name }, - }); + report(node); + } + + return; + } + + if (parent && parent.type === AST_NODE_TYPES.OptionalMemberExpression) { + // Report underscored object names + if ( + properties === 'always' && + parent.object.type === AST_NODE_TYPES.Identifier && + parent.object.name === node.name && + isUnderscored(name) + ) { + report(node); } return; diff --git a/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts b/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts index 56909f15fa7e..7bbdd6522e00 100644 --- a/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts +++ b/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts @@ -92,7 +92,6 @@ const KNOWN_NODES = new Set([ AST_NODE_TYPES.WithStatement, AST_NODE_TYPES.YieldExpression, AST_NODE_TYPES.JSXIdentifier, - AST_NODE_TYPES.JSXNamespacedName, AST_NODE_TYPES.JSXMemberExpression, AST_NODE_TYPES.JSXEmptyExpression, AST_NODE_TYPES.JSXExpressionContainer, @@ -164,7 +163,7 @@ const KNOWN_NODES = new Set([ 'TSPlusToken', AST_NODE_TYPES.TSPropertySignature, AST_NODE_TYPES.TSQualifiedName, - AST_NODE_TYPES.TSQuestionToken, + 'TSQuestionToken', AST_NODE_TYPES.TSRestType, AST_NODE_TYPES.TSThisType, AST_NODE_TYPES.TSTupleType, diff --git a/packages/eslint-plugin/src/rules/indent.ts b/packages/eslint-plugin/src/rules/indent.ts index 2c135fea6a71..704bc09dc65b 100644 --- a/packages/eslint-plugin/src/rules/indent.ts +++ b/packages/eslint-plugin/src/rules/indent.ts @@ -69,7 +69,7 @@ const KNOWN_NODES = new Set([ 'TSPlusToken', AST_NODE_TYPES.TSPropertySignature, AST_NODE_TYPES.TSQualifiedName, - AST_NODE_TYPES.TSQuestionToken, + 'TSQuestionToken', AST_NODE_TYPES.TSRestType, AST_NODE_TYPES.TSThisType, AST_NODE_TYPES.TSTupleType, @@ -163,6 +163,7 @@ export default util.createRule({ type, static: false, readonly: false, + declare: false, ...base, } as TSESTree.ClassProperty; } @@ -292,7 +293,7 @@ export default util.createRule({ range: moduleReference.range, loc: moduleReference.loc, }, - }, + } as TSESTree.VariableDeclarator, ], // location data @@ -313,6 +314,8 @@ export default util.createRule({ parent: node.parent, range: node.range, loc: node.loc, + optional: false, + computed: true, }); }, @@ -420,6 +423,8 @@ export default util.createRule({ parent: node.parent, range: node.range, loc: node.loc, + optional: false, + computed: false, }); }, diff --git a/packages/eslint-plugin/src/rules/index.ts b/packages/eslint-plugin/src/rules/index.ts index 5302abd05de0..35f2d7582912 100644 --- a/packages/eslint-plugin/src/rules/index.ts +++ b/packages/eslint-plugin/src/rules/index.ts @@ -18,6 +18,7 @@ import memberDelimiterStyle from './member-delimiter-style'; import memberNaming from './member-naming'; import memberOrdering from './member-ordering'; import noArrayConstructor from './no-array-constructor'; +import noDynamicDelete from './no-dynamic-delete'; import noEmptyFunction from './no-empty-function'; import noEmptyInterface from './no-empty-interface'; import noExplicitAny from './no-explicit-any'; @@ -39,6 +40,8 @@ import noUnnecessaryCondition from './no-unnecessary-condition'; import noUnnecessaryQualifier from './no-unnecessary-qualifier'; import noUnnecessaryTypeAssertion from './no-unnecessary-type-assertion'; import noUnusedVars from './no-unused-vars'; +import noUntypedPublicSignature from './no-untyped-public-signature'; +import noUnusedExpressions from './no-unused-expressions'; import noUseBeforeDefine from './no-use-before-define'; import noUselessConstructor from './no-useless-constructor'; import noVarRequires from './no-var-requires'; @@ -55,6 +58,7 @@ import requireArraySortCompare from './require-array-sort-compare'; import requireAwait from './require-await'; import restrictPlusOperands from './restrict-plus-operands'; import semi from './semi'; +import spaceBeforeFunctionParen from './space-before-function-paren'; import strictBooleanExpressions from './strict-boolean-expressions'; import tripleSlashReference from './triple-slash-reference'; import typeAnnotationSpacing from './type-annotation-spacing'; @@ -84,6 +88,7 @@ export default { 'member-naming': memberNaming, 'member-ordering': memberOrdering, 'no-array-constructor': noArrayConstructor, + 'no-dynamic-delete': noDynamicDelete, 'no-empty-function': noEmptyFunction, 'no-empty-interface': noEmptyInterface, 'no-explicit-any': noExplicitAny, @@ -105,7 +110,9 @@ export default { 'no-unnecessary-qualifier': noUnnecessaryQualifier, 'no-unnecessary-type-arguments': useDefaultTypeParameter, 'no-unnecessary-type-assertion': noUnnecessaryTypeAssertion, + 'no-untyped-public-signature': noUntypedPublicSignature, 'no-unused-vars': noUnusedVars, + 'no-unused-expressions': noUnusedExpressions, 'no-use-before-define': noUseBeforeDefine, 'no-useless-constructor': noUselessConstructor, 'no-var-requires': noVarRequires, @@ -122,6 +129,7 @@ export default { 'require-await': requireAwait, 'restrict-plus-operands': restrictPlusOperands, semi: semi, + 'space-before-function-paren': spaceBeforeFunctionParen, 'strict-boolean-expressions': strictBooleanExpressions, 'triple-slash-reference': tripleSlashReference, 'type-annotation-spacing': typeAnnotationSpacing, diff --git a/packages/eslint-plugin/src/rules/member-ordering.ts b/packages/eslint-plugin/src/rules/member-ordering.ts index 72020afc6008..b17076856949 100644 --- a/packages/eslint-plugin/src/rules/member-ordering.ts +++ b/packages/eslint-plugin/src/rules/member-ordering.ts @@ -24,8 +24,8 @@ const allMemberTypes = ['field', 'method', 'constructor'].reduce( all.push(`${accessibility}-${type}`); // e.g. `public-field` if (type !== 'constructor') { - // There is no `static-constructor` or `instance-constructor - ['static', 'instance'].forEach(scope => { + // There is no `static-constructor` or `instance-constructor or `abstract-constructor` + ['static', 'instance', 'abstract'].forEach(scope => { if (!all.includes(`${scope}-${type}`)) { all.push(`${scope}-${type}`); } @@ -138,12 +138,17 @@ export default util.createRule({ 'protected-instance-field', 'private-instance-field', + 'public-abstract-field', + 'protected-abstract-field', + 'private-abstract-field', + 'public-field', 'protected-field', 'private-field', 'static-field', 'instance-field', + 'abstract-field', 'field', @@ -157,12 +162,17 @@ export default util.createRule({ 'protected-instance-method', 'private-instance-method', + 'public-abstract-method', + 'protected-abstract-method', + 'private-abstract-method', + 'public-method', 'protected-method', 'private-method', 'static-method', 'instance-method', + 'abstract-method', 'method', ], @@ -185,15 +195,15 @@ export default util.createRule({ ): string | null { // TODO: add missing TSCallSignatureDeclaration // TODO: add missing TSIndexSignature - // TODO: add missing TSAbstractClassProperty - // TODO: add missing TSAbstractMethodDefinition switch (node.type) { + case AST_NODE_TYPES.TSAbstractMethodDefinition: case AST_NODE_TYPES.MethodDefinition: return node.kind; case AST_NODE_TYPES.TSMethodSignature: return 'method'; case AST_NODE_TYPES.TSConstructSignatureDeclaration: return 'constructor'; + case AST_NODE_TYPES.TSAbstractClassProperty: case AST_NODE_TYPES.ClassProperty: return node.value && functionExpressions.includes(node.value.type) ? 'method' @@ -215,8 +225,10 @@ export default util.createRule({ switch (node.type) { case AST_NODE_TYPES.TSPropertySignature: case AST_NODE_TYPES.TSMethodSignature: + case AST_NODE_TYPES.TSAbstractClassProperty: case AST_NODE_TYPES.ClassProperty: return util.getNameFromPropertyName(node.key); + case AST_NODE_TYPES.TSAbstractMethodDefinition: case AST_NODE_TYPES.MethodDefinition: return node.kind === 'constructor' ? 'constructor' @@ -268,7 +280,16 @@ export default util.createRule({ return order.length - 1; } - const scope = 'static' in node && node.static ? 'static' : 'instance'; + const abstract = + node.type === 'TSAbstractClassProperty' || + node.type === 'TSAbstractMethodDefinition'; + + const scope = + 'static' in node && node.static + ? 'static' + : abstract + ? 'abstract' + : 'instance'; const accessibility = 'accessibility' in node && node.accessibility ? node.accessibility diff --git a/packages/eslint-plugin/src/rules/no-dynamic-delete.ts b/packages/eslint-plugin/src/rules/no-dynamic-delete.ts new file mode 100644 index 000000000000..0ee1636ea643 --- /dev/null +++ b/packages/eslint-plugin/src/rules/no-dynamic-delete.ts @@ -0,0 +1,109 @@ +import { + TSESTree, + AST_NODE_TYPES, + TSESLint, +} from '@typescript-eslint/experimental-utils'; +import * as tsutils from 'tsutils'; +import * as util from '../util'; + +export default util.createRule({ + name: 'no-dynamic-delete', + meta: { + docs: { + category: 'Best Practices', + description: + 'Bans usage of the delete operator with computed key expressions', + recommended: false, + }, + fixable: 'code', + messages: { + dynamicDelete: 'Do not delete dynamically computed property keys.', + }, + schema: [], + type: 'suggestion', + }, + defaultOptions: [], + create(context) { + function createFixer( + member: TSESTree.MemberExpression, + ): TSESLint.ReportFixFunction | undefined { + if ( + member.property.type === AST_NODE_TYPES.Literal && + typeof member.property.value === 'string' + ) { + return createPropertyReplacement( + member.property, + member.property.value, + ); + } + + if (member.property.type === AST_NODE_TYPES.Identifier) { + return createPropertyReplacement(member.property, member.property.name); + } + + return undefined; + } + + return { + 'UnaryExpression[operator=delete]'(node: TSESTree.UnaryExpression): void { + if ( + node.argument.type !== AST_NODE_TYPES.MemberExpression || + !node.argument.computed || + isNecessaryDynamicAccess( + diveIntoWrapperExpressions(node.argument.property), + ) + ) { + return; + } + + context.report({ + fix: createFixer(node.argument), + messageId: 'dynamicDelete', + node: node.argument.property, + }); + }, + }; + + function createPropertyReplacement( + property: TSESTree.Expression, + replacement: string, + ) { + return (fixer: TSESLint.RuleFixer): TSESLint.RuleFix => + fixer.replaceTextRange(getTokenRange(property), `.${replacement}`); + } + + function getTokenRange(property: TSESTree.Expression): [number, number] { + const sourceCode = context.getSourceCode(); + + return [ + sourceCode.getTokenBefore(property)!.range[0], + sourceCode.getTokenAfter(property)!.range[1], + ]; + } + }, +}); + +function diveIntoWrapperExpressions( + node: TSESTree.Expression, +): TSESTree.Expression { + if (node.type === AST_NODE_TYPES.UnaryExpression) { + return diveIntoWrapperExpressions(node.argument); + } + + return node; +} + +function isNecessaryDynamicAccess(property: TSESTree.Expression): boolean { + if (property.type !== AST_NODE_TYPES.Literal) { + return false; + } + + if (typeof property.value === 'number') { + return true; + } + + return ( + typeof property.value === 'string' && + !tsutils.isValidPropertyAccess(property.value) + ); +} diff --git a/packages/eslint-plugin/src/rules/no-magic-numbers.ts b/packages/eslint-plugin/src/rules/no-magic-numbers.ts index 01a2505498f6..e3597cf83485 100644 --- a/packages/eslint-plugin/src/rules/no-magic-numbers.ts +++ b/packages/eslint-plugin/src/rules/no-magic-numbers.ts @@ -160,11 +160,23 @@ export default util.createRule({ * @private */ function isParentTSReadonlyClassProperty(node: TSESTree.Node): boolean { - return ( - !!node.parent && + if ( + node.parent && + node.parent.type === AST_NODE_TYPES.UnaryExpression && + ['-', '+'].includes(node.parent.operator) + ) { + node = node.parent; + } + + if ( + node.parent && node.parent.type === AST_NODE_TYPES.ClassProperty && - !!node.parent.readonly - ); + node.parent.readonly + ) { + return true; + } + + return false; } return { @@ -174,13 +186,6 @@ export default util.createRule({ return; } - if ( - options.ignoreReadonlyClassProperties && - isParentTSReadonlyClassProperty(node) - ) { - return; - } - // Check TypeScript specific nodes for Numeric Literal if ( options.ignoreNumericLiteralTypes && @@ -190,6 +195,34 @@ export default util.createRule({ return; } + // Check if the node is a readonly class property + if (isNumber(node) && isParentTSReadonlyClassProperty(node)) { + if (options.ignoreReadonlyClassProperties) { + return; + } + + let fullNumberNode: + | TSESTree.Literal + | TSESTree.UnaryExpression = node; + let raw = node.raw; + + if ( + node.parent && + node.parent.type === AST_NODE_TYPES.UnaryExpression + ) { + fullNumberNode = node.parent; + raw = `${node.parent.operator}${node.raw}`; + } + + context.report({ + messageId: 'noMagic', + node: fullNumberNode, + data: { raw }, + }); + + return; + } + // Let the base rule deal with the rest rules.Literal(node); }, diff --git a/packages/eslint-plugin/src/rules/no-type-alias.ts b/packages/eslint-plugin/src/rules/no-type-alias.ts index 38816b60a2fa..f10fbeaf3c9a 100644 --- a/packages/eslint-plugin/src/rules/no-type-alias.ts +++ b/packages/eslint-plugin/src/rules/no-type-alias.ts @@ -22,6 +22,7 @@ type Options = [ { allowAliases?: Values; allowCallbacks?: 'always' | 'never'; + allowConstructors?: 'always' | 'never'; allowLiterals?: Values; allowMappedTypes?: Values; allowTupleTypes?: Values; @@ -62,6 +63,9 @@ export default util.createRule({ allowCallbacks: { enum: ['always', 'never'], }, + allowConstructors: { + enum: ['always', 'never'], + }, allowLiterals: { enum: enumValues, }, @@ -80,6 +84,7 @@ export default util.createRule({ { allowAliases: 'never', allowCallbacks: 'never', + allowConstructors: 'never', allowLiterals: 'never', allowMappedTypes: 'never', allowTupleTypes: 'never', @@ -91,6 +96,7 @@ export default util.createRule({ { allowAliases, allowCallbacks, + allowConstructors, allowLiterals, allowMappedTypes, allowTupleTypes, @@ -220,6 +226,15 @@ export default util.createRule({ if (allowCallbacks === 'never') { reportError(type.node, type.compositionType, isTopLevel, 'Callbacks'); } + } else if (type.node.type === AST_NODE_TYPES.TSConstructorType) { + if (allowConstructors === 'never') { + reportError( + type.node, + type.compositionType, + isTopLevel, + 'Constructors', + ); + } } else if (type.node.type === AST_NODE_TYPES.TSTypeLiteral) { // literal object type checkAndReport(allowLiterals!, isTopLevel, type, 'Literals'); diff --git a/packages/eslint-plugin/src/rules/no-untyped-public-signature.ts b/packages/eslint-plugin/src/rules/no-untyped-public-signature.ts new file mode 100644 index 000000000000..2ecb1cbd62c6 --- /dev/null +++ b/packages/eslint-plugin/src/rules/no-untyped-public-signature.ts @@ -0,0 +1,120 @@ +import * as util from '../util'; +import { + AST_NODE_TYPES, + TSESTree, +} from '@typescript-eslint/experimental-utils'; + +type MessageIds = 'noReturnType' | 'untypedParameter'; + +type Options = [{ ignoredMethods: string[] }]; + +export default util.createRule({ + name: 'no-unused-public-signature', + meta: { + docs: { + description: + 'Requires that all public method arguments and return type will be explicitly typed', + category: 'Best Practices', + recommended: false, + }, + messages: { + noReturnType: 'Public method has no return type', + untypedParameter: 'Public method parameters should be typed', + }, + schema: [ + { + allowAdditionalProperties: false, + properties: { + ignoredMethods: { + type: 'array', + items: { + type: 'string', + }, + }, + }, + type: 'object', + }, + ], + type: 'suggestion', + }, + defaultOptions: [{ ignoredMethods: [] }], + create(context, [options]) { + const ignoredMethods = new Set(options.ignoredMethods); + + function isPublicMethod( + node: TSESTree.MethodDefinition | TSESTree.TSAbstractMethodDefinition, + ): boolean { + return node.accessibility === 'public' || !node.accessibility; + } + + function isIgnoredMethod( + node: TSESTree.MethodDefinition | TSESTree.TSAbstractMethodDefinition, + ignoredMethods: Set, + ): boolean { + if ( + node.key.type === AST_NODE_TYPES.Literal && + typeof node.key.value === 'string' + ) { + return ignoredMethods.has(node.key.value); + } + if ( + node.key.type === AST_NODE_TYPES.TemplateLiteral && + node.key.expressions.length === 0 + ) { + return ignoredMethods.has(node.key.quasis[0].value.raw); + } + if (node.key.type === AST_NODE_TYPES.Identifier && !node.computed) { + return ignoredMethods.has(node.key.name); + } + + return false; + } + + function isParamTyped(node: TSESTree.Identifier): boolean { + return ( + !!node.typeAnnotation && + node.typeAnnotation.typeAnnotation.type !== AST_NODE_TYPES.TSAnyKeyword + ); + } + + function isReturnTyped( + node: TSESTree.TSTypeAnnotation | undefined, + ): boolean { + if (!node) { + return false; + } + return ( + node.typeAnnotation && + node.typeAnnotation.type !== AST_NODE_TYPES.TSAnyKeyword + ); + } + + return { + 'TSAbstractMethodDefinition, MethodDefinition'( + node: TSESTree.MethodDefinition | TSESTree.TSAbstractMethodDefinition, + ): void { + if (isPublicMethod(node) && !isIgnoredMethod(node, ignoredMethods)) { + const paramIdentifiers = node.value.params.filter( + param => param.type === AST_NODE_TYPES.Identifier, + ) as TSESTree.Identifier[]; + const identifiersHaveTypes = paramIdentifiers.every(isParamTyped); + if (!identifiersHaveTypes) { + context.report({ + node, + messageId: 'untypedParameter', + data: {}, + }); + } + + if (!isReturnTyped(node.value.returnType)) { + context.report({ + node, + messageId: 'noReturnType', + data: {}, + }); + } + } + }, + }; + }, +}); diff --git a/packages/eslint-plugin/src/rules/no-unused-expressions.ts b/packages/eslint-plugin/src/rules/no-unused-expressions.ts new file mode 100644 index 000000000000..f7d86f50c1c7 --- /dev/null +++ b/packages/eslint-plugin/src/rules/no-unused-expressions.ts @@ -0,0 +1,33 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'; +import baseRule from 'eslint/lib/rules/no-unused-expressions'; +import * as util from '../util'; + +export default util.createRule({ + name: 'no-unused-expressions', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow unused expressions', + category: 'Best Practices', + recommended: false, + }, + schema: baseRule.meta.schema, + messages: { + expected: + 'Expected an assignment or function call and instead saw an expression.', + }, + }, + defaultOptions: [], + create(context) { + const rules = baseRule.create(context); + + return { + ExpressionStatement(node): void { + if (node.expression.type === AST_NODE_TYPES.OptionalCallExpression) { + return; + } + rules.ExpressionStatement(node); + }, + }; + }, +}); diff --git a/packages/eslint-plugin/src/rules/prefer-readonly.ts b/packages/eslint-plugin/src/rules/prefer-readonly.ts index 280213dde0f3..3daa37e14dd7 100644 --- a/packages/eslint-plugin/src/rules/prefer-readonly.ts +++ b/packages/eslint-plugin/src/rules/prefer-readonly.ts @@ -162,7 +162,9 @@ export default util.createRule({ function getEsNodesFromViolatingNode( violatingNode: ParameterOrPropertyDeclaration, ): { esNode: TSESTree.Node; nameNode: TSESTree.Node } { - if (ts.isParameterPropertyDeclaration(violatingNode)) { + if ( + ts.isParameterPropertyDeclaration(violatingNode, violatingNode.parent) + ) { return { esNode: parserServices.tsNodeToESTreeNodeMap.get(violatingNode.name), nameNode: parserServices.tsNodeToESTreeNodeMap.get( diff --git a/packages/eslint-plugin/src/rules/promise-function-async.ts b/packages/eslint-plugin/src/rules/promise-function-async.ts index 1575cf02dfce..d907f3d45a55 100644 --- a/packages/eslint-plugin/src/rules/promise-function-async.ts +++ b/packages/eslint-plugin/src/rules/promise-function-async.ts @@ -98,7 +98,11 @@ export default util.createRule({ const returnType = checker.getReturnTypeOfSignature(signatures[0]); if ( - !util.containsTypeByName(returnType, allowAny!, allAllowedPromiseNames) + !util.containsAllTypesByName( + returnType, + allowAny!, + allAllowedPromiseNames, + ) ) { return; } diff --git a/packages/eslint-plugin/src/rules/space-before-function-paren.ts b/packages/eslint-plugin/src/rules/space-before-function-paren.ts new file mode 100644 index 000000000000..1def91e08f25 --- /dev/null +++ b/packages/eslint-plugin/src/rules/space-before-function-paren.ts @@ -0,0 +1,180 @@ +import { + TSESTree, + AST_NODE_TYPES, +} from '@typescript-eslint/experimental-utils'; +import { isOpeningParenToken } from 'eslint-utils'; +import * as util from '../util'; + +type Option = 'never' | 'always'; +type FuncOption = Option | 'ignore'; + +export type Options = [ + + | Option + | Partial<{ + anonymous: FuncOption; + named: FuncOption; + asyncArrow: FuncOption; + }>, +]; +export type MessageIds = 'unexpected' | 'missing'; + +export default util.createRule({ + name: 'space-before-function-paren', + meta: { + type: 'layout', + docs: { + description: + 'enforce consistent spacing before `function` definition opening parenthesis', + category: 'Stylistic Issues', + recommended: false, + }, + fixable: 'whitespace', + schema: [ + { + oneOf: [ + { + enum: ['always', 'never'], + }, + { + type: 'object', + properties: { + anonymous: { + enum: ['always', 'never', 'ignore'], + }, + named: { + enum: ['always', 'never', 'ignore'], + }, + asyncArrow: { + enum: ['always', 'never', 'ignore'], + }, + }, + additionalProperties: false, + }, + ], + }, + ], + messages: { + unexpected: 'Unexpected space before function parentheses.', + missing: 'Missing space before function parentheses.', + }, + }, + defaultOptions: ['always'], + + create(context) { + const sourceCode = context.getSourceCode(); + const baseConfig = + typeof context.options[0] === 'string' ? context.options[0] : 'always'; + const overrideConfig = + typeof context.options[0] === 'object' ? context.options[0] : {}; + + /** + * Determines whether a function has a name. + * @param {ASTNode} node The function node. + * @returns {boolean} Whether the function has a name. + */ + function isNamedFunction( + node: + | TSESTree.ArrowFunctionExpression + | TSESTree.FunctionDeclaration + | TSESTree.FunctionExpression, + ): boolean { + if (node.id) { + return true; + } + + const parent = node.parent!; + + return ( + parent.type === 'MethodDefinition' || + (parent.type === 'Property' && + (parent.kind === 'get' || parent.kind === 'set' || parent.method)) + ); + } + + /** + * Gets the config for a given function + * @param {ASTNode} node The function node + * @returns {string} "always", "never", or "ignore" + */ + function getConfigForFunction( + node: + | TSESTree.ArrowFunctionExpression + | TSESTree.FunctionDeclaration + | TSESTree.FunctionExpression, + ): FuncOption { + if (node.type === AST_NODE_TYPES.ArrowFunctionExpression) { + // Always ignore non-async functions and arrow functions without parens, e.g. async foo => bar + if ( + node.async && + isOpeningParenToken(sourceCode.getFirstToken(node, { skip: 1 })!) + ) { + return overrideConfig.asyncArrow || baseConfig; + } + } else if (isNamedFunction(node)) { + return overrideConfig.named || baseConfig; + + // `generator-star-spacing` should warn anonymous generators. E.g. `function* () {}` + } else if (!node.generator) { + return overrideConfig.anonymous || baseConfig; + } + + return 'ignore'; + } + + /** + * Checks the parens of a function node + * @param {ASTNode} node A function node + * @returns {void} + */ + function checkFunction( + node: + | TSESTree.ArrowFunctionExpression + | TSESTree.FunctionDeclaration + | TSESTree.FunctionExpression, + ): void { + const functionConfig = getConfigForFunction(node); + + if (functionConfig === 'ignore') { + return; + } + + let leftToken: TSESTree.Token, rightToken: TSESTree.Token; + if (node.typeParameters) { + leftToken = sourceCode.getLastToken(node.typeParameters)!; + rightToken = sourceCode.getTokenAfter(leftToken)!; + } else { + rightToken = sourceCode.getFirstToken(node, isOpeningParenToken)!; + leftToken = sourceCode.getTokenBefore(rightToken)!; + } + const hasSpacing = sourceCode.isSpaceBetweenTokens(leftToken, rightToken); + + if (hasSpacing && functionConfig === 'never') { + context.report({ + node, + loc: leftToken.loc.end, + messageId: 'unexpected', + fix: fixer => + fixer.removeRange([leftToken.range[1], rightToken.range[0]]), + }); + } else if ( + !hasSpacing && + functionConfig === 'always' && + (!node.typeParameters || node.id) + ) { + context.report({ + node, + loc: leftToken.loc.end, + messageId: 'missing', + fix: fixer => fixer.insertTextAfter(leftToken, ' '), + }); + } + } + + return { + ArrowFunctionExpression: checkFunction, + FunctionDeclaration: checkFunction, + FunctionExpression: checkFunction, + }; + }, +}); diff --git a/packages/eslint-plugin/src/util/misc.ts b/packages/eslint-plugin/src/util/misc.ts index cae887c229f1..58c41249d473 100644 --- a/packages/eslint-plugin/src/util/misc.ts +++ b/packages/eslint-plugin/src/util/misc.ts @@ -96,7 +96,10 @@ export function findFirstResult( * or ClassProperty node, with handling for computed property names. */ export function getNameFromClassMember( - methodDefinition: TSESTree.MethodDefinition | TSESTree.ClassProperty, + methodDefinition: + | TSESTree.MethodDefinition + | TSESTree.ClassProperty + | TSESTree.TSAbstractMethodDefinition, sourceCode: TSESLint.SourceCode, ): string { if (keyCanBeReadAsPropertyName(methodDefinition.key)) { diff --git a/packages/eslint-plugin/src/util/types.ts b/packages/eslint-plugin/src/util/types.ts index 6f769d7f950a..72213da6ebbf 100644 --- a/packages/eslint-plugin/src/util/types.ts +++ b/packages/eslint-plugin/src/util/types.ts @@ -8,9 +8,9 @@ import ts from 'typescript'; /** * @param type Type being checked by name. * @param allowedNames Symbol names checking on the type. - * @returns Whether the type is, extends, or contains any of the allowed names. + * @returns Whether the type is, extends, or contains all of the allowed names. */ -export function containsTypeByName( +export function containsAllTypesByName( type: ts.Type, allowAny: boolean, allowedNames: Set, @@ -31,13 +31,16 @@ export function containsTypeByName( } if (isUnionOrIntersectionType(type)) { - return type.types.some(t => containsTypeByName(t, allowAny, allowedNames)); + return type.types.every(t => + containsAllTypesByName(t, allowAny, allowedNames), + ); } const bases = type.getBaseTypes(); return ( typeof bases !== 'undefined' && - bases.some(t => containsTypeByName(t, allowAny, allowedNames)) + bases.length > 0 && + bases.every(t => containsAllTypesByName(t, allowAny, allowedNames)) ); } diff --git a/packages/eslint-plugin/tests/RuleTester.ts b/packages/eslint-plugin/tests/RuleTester.ts index 978adc109669..7d8bdb2c6955 100644 --- a/packages/eslint-plugin/tests/RuleTester.ts +++ b/packages/eslint-plugin/tests/RuleTester.ts @@ -1,4 +1,5 @@ import { TSESLint, ESLintUtils } from '@typescript-eslint/experimental-utils'; +import { clearCaches } from '@typescript-eslint/parser'; import * as path from 'path'; const parser = '@typescript-eslint/parser'; @@ -7,20 +8,30 @@ type RuleTesterConfig = Omit & { parser: typeof parser; }; class RuleTester extends TSESLint.RuleTester { - private filename: string | undefined = undefined; - // as of eslint 6 you have to provide an absolute path to the parser // but that's not as clean to type, this saves us trying to manually enforce // that contributors require.resolve everything - constructor(options: RuleTesterConfig) { + constructor(private readonly options: RuleTesterConfig) { super({ ...options, parser: require.resolve(options.parser), }); + } + private getFilename(options?: TSESLint.ParserOptions): string { + if (options) { + const filename = `file.ts${ + options.ecmaFeatures && options.ecmaFeatures.jsx ? 'x' : '' + }`; + if (options.project) { + return path.join(getFixturesRootDir(), filename); + } - if (options.parserOptions && options.parserOptions.project) { - this.filename = path.join(getFixturesRootDir(), 'file.ts'); + return filename; + } else if (this.options.parserOptions) { + return this.getFilename(this.options.parserOptions); } + + return 'file.ts'; } // as of eslint 6 you have to provide an absolute path to the parser @@ -33,17 +44,14 @@ class RuleTester extends TSESLint.RuleTester { ): void { const errorMessage = `Do not set the parser at the test level unless you want to use a parser other than ${parser}`; - if (this.filename) { - tests.valid = tests.valid.map(test => { - if (typeof test === 'string') { - return { - code: test, - filename: this.filename, - }; - } - return test; - }); - } + tests.valid = tests.valid.map(test => { + if (typeof test === 'string') { + return { + code: test, + }; + } + return test; + }); tests.valid.forEach(test => { if (typeof test !== 'string') { @@ -51,7 +59,7 @@ class RuleTester extends TSESLint.RuleTester { throw new Error(errorMessage); } if (!test.filename) { - test.filename = this.filename; + test.filename = this.getFilename(test.parserOptions); } } }); @@ -60,7 +68,7 @@ class RuleTester extends TSESLint.RuleTester { throw new Error(errorMessage); } if (!test.filename) { - test.filename = this.filename; + test.filename = this.getFilename(test.parserOptions); } }); @@ -74,4 +82,10 @@ function getFixturesRootDir(): string { const { batchedSingleLineTests } = ESLintUtils; +// make sure that the parser doesn't hold onto file handles between tests +// on linux (i.e. our CI env), there can be very a limited number of watch handles available +afterAll(() => { + clearCaches(); +}); + export { RuleTester, getFixturesRootDir, batchedSingleLineTests }; diff --git a/packages/eslint-plugin/tests/eslint-rules/no-restricted-globals.test.ts b/packages/eslint-plugin/tests/eslint-rules/no-restricted-globals.test.ts index f20381c20719..0cb6ec5d2919 100644 --- a/packages/eslint-plugin/tests/eslint-rules/no-restricted-globals.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/no-restricted-globals.test.ts @@ -24,6 +24,77 @@ export default class Test { `, options: ['status'], }, + { + code: ` +type Handler = (event: string) => any + `, + options: ['event'], + }, + { + code: ` + const a = foo?.bar?.name + `, + }, + { + code: ` + const a = foo?.bar?.name ?? "foobar" + `, + }, + { + code: ` + const a = foo()?.bar; + `, + }, + { + code: ` + const a = foo()?.bar ?? true; + `, + }, + ], + invalid: [ + { + code: ` +function onClick() { + console.log(event); +} + +fdescribe("foo", function() { +}); + `, + options: ['event'], + errors: [ + { + message: "Unexpected use of 'event'.", + // the base rule doesn't use messageId + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } as any, + ], + }, + { + code: ` +confirm("TEST"); + `, + options: ['confirm'], + errors: [ + { + message: "Unexpected use of 'confirm'.", + // the base rule doesn't use messageId + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } as any, + ], + }, + { + code: ` +var a = confirm("TEST")?.a; + `, + options: ['confirm'], + errors: [ + { + message: "Unexpected use of 'confirm'.", + // the base rule doesn't use messageId + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } as any, + ], + }, ], - invalid: [], }); diff --git a/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts b/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts index 84626c38201f..38d58b482fd3 100644 --- a/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts @@ -68,6 +68,57 @@ function eachr(subject: Object | Array): typeof subject { ` function eachr(subject: Map): typeof subject; `, + ` + var a = { b: 3 }; + var c = a?.b; + `, + ` + var a = { b: { c: 3 } }; + var d = a?.["b"]?.c; + `, + ` + var a = { b: 3 }; + var c = { }; + var d = (a || c)?.b; + `, + ` + var a = { b: () => {} }; + a?.b(); + `, + ], + invalid: [ + { + code: 'a = 5;', + errors: [ + { + messageId: 'undef', + data: { + name: 'a', + }, + }, + ], + }, + { + code: 'a?.b = 5;', + errors: [ + { + messageId: 'undef', + data: { + name: 'a', + }, + }, + ], + }, + { + code: 'a()?.b = 5;', + errors: [ + { + messageId: 'undef', + data: { + name: 'a', + }, + }, + ], + }, ], - invalid: [], }); diff --git a/packages/eslint-plugin/tests/eslint-rules/no-use-before-define.test.ts b/packages/eslint-plugin/tests/eslint-rules/no-use-before-define.test.ts new file mode 100644 index 000000000000..4571cd04afbb --- /dev/null +++ b/packages/eslint-plugin/tests/eslint-rules/no-use-before-define.test.ts @@ -0,0 +1,85 @@ +import rule from 'eslint/lib/rules/no-use-before-define'; +import { RuleTester } from '../RuleTester'; + +const ruleTester = new RuleTester({ + parserOptions: { + ecmaVersion: 6, + sourceType: 'module', + ecmaFeatures: {}, + }, + parser: '@typescript-eslint/parser', +}); + +ruleTester.run('no-use-before-define', rule, { + valid: [ + ` +const updatedAt = data?.updatedAt; + `, + ` +function f() { + return function t() {}; +} +f()?.(); + `, + ` +var a = { b: 5 }; +alert(a?.b); + `, + ], + invalid: [ + { + code: ` +f(); +function f() {} + `, + errors: [ + { + message: "'f' was used before it was defined.", + // the base rule doesn't use messageId + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } as any, + ], + }, + { + code: ` +alert(a); +var a = 10; + `, + errors: [ + { + message: "'a' was used before it was defined.", + // the base rule doesn't use messageId + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } as any, + ], + }, + { + code: ` +f()?.(); +function f() { + return function t() {}; +} + `, + errors: [ + { + message: "'f' was used before it was defined.", + // the base rule doesn't use messageId + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } as any, + ], + }, + { + code: ` +alert(a?.b); +var a = { b: 5 }; + `, + errors: [ + { + message: "'a' was used before it was defined.", + // the base rule doesn't use messageId + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } as any, + ], + }, + ], +}); diff --git a/packages/eslint-plugin/tests/rules/array-type.test.ts b/packages/eslint-plugin/tests/rules/array-type.test.ts index 32de7e32c892..86cb1940826b 100644 --- a/packages/eslint-plugin/tests/rules/array-type.test.ts +++ b/packages/eslint-plugin/tests/rules/array-type.test.ts @@ -1071,5 +1071,35 @@ class Foo extends Bar implements Baz { `let a: readonly Array[] = []`, 'array', ); + testOutput( + 'generic', + `type T = readonly(string)[]`, + `type T = ReadonlyArray`, + 'generic', + ); + testOutput( + 'generic', + `let a: readonly(readonly string[])[] = []`, + `let a: ReadonlyArray> = []`, + 'generic', + ); + testOutput( + 'generic', + `type T = readonly(readonly string[])[]`, + `type T = ReadonlyArray>`, + 'generic', + ); + testOutput( + 'generic', + `type T = readonly (readonly string[])[]`, + `type T = ReadonlyArray>`, + 'generic', + ); + testOutput( + 'generic', + `type T = readonly (readonly string[])[]`, + `type T = ReadonlyArray>`, + 'generic', + ); }); }); diff --git a/packages/eslint-plugin/tests/rules/camelcase.test.ts b/packages/eslint-plugin/tests/rules/camelcase.test.ts index e0e142c70a4b..d2d3287ce662 100644 --- a/packages/eslint-plugin/tests/rules/camelcase.test.ts +++ b/packages/eslint-plugin/tests/rules/camelcase.test.ts @@ -79,6 +79,22 @@ ruleTester.run('camelcase', rule, { code: 'abstract class Foo { abstract bar: number = 0; }', options: [{ properties: 'always' }], }, + { + code: 'const foo = foo?.baz;', + }, + { + code: 'const foo = foo?.foo_bar?.foo_bar_baz;', + }, + { + code: 'const foo = foo.bar?.foo_bar_baz;', + }, + { + code: 'const foo = (foo?.bar?.baz)?.foo_bar_baz;', + }, + { + code: 'const foo = foo_bar?.foo;', + options: [{ properties: 'never' }], + }, ], invalid: [ @@ -194,5 +210,33 @@ ruleTester.run('camelcase', rule, { }, ], }, + { + code: 'const foo = foo_bar?.foo;', + options: [{ properties: 'always' }], + errors: [ + { + messageId: 'notCamelCase', + data: { + name: 'foo_bar', + }, + line: 1, + column: 13, + }, + ], + }, + { + code: 'const foo = (foo_test?.bar)?.baz;', + options: [{ properties: 'always' }], + errors: [ + { + messageId: 'notCamelCase', + data: { + name: 'foo_test', + }, + line: 1, + column: 14, + }, + ], + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/member-ordering.test.ts b/packages/eslint-plugin/tests/rules/member-ordering.test.ts index 81e67999b8dd..936fe3a89004 100644 --- a/packages/eslint-plugin/tests/rules/member-ordering.test.ts +++ b/packages/eslint-plugin/tests/rules/member-ordering.test.ts @@ -1211,12 +1211,45 @@ type Foo = { `, options: [{ default: ['method', 'constructor', 'field'] }], }, - ` + { + code: ` abstract class Foo { B: string; abstract A: () => {} } `, + }, + { + code: ` +interface Foo { + public B: string; + [A:string]: number; +} + `, + }, + { + code: ` +abstract class Foo { + private static C: string; + B: string; + private D: string; + protected static F(): {}; + public E(): {}; + public abstract A = () => {}; + protected abstract G(): void; +} + `, + }, + { + code: ` +abstract class Foo { + protected typeChecker: (data: any) => boolean; + public abstract required: boolean; + abstract verify(): void; +} + `, + options: [{ classes: ['field', 'constructor', 'method'] }], + }, ], invalid: [ { @@ -3319,7 +3352,7 @@ type Foo = { { code: ` abstract class Foo { - abstract A: () => {} + abstract A = () => {}; B: string; } `, @@ -3328,12 +3361,117 @@ abstract class Foo { messageId: 'incorrectOrder', data: { name: 'B', - rank: 'method', + rank: 'public abstract method', }, line: 4, column: 5, }, ], }, + { + code: ` +abstract class Foo { + abstract A: () => {}; + B: string; + public C() {}; + private D() {}; + abstract E() {}; +} + `, + errors: [ + { + messageId: 'incorrectOrder', + data: { + name: 'B', + rank: 'public abstract field', + }, + line: 4, + column: 5, + }, + ], + }, + { + code: ` +abstract class Foo { + B: string; + abstract C = () => {}; + abstract A: () => {}; +} + `, + options: [{ default: ['method', 'constructor', 'field'] }], + errors: [ + { + messageId: 'incorrectOrder', + data: { + name: 'C', + rank: 'field', + }, + line: 4, + column: 5, + }, + ], + }, + { + code: ` +class Foo { + C: number; + [A:string]: number; + public static D(): {}; + private static [B:string]: number; +} + `, + options: [ + { + default: [ + 'field', + 'method', + 'public-static-method', + 'private-static-method', + ], + }, + ], + errors: [ + { + messageId: 'incorrectOrder', + data: { + name: 'D', + rank: 'private static method', + }, + line: 5, + column: 5, + }, + ], + }, + { + code: ` +abstract class Foo { + abstract B: string; + abstract A(): void; + public C(): {}; + +} + `, + options: [{ default: ['method', 'constructor', 'field'] }], + errors: [ + { + messageId: 'incorrectOrder', + data: { + name: 'A', + rank: 'field', + }, + line: 4, + column: 5, + }, + { + messageId: 'incorrectOrder', + data: { + name: 'C', + rank: 'field', + }, + line: 5, + column: 5, + }, + ], + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/no-dynamic-delete.test.ts b/packages/eslint-plugin/tests/rules/no-dynamic-delete.test.ts new file mode 100644 index 000000000000..e3b4e5366e8b --- /dev/null +++ b/packages/eslint-plugin/tests/rules/no-dynamic-delete.test.ts @@ -0,0 +1,105 @@ +import path from 'path'; +import rule from '../../src/rules/no-dynamic-delete'; +import { RuleTester } from '../RuleTester'; + +const rootDir = path.join(process.cwd(), 'tests/fixtures'); +const ruleTester = new RuleTester({ + parserOptions: { + ecmaVersion: 2015, + tsconfigRootDir: rootDir, + project: './tsconfig.json', + }, + parser: '@typescript-eslint/parser', +}); + +ruleTester.run('no-dynamic-delete', rule, { + valid: [ + `const container: { [i: string]: 0 } = {}; + delete container.aaa;`, + `const container: { [i: string]: 0 } = {}; + delete container.delete;`, + `const container: { [i: string]: 0 } = {}; + delete container[7];`, + `const container: { [i: string]: 0 } = {}; + delete container[-7];`, + `const container: { [i: string]: 0 } = {}; + delete container[+7];`, + `const container: { [i: string]: 0 } = {}; + delete container['-Infinity'];`, + `const container: { [i: string]: 0 } = {}; + delete container['+Infinity'];`, + `const value = 1; + delete value;`, + `const value = 1; + delete -value;`, + ], + invalid: [ + { + code: `const container: { [i: string]: 0 } = {}; + delete container['aaa'];`, + errors: [{ messageId: 'dynamicDelete' }], + output: `const container: { [i: string]: 0 } = {}; + delete container.aaa;`, + }, + { + code: `const container: { [i: string]: 0 } = {}; + delete container [ 'aaa' ] ;`, + errors: [{ messageId: 'dynamicDelete' }], + output: `const container: { [i: string]: 0 } = {}; + delete container .aaa ;`, + }, + { + code: `const container: { [i: string]: 0 } = {}; + delete container['aa' + 'b'];`, + errors: [{ messageId: 'dynamicDelete' }], + }, + { + code: `const container: { [i: string]: 0 } = {}; + delete container['delete'];`, + errors: [{ messageId: 'dynamicDelete' }], + output: `const container: { [i: string]: 0 } = {}; + delete container.delete;`, + }, + { + code: `const container: { [i: string]: 0 } = {}; + delete container[-Infinity];`, + errors: [{ messageId: 'dynamicDelete' }], + }, + { + code: `const container: { [i: string]: 0 } = {}; + delete container[+Infinity];`, + errors: [{ messageId: 'dynamicDelete' }], + }, + { + code: `const container: { [i: string]: 0 } = {}; + delete container[NaN];`, + errors: [{ messageId: 'dynamicDelete' }], + }, + { + code: `const container: { [i: string]: 0 } = {}; + delete container['NaN'];`, + errors: [{ messageId: 'dynamicDelete' }], + output: `const container: { [i: string]: 0 } = {}; + delete container.NaN;`, + }, + { + code: `const container: { [i: string]: 0 } = {}; + delete container [ 'NaN' ] ;`, + errors: [{ messageId: 'dynamicDelete' }], + output: `const container: { [i: string]: 0 } = {}; + delete container .NaN ;`, + }, + { + code: `const container: { [i: string]: 0 } = {}; + const name = 'name'; + delete container[name];`, + errors: [{ messageId: 'dynamicDelete' }], + }, + { + code: `const container: { [i: string]: 0 } = {}; + const getName = () => 'aaa'; + delete container[getName()];`, + errors: [{ messageId: 'dynamicDelete' }], + }, + ], +}); diff --git a/packages/eslint-plugin/tests/rules/no-magic-numbers.test.ts b/packages/eslint-plugin/tests/rules/no-magic-numbers.test.ts index 1ab26cfa704d..f65610ea3f4b 100644 --- a/packages/eslint-plugin/tests/rules/no-magic-numbers.test.ts +++ b/packages/eslint-plugin/tests/rules/no-magic-numbers.test.ts @@ -48,6 +48,8 @@ class Foo { readonly B = 2; public static readonly C = 1; static readonly D = 1; + readonly E = -1; + readonly F = +1; } `, options: [{ ignoreReadonlyClassProperties: true }], @@ -184,6 +186,8 @@ class Foo { readonly B = 2; public static readonly C = 1; static readonly D = 1; + readonly E = -1; + readonly F = +1; } `, options: [{ ignoreReadonlyClassProperties: false }], @@ -208,6 +212,16 @@ class Foo { line: 6, column: 23, }, + { + messageId: 'noMagic', + line: 7, + column: 16, + }, + { + messageId: 'noMagic', + line: 8, + column: 16, + }, ], }, ], diff --git a/packages/eslint-plugin/tests/rules/no-type-alias.test.ts b/packages/eslint-plugin/tests/rules/no-type-alias.test.ts index d17348af7460..d66691dd9556 100644 --- a/packages/eslint-plugin/tests/rules/no-type-alias.test.ts +++ b/packages/eslint-plugin/tests/rules/no-type-alias.test.ts @@ -439,6 +439,10 @@ type Foo = { 'type Foo = [string] & [number, number] | keyof [number, number, number];', options: [{ allowTupleTypes: 'in-unions-and-intersections' }], }, + { + code: 'type Foo = new (bar: number) => string | null;', + options: [{ allowConstructors: 'always' }], + }, ], invalid: [ { @@ -3176,5 +3180,19 @@ type Foo = { }, ], }, + { + code: 'type Foo = new (bar: number) => string | null;', + options: [{ allowConstructors: 'never' }], + errors: [ + { + messageId: 'noTypeAlias', + data: { + alias: 'constructors', + line: 1, + column: 12, + }, + }, + ], + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/no-untyped-public-signature.test.ts b/packages/eslint-plugin/tests/rules/no-untyped-public-signature.test.ts new file mode 100644 index 000000000000..1a167d64e30d --- /dev/null +++ b/packages/eslint-plugin/tests/rules/no-untyped-public-signature.test.ts @@ -0,0 +1,210 @@ +import rule from '../../src/rules/no-untyped-public-signature'; +import { RuleTester } from '../RuleTester'; + +const ruleTester = new RuleTester({ + parserOptions: { + ecmaVersion: 6, + sourceType: 'module', + ecmaFeatures: {}, + }, + parser: '@typescript-eslint/parser', +}); + +ruleTester.run('no-untyped-public-signature', rule, { + valid: [ + { + code: `class A { + private a(c) { + } + }`, + }, + { + code: `class A { + private async a(c) { + } + }`, + }, + { + code: ` + class A { + public b(c: string):void { + + } + }`, + }, + { + code: ` + class A { + public b(...c):void { + + } + }`, + }, + { + code: ` + class A { + b(c):void { + + } + }`, + options: [{ ignoredMethods: ['b'] }], + }, + { + code: ` + class A { + ['b'](c):void { + + } + }`, + options: [{ ignoredMethods: ['b'] }], + }, + { + code: ` + class A { + [\`b\`](c):void { + + } + }`, + options: [{ ignoredMethods: ['b'] }], + }, + { + code: ` + class A { + b(...c):void { + + } + + d(c):void { + + } + }`, + options: [{ ignoredMethods: ['b', 'd'] }], + }, + ], + invalid: [ + //untyped parameter + { + code: `class A { + public b(c):void { + + } + }`, + errors: [{ messageId: 'untypedParameter' }], + }, + //untyped parameter (any) + { + code: `class A { + public b(c: any):void { + + } + }`, + errors: [{ messageId: 'untypedParameter' }], + }, + //implicit public method + { + code: `class A { + b(c):void { + + } + }`, + errors: [{ messageId: 'untypedParameter' }], + }, + //implicit async public method + { + code: `class A { + async a(c): void { + } + }`, + errors: [{ messageId: 'untypedParameter' }], + }, + //no return type + { + code: `class A { + public a(c: number) { + } + }`, + errors: [{ messageId: 'noReturnType' }], + }, + //no return type + untyped parameter + { + code: `class A { + public b(c) { + + } + }`, + errors: [ + { messageId: 'untypedParameter' }, + { messageId: 'noReturnType' }, + ], + }, + //any return type + { + code: `class A { + public b(c: number): any { + + } + }`, + errors: [{ messageId: 'noReturnType' }], + }, + //with ignored methods + { + code: `class A { + public b(c: number): any { + + } + + c() { + } + }`, + options: [{ ignoredMethods: ['c'] }], + errors: [{ messageId: 'noReturnType' }], + }, + { + code: ` + let c = 'd'; + class A { + [methodName]() { + } + }`, + options: [{ ignoredMethods: ['methodName'] }], + errors: [{ messageId: 'noReturnType' }], + }, + { + code: ` + class A { + [1]() { + } + }`, + options: [{ ignoredMethods: ['1'] }], + errors: [{ messageId: 'noReturnType' }], + }, + { + code: ` + let c = 'C'; + class A { + [\`methodName\${c}\`]() { + } + }`, + options: [{ ignoredMethods: ['methodNameC', 'methodNamec'] }], + errors: [{ messageId: 'noReturnType' }], + }, + { + code: ` + let c = '1'; + class A { + [(c as number)]() { + } + }`, + options: [{ ignoredMethods: ['1'] }], + errors: [{ messageId: 'noReturnType' }], + }, + { + code: ` + class A { + abstract c() { + } + }`, + errors: [{ messageId: 'noReturnType' }], + }, + ], +}); diff --git a/packages/eslint-plugin/tests/rules/no-unused-expressions.test.ts b/packages/eslint-plugin/tests/rules/no-unused-expressions.test.ts new file mode 100644 index 000000000000..46653b30c663 --- /dev/null +++ b/packages/eslint-plugin/tests/rules/no-unused-expressions.test.ts @@ -0,0 +1,180 @@ +import rule from '../../src/rules/no-unused-expressions'; +import { RuleTester } from '../RuleTester'; + +const ruleTester = new RuleTester({ + parserOptions: { + ecmaVersion: 6, + sourceType: 'module', + ecmaFeatures: {}, + }, + parser: '@typescript-eslint/parser', +}); + +// the base rule doesn't have messageIds +function error( + messages: { line: number; column: number }[], + // eslint-disable-next-line @typescript-eslint/no-explicit-any +): any[] { + return messages.map(message => ({ + ...message, + message: + 'Expected an assignment or function call and instead saw an expression.', + })); +} + +ruleTester.run('no-unused-expressions', rule, { + valid: [ + ` + test.age?.toLocaleString(); + `, + ` + let a = (a?.b).c; + `, + ` + let b = a?.['b']; + `, + ` + let c = one[2]?.[3][4]; + `, + ` + one[2]?.[3][4]?.(); + `, + ` + a?.['b']?.c(); + `, + ], + invalid: [ + { + code: ` +if(0) 0 + `, + errors: error([ + { + line: 2, + column: 7, + }, + ]), + }, + { + code: ` +f(0), {} + `, + errors: error([ + { + line: 2, + column: 1, + }, + ]), + }, + { + code: ` +a, b() + `, + errors: error([ + { + line: 2, + column: 1, + }, + ]), + }, + { + code: ` +a() && function namedFunctionInExpressionContext () {f();} + `, + errors: error([ + { + line: 2, + column: 1, + }, + ]), + }, + { + code: ` +a?.b + `, + errors: error([ + { + line: 2, + column: 1, + }, + ]), + }, + { + code: ` +(a?.b).c + `, + errors: error([ + { + line: 2, + column: 1, + }, + ]), + }, + { + code: ` +a?.['b'] + `, + errors: error([ + { + line: 2, + column: 1, + }, + ]), + }, + { + code: ` +(a?.['b']).c + `, + errors: error([ + { + line: 2, + column: 1, + }, + ]), + }, + { + code: ` +a?.b()?.c + `, + errors: error([ + { + line: 2, + column: 1, + }, + ]), + }, + { + code: ` +(a?.b()).c + `, + errors: error([ + { + line: 2, + column: 1, + }, + ]), + }, + { + code: ` +one[2]?.[3][4]; + `, + errors: error([ + { + line: 2, + column: 1, + }, + ]), + }, + { + code: ` +one.two?.three.four; + `, + errors: error([ + { + line: 2, + column: 1, + }, + ]), + }, + ], +}); diff --git a/packages/eslint-plugin/tests/rules/promise-function-async.test.ts b/packages/eslint-plugin/tests/rules/promise-function-async.test.ts index 46100db7982a..66a65a21ffd3 100644 --- a/packages/eslint-plugin/tests/rules/promise-function-async.test.ts +++ b/packages/eslint-plugin/tests/rules/promise-function-async.test.ts @@ -106,6 +106,26 @@ function returnsUnknown(): unknown { }, ], }, + { + code: ` +interface ReadableStream {} +interface Options { + stream: ReadableStream; +} + +type Return = ReadableStream | Promise; +const foo = (options: Options): Return => { + return options.stream ? asStream(options) : asPromise(options); +} + `, + }, + { + code: ` +function foo(): Promise | boolean { + return Math.random() > 0.5 ? Promise.resolve('value') : false; +} + `, + }, ], invalid: [ { @@ -379,5 +399,24 @@ const returnAllowedType = () => new PromiseType(); }, ], }, + { + code: ` +interface SPromise extends Promise {} +function foo(): Promise | SPromise { + return Math.random() > 0.5 ? Promise.resolve('value') : Promise.resolve(false); +} + `, + options: [ + { + allowedPromiseNames: ['SPromise'], + }, + ], + errors: [ + { + line: 3, + messageId, + }, + ], + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/space-before-function-paren.test.ts b/packages/eslint-plugin/tests/rules/space-before-function-paren.test.ts new file mode 100644 index 000000000000..7acb61fa85fa --- /dev/null +++ b/packages/eslint-plugin/tests/rules/space-before-function-paren.test.ts @@ -0,0 +1,577 @@ +import { + TSESLint, + AST_NODE_TYPES, +} from '@typescript-eslint/experimental-utils'; +import rule, { + MessageIds, + Options, +} from '../../src/rules/space-before-function-paren'; +import { RuleTester } from '../RuleTester'; + +const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', +}); + +ruleTester.run('space-before-function-paren', rule, { + valid: [ + 'function foo () {}', + 'var foo = function () {}', + 'var bar = function foo () {}', + 'var obj = { get foo () {}, set foo (val) {} };', + 'type TransformFunction = (el: ASTElement, code: string) => string;', + 'var f = function () {};', + 'function foo {}> () {}', + 'async {}> () => {}', + 'async () => {}', + { + code: 'function foo {}>>() {}', + options: ['never'], + }, + { + code: 'var obj = { foo () {} };', + parserOptions: { ecmaVersion: 6 }, + }, + { code: 'function* foo () {}', parserOptions: { ecmaVersion: 6 } }, + { code: 'var foo = function *() {};', parserOptions: { ecmaVersion: 6 } }, + { code: 'function foo() {}', options: ['never'] }, + { code: 'var foo = function() {}', options: ['never'] }, + { code: 'var bar = function foo() {}', options: ['never'] }, + { + code: 'var obj = { get foo() {}, set foo(val) {} };', + options: ['never'], + }, + { + code: 'var obj = { foo() {} };', + options: ['never'], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: 'function* foo() {}', + options: ['never'], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: 'var foo = function*() {};', + options: ['never'], + parserOptions: { ecmaVersion: 6 }, + }, + + { + code: [ + 'function foo() {}', + 'var bar = function () {}', + 'function* baz() {}', + 'var bat = function*() {};', + 'var obj = { get foo() {}, set foo(val) {}, bar() {} };', + ].join('\n'), + options: [{ named: 'never', anonymous: 'always' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: [ + 'function foo () {}', + 'var bar = function() {}', + 'function* baz () {}', + 'var bat = function* () {};', + 'var obj = { get foo () {}, set foo (val) {}, bar () {} };', + ].join('\n'), + options: [{ named: 'always', anonymous: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: 'class Foo { constructor() {} *method() {} }', + options: [{ named: 'never', anonymous: 'always' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: 'class Foo { constructor () {} *method () {} }', + options: [{ named: 'always', anonymous: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: 'var foo = function() {}', + options: [{ named: 'always', anonymous: 'ignore' }], + }, + { + code: 'var foo = function () {}', + options: [{ named: 'always', anonymous: 'ignore' }], + }, + { + code: 'var bar = function foo() {}', + options: [{ named: 'ignore', anonymous: 'always' }], + }, + { + code: 'var bar = function foo () {}', + options: [{ named: 'ignore', anonymous: 'always' }], + }, + + // Async arrow functions + { code: '() => 1', parserOptions: { ecmaVersion: 6 } }, + { code: 'async a => a', parserOptions: { ecmaVersion: 8 } }, + { + code: 'async a => a', + options: [{ asyncArrow: 'always' }], + parserOptions: { ecmaVersion: 8 }, + }, + { + code: 'async a => a', + options: [{ asyncArrow: 'never' }], + parserOptions: { ecmaVersion: 8 }, + }, + { + code: 'async () => 1', + options: [{ asyncArrow: 'always' }], + parserOptions: { ecmaVersion: 8 }, + }, + { + code: 'async() => 1', + options: [{ asyncArrow: 'never' }], + parserOptions: { ecmaVersion: 8 }, + }, + { + code: 'async () => 1', + options: [{ asyncArrow: 'ignore' }], + parserOptions: { ecmaVersion: 8 }, + }, + { + code: 'async() => 1', + options: [{ asyncArrow: 'ignore' }], + parserOptions: { ecmaVersion: 8 }, + }, + { code: 'async () => 1', parserOptions: { ecmaVersion: 8 } }, + { + code: 'async () => 1', + options: ['always'], + parserOptions: { ecmaVersion: 8 }, + }, + { + code: 'async() => 1', + options: ['never'], + parserOptions: { ecmaVersion: 8 }, + }, + ], + + invalid: [ + { + code: 'function foo {}>() {}', + output: 'function foo {}> () {}', + errors: [ + { + type: AST_NODE_TYPES.FunctionDeclaration, + messageId: 'missing', + line: 1, + column: 33, + }, + ], + }, + { + code: 'function foo() {}', + output: 'function foo () {}', + errors: [ + { + type: AST_NODE_TYPES.FunctionDeclaration, + messageId: 'missing', + line: 1, + column: 13, + }, + ], + }, + { + code: 'function foo/* */() {}', + output: 'function foo /* */() {}', + errors: [ + { + type: AST_NODE_TYPES.FunctionDeclaration, + messageId: 'missing', + line: 1, + column: 13, + }, + ], + }, + { + code: 'var foo = function() {}', + output: 'var foo = function () {}', + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'missing', + line: 1, + column: 19, + }, + ], + }, + { + code: 'var bar = function foo() {}', + output: 'var bar = function foo () {}', + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'missing', + line: 1, + column: 23, + }, + ], + }, + { + code: 'var obj = { get foo() {}, set foo(val) {} };', + output: 'var obj = { get foo () {}, set foo (val) {} };', + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'missing', + line: 1, + column: 20, + }, + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'missing', + line: 1, + column: 34, + }, + ], + }, + { + code: 'var obj = { foo() {} };', + output: 'var obj = { foo () {} };', + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'missing', + line: 1, + column: 16, + }, + ], + }, + { + code: 'function* foo() {}', + output: 'function* foo () {}', + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + type: AST_NODE_TYPES.FunctionDeclaration, + messageId: 'missing', + line: 1, + column: 14, + }, + ], + }, + + { + code: 'function foo () {}', + output: 'function foo() {}', + options: ['never'], + errors: [ + { + type: AST_NODE_TYPES.FunctionDeclaration, + messageId: 'unexpected', + line: 1, + column: 13, + }, + ], + }, + { + code: 'var foo = function () {}', + output: 'var foo = function() {}', + options: ['never'], + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 1, + column: 19, + }, + ], + }, + { + code: 'var bar = function foo () {}', + output: 'var bar = function foo() {}', + options: ['never'], + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 1, + column: 23, + }, + ], + }, + { + code: 'var obj = { get foo () {}, set foo (val) {} };', + output: 'var obj = { get foo() {}, set foo(val) {} };', + options: ['never'], + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 1, + column: 20, + }, + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 1, + column: 35, + }, + ], + }, + { + code: 'var obj = { foo () {} };', + output: 'var obj = { foo() {} };', + options: ['never'], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 1, + column: 16, + }, + ], + }, + { + code: 'function* foo () {}', + output: 'function* foo() {}', + options: ['never'], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + type: AST_NODE_TYPES.FunctionDeclaration, + messageId: 'unexpected', + line: 1, + column: 14, + }, + ], + }, + + { + code: [ + 'function foo () {}', + 'var bar = function() {}', + 'var obj = { get foo () {}, set foo (val) {}, bar () {} };', + ].join('\n'), + output: [ + 'function foo() {}', + 'var bar = function () {}', + 'var obj = { get foo() {}, set foo(val) {}, bar() {} };', + ].join('\n'), + options: [{ named: 'never', anonymous: 'always' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + type: AST_NODE_TYPES.FunctionDeclaration, + messageId: 'unexpected', + line: 1, + column: 13, + }, + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'missing', + line: 2, + column: 19, + }, + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 3, + column: 20, + }, + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 3, + column: 35, + }, + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 3, + column: 49, + }, + ], + }, + { + code: 'class Foo { constructor () {} *method () {} }', + output: 'class Foo { constructor() {} *method() {} }', + options: [{ named: 'never', anonymous: 'always' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 1, + column: 24, + }, + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 1, + column: 38, + }, + ], + }, + { + code: 'var foo = { bar () {} }', + output: 'var foo = { bar() {} }', + options: [{ named: 'never', anonymous: 'always' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 1, + column: 16, + }, + ], + }, + { + code: [ + 'function foo() {}', + 'var bar = function () {}', + 'var obj = { get foo() {}, set foo(val) {}, bar() {} };', + ].join('\n'), + output: [ + 'function foo () {}', + 'var bar = function() {}', + 'var obj = { get foo () {}, set foo (val) {}, bar () {} };', + ].join('\n'), + options: [{ named: 'always', anonymous: 'never' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + type: AST_NODE_TYPES.FunctionDeclaration, + messageId: 'missing', + line: 1, + column: 13, + }, + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 2, + column: 19, + }, + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'missing', + line: 3, + column: 20, + }, + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'missing', + line: 3, + column: 34, + }, + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'missing', + line: 3, + column: 47, + }, + ], + }, + { + code: 'var foo = function() {}', + output: 'var foo = function () {}', + options: [{ named: 'ignore', anonymous: 'always' }], + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'missing', + line: 1, + column: 19, + }, + ], + }, + { + code: 'var foo = function () {}', + output: 'var foo = function() {}', + options: [{ named: 'ignore', anonymous: 'never' }], + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 1, + column: 19, + }, + ], + }, + { + code: 'var bar = function foo() {}', + output: 'var bar = function foo () {}', + options: [{ named: 'always', anonymous: 'ignore' }], + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'missing', + line: 1, + column: 23, + }, + ], + }, + { + code: 'var bar = function foo () {}', + output: 'var bar = function foo() {}', + options: [{ named: 'never', anonymous: 'ignore' }], + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 1, + column: 23, + }, + ], + }, + + // Async arrow functions + { + code: 'async() => 1', + output: 'async () => 1', + options: [{ asyncArrow: 'always' }], + parserOptions: { ecmaVersion: 8 }, + errors: ['Missing space before function parentheses.'], + }, + { + code: 'async () => 1', + output: 'async() => 1', + options: [{ asyncArrow: 'never' }], + parserOptions: { ecmaVersion: 8 }, + errors: ['Unexpected space before function parentheses.'], + }, + { + code: 'async() => 1', + output: 'async () => 1', + parserOptions: { ecmaVersion: 8 }, + errors: [ + { + messageId: 'missing', + type: AST_NODE_TYPES.ArrowFunctionExpression, + }, + ], + }, + { + code: 'async() => 1', + output: 'async () => 1', + options: ['always'], + parserOptions: { ecmaVersion: 8 }, + errors: [ + { + messageId: 'missing', + type: AST_NODE_TYPES.ArrowFunctionExpression, + }, + ], + }, + { + code: 'async () => 1', + output: 'async() => 1', + options: ['never'], + parserOptions: { ecmaVersion: 8 }, + errors: [ + { + messageId: 'unexpected', + type: AST_NODE_TYPES.ArrowFunctionExpression, + }, + ], + }, + ] as TSESLint.InvalidTestCase[], +}); diff --git a/packages/eslint-plugin/tools/generate-configs.ts b/packages/eslint-plugin/tools/generate-configs.ts index 664504783f0a..ff6c5c63a0c2 100644 --- a/packages/eslint-plugin/tools/generate-configs.ts +++ b/packages/eslint-plugin/tools/generate-configs.ts @@ -31,11 +31,13 @@ const BASE_RULES_TO_BE_OVERRIDDEN = new Set([ 'no-extra-parens', 'no-magic-numbers', 'quotes', + 'no-unused-expressions', 'no-unused-vars', 'no-use-before-define', 'no-useless-constructor', 'require-await', 'semi', + 'space-before-function-paren', ]); // list of rules from the base plugin that we think should be turned on for typescript code const BASE_RULES_THAT_ARE_RECOMMENDED = new Set([ diff --git a/packages/eslint-plugin/tsconfig.build.json b/packages/eslint-plugin/tsconfig.build.json index 1ab98da19abf..86f3842dae31 100644 --- a/packages/eslint-plugin/tsconfig.build.json +++ b/packages/eslint-plugin/tsconfig.build.json @@ -5,12 +5,13 @@ "declaration": false, "declarationMap": false, "outDir": "./dist", + "rootDir": "./src", "resolveJsonModule": true }, - "include": [ - "src", - "typings", - // include the parser's ambient typings because the parser exports them in its type defs - "../parser/typings" + "include": ["src", "typings"], + "references": [ + { "path": "../experimental-utils/tsconfig.build.json" }, + { "path": "../parser/tsconfig.build.json" }, + { "path": "../typescript-estree/tsconfig.build.json" } ] } diff --git a/packages/eslint-plugin/tsconfig.json b/packages/eslint-plugin/tsconfig.json index fb7e21da237d..9cea515ba6b2 100644 --- a/packages/eslint-plugin/tsconfig.json +++ b/packages/eslint-plugin/tsconfig.json @@ -1,4 +1,8 @@ { "extends": "./tsconfig.build.json", + "compilerOptions": { + "composite": false, + "rootDir": "." + }, "include": ["src", "typings", "tests", "tools"] } diff --git a/packages/eslint-plugin/typings/eslint-rules.d.ts b/packages/eslint-plugin/typings/eslint-rules.d.ts index 120b11433cb9..c21b235be448 100644 --- a/packages/eslint-plugin/typings/eslint-rules.d.ts +++ b/packages/eslint-plugin/typings/eslint-rules.d.ts @@ -304,6 +304,26 @@ declare module 'eslint/lib/rules/no-unused-vars' { export = rule; } +declare module 'eslint/lib/rules/no-unused-expressions' { + import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + + const rule: TSESLint.RuleModule< + 'expected', + ( + | 'all' + | 'local' + | { + allowShortCircuit?: boolean; + allowTernary?: boolean; + allowTaggedTemplates?: boolean; + })[], + { + ExpressionStatement(node: TSESTree.ExpressionStatement): void; + } + >; + export = rule; +} + declare module 'eslint/lib/rules/no-use-before-define' { import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; diff --git a/packages/experimental-utils/CHANGELOG.md b/packages/experimental-utils/CHANGELOG.md index 598085cefc86..fa483c6bd8f4 100644 --- a/packages/experimental-utils/CHANGELOG.md +++ b/packages/experimental-utils/CHANGELOG.md @@ -3,6 +3,65 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.1...v2.7.0) (2019-11-11) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +## [2.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.0...v2.6.1) (2019-11-04) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [2.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.5.0...v2.6.0) (2019-10-28) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [2.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.4.0...v2.5.0) (2019-10-21) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + +# [2.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.3...v2.4.0) (2019-10-14) + + +### Bug Fixes + +* support long running "watch" lint sessions ([#973](https://github.com/typescript-eslint/typescript-eslint/issues/973)) ([854620e](https://github.com/typescript-eslint/typescript-eslint/commit/854620e)) + + +### Features + +* **typescript-estree:** support for parsing 3.7 features ([#1045](https://github.com/typescript-eslint/typescript-eslint/issues/1045)) ([623febf](https://github.com/typescript-eslint/typescript-eslint/commit/623febf)) + + + + + +## [2.3.3](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.2...v2.3.3) (2019-10-07) + + +### Bug Fixes + +* **experimental-utils:** remove Rule.meta.extraDescription ([#1036](https://github.com/typescript-eslint/typescript-eslint/issues/1036)) ([192e23d](https://github.com/typescript-eslint/typescript-eslint/commit/192e23d)) + + + + + ## [2.3.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.1...v2.3.2) (2019-09-30) **Note:** Version bump only for package @typescript-eslint/experimental-utils diff --git a/packages/experimental-utils/package.json b/packages/experimental-utils/package.json index 753fd606a288..2bbb6ddc9ec3 100644 --- a/packages/experimental-utils/package.json +++ b/packages/experimental-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/experimental-utils", - "version": "2.3.2", + "version": "2.7.0", "description": "(Experimental) Utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -28,16 +28,16 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { - "test": "jest --coverage", - "prebuild": "npm run clean", - "build": "tsc -p tsconfig.build.json", - "clean": "rimraf dist/", + "build": "tsc -b tsconfig.build.json", + "clean": "tsc -b tsconfig.build.json --clean", "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", - "typecheck": "tsc --noEmit" + "lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'", + "test": "jest --coverage", + "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "2.3.2", + "@typescript-eslint/typescript-estree": "2.7.0", "eslint-scope": "^5.0.0" }, "peerDependencies": { diff --git a/packages/experimental-utils/src/ts-eslint/ParserOptions.ts b/packages/experimental-utils/src/ts-eslint/ParserOptions.ts index eea1a9577684..87f919129053 100644 --- a/packages/experimental-utils/src/ts-eslint/ParserOptions.ts +++ b/packages/experimental-utils/src/ts-eslint/ParserOptions.ts @@ -1,21 +1,22 @@ export interface ParserOptions { - loc?: boolean; comment?: boolean; - range?: boolean; - tokens?: boolean; - sourceType?: 'script' | 'module'; - ecmaVersion?: 3 | 5 | 6 | 7 | 8 | 9 | 10 | 2015 | 2016 | 2017 | 2018 | 2019; ecmaFeatures?: { globalReturn?: boolean; jsx?: boolean; }; + ecmaVersion?: 3 | 5 | 6 | 7 | 8 | 9 | 10 | 2015 | 2016 | 2017 | 2018 | 2019; + errorOnTypeScriptSyntacticAndSemanticIssues?: boolean; + errorOnUnknownASTType?: boolean; + extraFileExtensions?: string[]; // ts-estree specific filePath?: string; + loc?: boolean; + noWatch?: boolean; project?: string | string[]; - useJSXTextNode?: boolean; - errorOnUnknownASTType?: boolean; - errorOnTypeScriptSyntacticAndSemanticIssues?: boolean; + range?: boolean; + sourceType?: 'script' | 'module'; + tokens?: boolean; tsconfigRootDir?: string; - extraFileExtensions?: string[]; + useJSXTextNode?: boolean; warnOnUnsupportedTypeScriptVersion?: boolean; } diff --git a/packages/experimental-utils/src/ts-eslint/Rule.ts b/packages/experimental-utils/src/ts-eslint/Rule.ts index 1724dec828b8..dad91e6a8e09 100644 --- a/packages/experimental-utils/src/ts-eslint/Rule.ts +++ b/packages/experimental-utils/src/ts-eslint/Rule.ts @@ -226,6 +226,8 @@ interface RuleListener { AssignmentPattern?: RuleFunction; AssignmentExpression?: RuleFunction; AwaitExpression?: RuleFunction; + BigIntLiteral?: RuleFunction; + BinaryExpression?: RuleFunction; BlockStatement?: RuleFunction; BreakStatement?: RuleFunction; CallExpression?: RuleFunction; @@ -249,6 +251,8 @@ interface RuleListener { ForInStatement?: RuleFunction; ForOfStatement?: RuleFunction; ForStatement?: RuleFunction; + FunctionDeclaration?: RuleFunction; + FunctionExpression?: RuleFunction; Identifier?: RuleFunction; IfStatement?: RuleFunction; Import?: RuleFunction; @@ -295,6 +299,7 @@ interface RuleListener { ThrowStatement?: RuleFunction; Token?: RuleFunction; TryStatement?: RuleFunction; + TSAbstractClassProperty?: RuleFunction; TSAbstractKeyword?: RuleFunction; TSAbstractMethodDefinition?: RuleFunction< TSESTree.TSAbstractMethodDefinition @@ -308,17 +313,23 @@ interface RuleListener { TSCallSignatureDeclaration?: RuleFunction< TSESTree.TSCallSignatureDeclaration >; + TSClassImplements?: RuleFunction; TSConditionalType?: RuleFunction; + TSConstructorType?: RuleFunction; TSConstructSignatureDeclaration?: RuleFunction< TSESTree.TSConstructSignatureDeclaration >; TSDeclareKeyword?: RuleFunction; TSDeclareFunction?: RuleFunction; + TSEmptyBodyFunctionExpression?: RuleFunction< + TSESTree.TSEmptyBodyFunctionExpression + >; TSEnumDeclaration?: RuleFunction; TSEnumMember?: RuleFunction; TSExportAssignment?: RuleFunction; TSExportKeyword?: RuleFunction; TSExternalModuleReference?: RuleFunction; + TSFunctionType?: RuleFunction; TSImportEqualsDeclaration?: RuleFunction; TSImportType?: RuleFunction; TSIndexedAccessType?: RuleFunction; @@ -326,6 +337,7 @@ interface RuleListener { TSInferType?: RuleFunction; TSInterfaceBody?: RuleFunction; TSInterfaceDeclaration?: RuleFunction; + TSInterfaceHeritage?: RuleFunction; TSIntersectionType?: RuleFunction; TSLiteralType?: RuleFunction; TSMappedType?: RuleFunction; diff --git a/packages/experimental-utils/src/ts-eslint/RuleTester.ts b/packages/experimental-utils/src/ts-eslint/RuleTester.ts index 863d0c076f23..84da228fb81e 100644 --- a/packages/experimental-utils/src/ts-eslint/RuleTester.ts +++ b/packages/experimental-utils/src/ts-eslint/RuleTester.ts @@ -50,16 +50,32 @@ interface RuleTesterConfig { parser: string; parserOptions?: ParserOptions; } -declare interface RuleTester { + +// the cast on the extends is so that we don't want to have the built type defs to attempt to import eslint +class RuleTester extends (ESLintRuleTester as { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + new (...args: unknown[]): any; +}) { + constructor(config?: RuleTesterConfig) { + super(config); + + // nobody will ever need watching in tests + // so we can give everyone a perf win by disabling watching + if (config && config.parserOptions && config.parserOptions.project) { + config.parserOptions.noWatch = + typeof config.parserOptions.noWatch === 'boolean' || true; + } + } + run>( name: string, rule: RuleModule, tests: RunTests, - ): void; + ): void { + // this method is only defined here because we lazily type the eslint import with `any` + super.run(name, rule, tests); + } } -const RuleTester = ESLintRuleTester as { - new (config?: RuleTesterConfig): RuleTester; -}; export { InvalidTestCase, diff --git a/packages/experimental-utils/tsconfig.build.json b/packages/experimental-utils/tsconfig.build.json index c052e5211304..e1b499764611 100644 --- a/packages/experimental-utils/tsconfig.build.json +++ b/packages/experimental-utils/tsconfig.build.json @@ -1,9 +1,11 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { + "composite": true, "outDir": "./dist", "rootDir": "./src", "resolveJsonModule": true }, - "include": ["src", "typings"] + "include": ["src", "typings"], + "references": [{ "path": "../typescript-estree/tsconfig.build.json" }] } diff --git a/packages/experimental-utils/tsconfig.json b/packages/experimental-utils/tsconfig.json index f469d044ef4b..9cea515ba6b2 100644 --- a/packages/experimental-utils/tsconfig.json +++ b/packages/experimental-utils/tsconfig.json @@ -1,8 +1,8 @@ { - "extends": "../../tsconfig.base.json", + "extends": "./tsconfig.build.json", "compilerOptions": { - "outDir": "./dist", - "resolveJsonModule": true + "composite": false, + "rootDir": "." }, "include": ["src", "typings", "tests", "tools"] } diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 1098745e1301..45ba8b728f68 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -3,6 +3,76 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.1...v2.7.0) (2019-11-11) + + +### Features + +* **parser:** handle optional chaining in scope analysis ([#1169](https://github.com/typescript-eslint/typescript-eslint/issues/1169)) ([026ceb9](https://github.com/typescript-eslint/typescript-eslint/commit/026ceb9)) + + + + + +## [2.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.0...v2.6.1) (2019-11-04) + + +### Bug Fixes + +* **typescript-estree:** fix filename handling for vue JSX + markdown ([#1127](https://github.com/typescript-eslint/typescript-eslint/issues/1127)) ([366518f](https://github.com/typescript-eslint/typescript-eslint/commit/366518f)) + + + + + +# [2.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.5.0...v2.6.0) (2019-10-28) + + +### Bug Fixes + +* **typescript-estree:** correct parenthesized optional chain AST ([#1141](https://github.com/typescript-eslint/typescript-eslint/issues/1141)) ([5ae286e](https://github.com/typescript-eslint/typescript-eslint/commit/5ae286e)) + + +### Features + +* **typescript-estree:** add support for declare class properties ([#1136](https://github.com/typescript-eslint/typescript-eslint/issues/1136)) ([1508670](https://github.com/typescript-eslint/typescript-eslint/commit/1508670)) + + + + + +# [2.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.4.0...v2.5.0) (2019-10-21) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + +# [2.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.3...v2.4.0) (2019-10-14) + + +### Bug Fixes + +* support long running "watch" lint sessions ([#973](https://github.com/typescript-eslint/typescript-eslint/issues/973)) ([854620e](https://github.com/typescript-eslint/typescript-eslint/commit/854620e)) + + +### Features + +* **typescript-estree:** support for parsing 3.7 features ([#1045](https://github.com/typescript-eslint/typescript-eslint/issues/1045)) ([623febf](https://github.com/typescript-eslint/typescript-eslint/commit/623febf)) + + + + + +## [2.3.3](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.2...v2.3.3) (2019-10-07) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + ## [2.3.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.1...v2.3.2) (2019-09-30) diff --git a/packages/parser/README.md b/packages/parser/README.md index 9fcb9d043633..011fb69b13d7 100644 --- a/packages/parser/README.md +++ b/packages/parser/README.md @@ -42,9 +42,16 @@ The following additional configuration options are available by specifying them - **`ecmaFeatures.jsx`** - default `false`. Enable parsing JSX when `true`. More details can be found [here](https://www.typescriptlang.org/docs/handbook/jsx.html). - - It's `false` on `*.ts` files regardless of this option. - - It's `true` on `*.tsx` files regardless of this option. - - Otherwise, it respects this option. + NOTE: this setting does not effect known file types (.js, .jsx, .ts, .tsx, .json) because the typescript compiler has its own internal handling for known file extensions. The exact behaviour is as follows: + + - if `parserOptions.project` is _not_ provided: + - `.js`, `.jsx`, `.tsx` files are parsed as if this is true. + - `.ts` files are parsed as if this is false. + - unknown extensions (`.md`, `.vue`) will respect this setting. + - if `parserOptions.project` is provided (i.e. you are using rules with type information): + - `.js`, `.jsx`, `.tsx` files are parsed as if this is true. + - `.ts` files are parsed as if this is false. + - "unknown" extensions (`.md`, `.vue`) **are parsed as if this is false**. - **`useJSXTextNode`** - default `true`. Please set `false` if you use this parser on ESLint v4. If this is `false`, the parser creates the AST of JSX texts as the legacy style. diff --git a/packages/parser/package.json b/packages/parser/package.json index aa14e9e3f770..549dda9e82fc 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "2.3.2", + "version": "2.7.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "main": "dist/parser.js", "types": "dist/parser.d.ts", @@ -31,25 +31,25 @@ "eslint" ], "scripts": { - "build": "tsc -p tsconfig.build.json", - "clean": "rimraf dist/", + "build": "tsc -b tsconfig.build.json", + "clean": "tsc -b tsconfig.build.json --clean", "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", - "prebuild": "npm run clean", + "lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'", "test": "jest --coverage", - "typecheck": "tsc --noEmit" + "typecheck": "tsc -p tsconfig.json --noEmit" }, "peerDependencies": { "eslint": "^5.0.0 || ^6.0.0" }, "dependencies": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "2.3.2", - "@typescript-eslint/typescript-estree": "2.3.2", + "@typescript-eslint/experimental-utils": "2.7.0", + "@typescript-eslint/typescript-estree": "2.7.0", "eslint-visitor-keys": "^1.1.0" }, "devDependencies": { "@types/glob": "^7.1.1", - "@typescript-eslint/shared-fixtures": "2.3.2", + "@typescript-eslint/shared-fixtures": "2.7.0", "glob": "^7.1.4" } } diff --git a/packages/parser/src/analyze-scope.ts b/packages/parser/src/analyze-scope.ts index 1b98c064db09..67d553fac465 100644 --- a/packages/parser/src/analyze-scope.ts +++ b/packages/parser/src/analyze-scope.ts @@ -7,7 +7,7 @@ import { getKeys as fallback } from 'eslint-visitor-keys'; import { ParserOptions } from './parser-options'; import { ScopeManager } from './scope/scope-manager'; -import { visitorKeys as childVisitorKeys } from './visitor-keys'; +import { visitorKeys as childVisitorKeys } from '@typescript-eslint/typescript-estree'; /** * Define the override function of `Scope#__define` for global augmentation. @@ -344,6 +344,29 @@ class Referencer extends TSESLintScope.Referencer { node.arguments.forEach(this.visit, this); } + /** + * Visit optional member expression. + * @param node The OptionalMemberExpression node to visit. + */ + OptionalMemberExpression(node: TSESTree.OptionalMemberExpression): void { + this.visit(node.object); + if (node.computed) { + this.visit(node.property); + } + } + + /** + * Visit optional call expression. + * @param node The OptionalMemberExpression node to visit. + */ + OptionalCallExpression(node: TSESTree.OptionalCallExpression): void { + this.visitTypeParameters(node); + + this.visit(node.callee); + + node.arguments.forEach(this.visit, this); + } + /** * Define the variable of this function declaration only once. * Because to avoid confusion of `no-redeclare` rule by overloading. diff --git a/packages/parser/src/parser.ts b/packages/parser/src/parser.ts index 830a282da1e4..46878a9cdea7 100644 --- a/packages/parser/src/parser.ts +++ b/packages/parser/src/parser.ts @@ -5,10 +5,10 @@ import { ParserServices, TSESTreeOptions, TSESTree, + simpleTraverse, + visitorKeys, } from '@typescript-eslint/typescript-estree'; import { analyzeScope } from './analyze-scope'; -import { simpleTraverse } from './simple-traverse'; -import { visitorKeys } from './visitor-keys'; type ParserOptions = TSESLint.ParserOptions; @@ -115,3 +115,4 @@ export function parseForESLint( } export { ParserServices, ParserOptions }; +export { clearCaches } from '@typescript-eslint/typescript-estree'; diff --git a/packages/parser/tests/lib/__snapshots__/comments.ts.snap b/packages/parser/tests/lib/__snapshots__/comments.ts.snap index 92affb66677c..86f198bdab95 100644 --- a/packages/parser/tests/lib/__snapshots__/comments.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/comments.ts.snap @@ -36,6 +36,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 6, 9, @@ -11708,6 +11709,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 24, 37, @@ -12589,6 +12591,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 24, 37, @@ -14189,6 +14192,7 @@ Object { "line": 3, }, }, + "optional": false, "range": Array [ 36, 41, @@ -15965,6 +15969,7 @@ Object { "line": 6, }, }, + "optional": false, "range": Array [ 82, 88, @@ -16485,6 +16490,7 @@ Object { "line": 7, }, }, + "optional": false, "range": Array [ 126, 132, @@ -18181,6 +18187,7 @@ Object { ], "type": "Identifier", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -18277,6 +18284,7 @@ Object { ], "type": "Identifier", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -18301,6 +18309,7 @@ Object { ], "type": "MemberExpression", }, + "optional": false, "property": Object { "left": Object { "computed": false, @@ -18344,6 +18353,7 @@ Object { ], "type": "Identifier", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -18368,6 +18378,7 @@ Object { ], "type": "MemberExpression", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -18463,6 +18474,7 @@ Object { "line": 6, }, }, + "optional": false, "range": Array [ 161, 218, @@ -18552,6 +18564,7 @@ Object { ], "type": "Identifier", }, + "optional": false, "property": Object { "loc": Object { "end": Object { diff --git a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap index cf9bd22368cf..39f3da70df9c 100644 --- a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap @@ -932,13 +932,13 @@ Object { } `; -exports[`typescript fixtures/basics/abstract-class-with-optional-method.src 1`] = ` +exports[`typescript fixtures/basics/abstract-class-with-declare-properties.src 1`] = ` Object { "$id": 4, "block": Object { "range": Array [ 0, - 78, + 230, ], "type": "Program", }, @@ -948,7 +948,7 @@ Object { "block": Object { "range": Array [ 0, - 78, + 230, ], "type": "Program", }, @@ -957,8 +957,8 @@ Object { "$id": 2, "block": Object { "range": Array [ - 7, - 78, + 0, + 229, ], "type": "ClassDeclaration", }, @@ -972,7 +972,7 @@ Object { "$ref": 3, }, "variableMap": Object { - "AbstractSocket": Object { + "AbstractDeclProps": Object { "$ref": 1, }, }, @@ -985,17 +985,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "AbstractSocket", + "name": "AbstractDeclProps", "range": Array [ - 22, - 36, + 15, + 32, ], "type": "Identifier", }, "node": Object { "range": Array [ - 7, - 78, + 0, + 229, ], "type": "ClassDeclaration", }, @@ -1006,15 +1006,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "AbstractSocket", + "name": "AbstractDeclProps", "range": Array [ - 22, - 36, + 15, + 32, ], "type": "Identifier", }, ], - "name": "AbstractSocket", + "name": "AbstractDeclProps", "references": Array [], "scope": Object { "$ref": 2, @@ -1032,7 +1032,7 @@ Object { "$ref": 4, }, "variableMap": Object { - "AbstractSocket": Object { + "AbstractDeclProps": Object { "$ref": 0, }, }, @@ -1045,17 +1045,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "AbstractSocket", + "name": "AbstractDeclProps", "range": Array [ - 22, - 36, + 15, + 32, ], "type": "Identifier", }, "node": Object { "range": Array [ - 7, - 78, + 0, + 229, ], "type": "ClassDeclaration", }, @@ -1066,15 +1066,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "AbstractSocket", + "name": "AbstractDeclProps", "range": Array [ - 22, - 36, + 15, + 32, ], "type": "Identifier", }, ], - "name": "AbstractSocket", + "name": "AbstractDeclProps", "references": Array [], "scope": Object { "$ref": 3, @@ -1097,63 +1097,13 @@ Object { } `; -exports[`typescript fixtures/basics/abstract-interface.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/arrow-function-with-optional-parameter.src 1`] = ` +exports[`typescript fixtures/basics/abstract-class-with-optional-method.src 1`] = ` Object { "$id": 4, "block": Object { "range": Array [ 0, - 19, + 78, ], "type": "Program", }, @@ -1163,7 +1113,7 @@ Object { "block": Object { "range": Array [ 0, - 19, + 78, ], "type": "Program", }, @@ -1172,89 +1122,65 @@ Object { "$id": 2, "block": Object { "range": Array [ - 1, - 14, + 7, + 78, ], - "type": "ArrowFunctionExpression", + "type": "ClassDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "k", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "class", "upperScope": Object { "$ref": 3, }, "variableMap": Object { - "k": Object { - "$ref": 0, + "AbstractSocket": Object { + "$ref": 1, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 3, }, "variables": Array [ Object { - "$id": 0, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "k", + "name": "AbstractSocket", "range": Array [ - 2, - 4, + 22, + 36, ], "type": "Identifier", }, "node": Object { "range": Array [ - 1, - 14, + 7, + 78, ], - "type": "ArrowFunctionExpression", + "type": "ClassDeclaration", }, - "parent": null, - "type": "Parameter", + "parent": undefined, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "k", + "name": "AbstractSocket", "range": Array [ - 2, - 4, + 22, + 36, ], "type": "Identifier", }, ], - "name": "k", - "references": Array [ - Object { - "$ref": 1, - }, - ], + "name": "AbstractSocket", + "references": Array [], "scope": Object { "$ref": 2, }, @@ -1270,11 +1196,56 @@ Object { "upperScope": Object { "$ref": 4, }, - "variableMap": Object {}, + "variableMap": Object { + "AbstractSocket": Object { + "$ref": 0, + }, + }, "variableScope": Object { "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "AbstractSocket", + "range": Array [ + 22, + 36, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 78, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "AbstractSocket", + "range": Array [ + 22, + 36, + ], + "type": "Identifier", + }, + ], + "name": "AbstractSocket", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -1291,132 +1262,38 @@ Object { } `; -exports[`typescript fixtures/basics/arrow-function-with-type-parameters.src 1`] = ` +exports[`typescript fixtures/basics/abstract-interface.src 1`] = ` Object { - "$id": 4, + "$id": 1, "block": Object { "range": Array [ 0, - 33, + 31, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 0, "block": Object { "range": Array [ 0, - 33, + 31, ], "type": "Program", }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 33, - ], - "type": "ArrowFunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 29, - 30, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "b": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 4, - 8, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 33, - ], - "type": "ArrowFunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 4, - 8, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [ - Object { - "$ref": 1, - }, - ], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 0, }, "variables": Array [], }, @@ -1429,157 +1306,127 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 1, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/async-function-expression.src 1`] = ` +exports[`typescript fixtures/basics/angle-bracket-type-assertion.src 1`] = ` Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, - 30, + 29, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, - 30, + 29, ], "type": "Program", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 3, - "block": Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "foo", "range": Array [ - 1, - 26, + 6, + 9, ], - "type": "FunctionExpression", + "type": "Identifier", }, - "childScopes": Array [ + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 12, + 27, + ], + "type": "TSTypeAssertion", + }, + }, + ], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ Object { - "$id": 2, - "block": Object { + "name": Object { + "name": "foo", "range": Array [ - 1, - 26, + 6, + 9, ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 3, + "type": "Identifier", }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, + "node": Object { + "range": Array [ + 6, + 27, + ], + "type": "VariableDeclarator", }, - "variableScope": Object { - "$ref": 2, + "parent": Object { + "range": Array [ + 0, + 28, + ], + "type": "VariableDeclaration", }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], + "type": "Variable", }, ], - "functionExpressionScope": true, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function-expression-name", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "test": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "test", - "range": Array [ - 16, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 1, - 26, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "test", - "range": Array [ - 16, - 20, - ], - "type": "Identifier", - }, + "name": "foo", + "range": Array [ + 6, + 9, ], - "name": "test", - "references": Array [], - "scope": Object { - "$ref": 3, - }, + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [ + Object { + "$ref": 1, }, ], + "scope": Object { + "$ref": 2, + }, }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], }, ], "functionExpressionScope": false, @@ -1590,304 +1437,122 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/async-function-with-var-declaration.src 1`] = ` +exports[`typescript fixtures/basics/angle-bracket-type-assertion-arrow-function.src 1`] = ` Object { - "$id": 10, + "$id": 6, "block": Object { "range": Array [ 0, - 97, + 45, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 9, + "$id": 5, "block": Object { "range": Array [ 0, - 97, + 45, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 4, "block": Object { "range": Array [ - 0, - 96, + 22, + 42, ], - "type": "FunctionDeclaration", + "type": "ArrowFunctionExpression", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 5, + "$id": 3, "from": Object { - "$ref": 8, + "$ref": 4, }, "identifier": Object { - "name": "foo", - "range": Array [ - 32, - 35, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { + "name": "n", "range": Array [ 38, - 43, - ], - "type": "Literal", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 53, - 56, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 3, - }, - "writeExpr": Object { - "range": Array [ - 59, - 64, - ], - "type": "Literal", - }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "fooBar", - "range": Array [ - 76, - 82, + 39, ], "type": "Identifier", }, - "kind": "w", + "kind": "r", "resolved": Object { - "$ref": 4, - }, - "writeExpr": Object { - "range": Array [ - 85, - 93, - ], - "type": "Literal", + "$ref": 2, }, + "writeExpr": undefined, }, ], "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 9, + "$ref": 5, }, "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "bar": Object { - "$ref": 3, - }, - "foo": Object { + "n": Object { "$ref": 2, }, - "fooBar": Object { - "$ref": 4, - }, }, "variableScope": Object { - "$ref": 8, + "$ref": 4, }, "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, Object { "$id": 2, "defs": Array [ Object { "name": Object { - "name": "foo", - "range": Array [ - 32, - 35, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 32, - 43, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 28, - 44, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 32, - 35, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 53, - 56, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 53, - 64, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 49, - 65, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 53, - 56, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "references": Array [ - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "fooBar", + "name": "n", "range": Array [ - 76, - 82, + 23, + 24, ], "type": "Identifier", }, "node": Object { "range": Array [ - 76, - 93, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 70, - 94, + 22, + 42, ], - "type": "VariableDeclaration", + "type": "ArrowFunctionExpression", }, - "type": "Variable", + "parent": null, + "type": "Parameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "fooBar", + "name": "n", "range": Array [ - 76, - 82, + 23, + 24, ], "type": "Identifier", }, ], - "name": "fooBar", + "name": "n", "references": Array [ Object { - "$ref": 7, + "$ref": 3, }, ], "scope": Object { - "$ref": 8, + "$ref": 4, }, }, ], @@ -1895,19 +1560,45 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "asserted2", + "range": Array [ + 4, + 13, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 16, + 43, + ], + "type": "TSTypeAssertion", + }, + }, + ], + "throughReferences": Array [], + "type": "module", "upperScope": Object { - "$ref": 10, + "$ref": 6, }, "variableMap": Object { - "test": Object { + "asserted2": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 5, }, "variables": Array [ Object { @@ -1915,39 +1606,49 @@ Object { "defs": Array [ Object { "name": Object { - "name": "test", + "name": "asserted2", "range": Array [ - 15, - 19, + 4, + 13, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 4, + 43, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 96, + 44, ], - "type": "FunctionDeclaration", + "type": "VariableDeclaration", }, - "parent": null, - "type": "FunctionName", + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "test", + "name": "asserted2", "range": Array [ - 15, - 19, + 4, + 13, ], "type": "Identifier", }, ], - "name": "test", - "references": Array [], + "name": "asserted2", + "references": Array [ + Object { + "$ref": 1, + }, + ], "scope": Object { - "$ref": 9, + "$ref": 5, }, }, ], @@ -1961,191 +1662,122 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 6, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/await-without-async-function.src 1`] = ` +exports[`typescript fixtures/basics/arrow-function-with-optional-parameter.src 1`] = ` Object { - "$id": 8, + "$id": 4, "block": Object { "range": Array [ 0, - 64, + 19, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 3, "block": Object { "range": Array [ 0, - 64, + 19, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 2, "block": Object { "range": Array [ - 0, - 63, + 1, + 14, ], - "type": "FunctionDeclaration", + "type": "ArrowFunctionExpression", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 25, - 28, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { "$ref": 2, }, - "writeExpr": Object { - "range": Array [ - 31, - 42, - ], - "type": "AwaitExpression", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "baz", - "range": Array [ - 37, - 40, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, "identifier": Object { - "name": "bar", + "name": "k", "range": Array [ - 53, - 56, + 9, + 10, ], "type": "Identifier", }, "kind": "r", "resolved": Object { - "$ref": 2, + "$ref": 0, }, "writeExpr": undefined, }, ], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 7, + "$ref": 3, }, "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "bar": Object { - "$ref": 2, + "k": Object { + "$ref": 0, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 2, }, "variables": Array [ Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 2, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "bar", + "name": "k", "range": Array [ - 25, - 28, + 2, + 4, ], "type": "Identifier", }, "node": Object { "range": Array [ - 25, - 42, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 19, - 43, + 1, + 14, ], - "type": "VariableDeclaration", + "type": "ArrowFunctionExpression", }, - "type": "Variable", + "parent": null, + "type": "Parameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "bar", + "name": "k", "range": Array [ - 25, - 28, + 2, + 4, ], "type": "Identifier", }, ], - "name": "bar", + "name": "k", "references": Array [ Object { - "$ref": 3, - }, - Object { - "$ref": 5, + "$ref": 1, }, ], "scope": Object { - "$ref": 6, + "$ref": 2, }, }, ], @@ -2154,117 +1786,14 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, + "$ref": 4, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 63, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/call-signatures.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 62, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 62, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, + "$ref": 3, }, "variables": Array [], }, @@ -2277,44 +1806,138 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/call-signatures-with-generics.src 1`] = ` +exports[`typescript fixtures/basics/arrow-function-with-type-parameters.src 1`] = ` Object { - "$id": 1, + "$id": 4, "block": Object { "range": Array [ 0, - 68, + 33, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 3, "block": Object { "range": Array [ 0, - 68, + 33, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 33, + ], + "type": "ArrowFunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "b": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "b", + "range": Array [ + 4, + 8, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 33, + ], + "type": "ArrowFunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "b", + "range": Array [ + 4, + 8, + ], + "type": "Identifier", + }, + ], + "name": "b", + "references": Array [ + Object { + "$ref": 1, + }, + ], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 1, + "$ref": 4, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 3, }, "variables": Array [], }, @@ -2327,165 +1950,155 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/cast-as-expression.src 1`] = ` +exports[`typescript fixtures/basics/async-function-expression.src 1`] = ` Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, - 18, + 30, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, - 18, + 30, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { - "$id": 0, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "x", + "$id": 3, + "block": Object { "range": Array [ - 0, 1, + 26, ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", + "type": "FunctionExpression", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/cast-as-multi.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 1, + 26, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": true, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function-expression-name", + "upperScope": Object { + "$ref": 4, }, - "identifier": Object { - "name": "x", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", + "variableMap": Object { + "test": Object { + "$ref": 0, + }, }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "test", + "range": Array [ + 16, + 20, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 1, + 26, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "test", + "range": Array [ + 16, + 20, + ], + "type": "Identifier", + }, + ], + "name": "test", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 5, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, "variables": Array [], }, @@ -2493,415 +2106,309 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/cast-as-multi-assign.src 1`] = ` +exports[`typescript fixtures/basics/async-function-with-var-declaration.src 1`] = ` Object { - "$id": 2, + "$id": 10, "block": Object { "range": Array [ 0, - 27, + 97, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 9, "block": Object { "range": Array [ 0, - 27, + 97, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "a", + "$id": 8, + "block": Object { "range": Array [ - 1, - 2, + 0, + 96, ], - "type": "Identifier", + "type": "FunctionDeclaration", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/cast-as-operator.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 19, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/cast-as-simple.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 12, - 20, - ], - "type": "TSAsExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { + "$id": 5, + "from": Object { + "$ref": 8, + }, + "identifier": Object { "name": "foo", "range": Array [ - 6, - 9, + 32, + 35, ], "type": "Identifier", }, - "node": Object { + "kind": "w", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": Object { "range": Array [ - 6, - 20, + 38, + 43, ], - "type": "VariableDeclarator", + "type": "Literal", }, - "parent": Object { + }, + Object { + "$id": 6, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "bar", "range": Array [ - 0, - 21, + 53, + 56, ], - "type": "VariableDeclaration", + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": Object { + "range": Array [ + 59, + 64, + ], + "type": "Literal", }, - "type": "Variable", }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", + "$id": 7, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "fooBar", + "range": Array [ + 76, + 82, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 4, + }, + "writeExpr": Object { + "range": Array [ + 85, + 93, + ], + "type": "Literal", + }, }, ], - "name": "foo", - "references": Array [ - Object { + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { + "arguments": Object { "$ref": 1, }, - ], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/class-multi-line-keyword-abstract.src 1`] = ` -Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 20, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 9, - 19, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "B": Object { - "$ref": 2, - }, + "bar": Object { + "$ref": 3, + }, + "foo": Object { + "$ref": 2, + }, + "fooBar": Object { + "$ref": 4, + }, }, "variableScope": Object { - "$ref": 4, + "$ref": 8, }, "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 8, + }, + }, Object { "$id": 2, "defs": Array [ Object { "name": Object { - "name": "B", + "name": "foo", "range": Array [ - 15, - 16, + 32, + 35, ], "type": "Identifier", }, "node": Object { "range": Array [ - 9, - 19, + 32, + 43, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": undefined, - "type": "ClassName", + "parent": Object { + "range": Array [ + 28, + 44, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "B", + "name": "foo", "range": Array [ - 15, - 16, + 32, + 35, ], "type": "Identifier", }, ], - "name": "B", - "references": Array [], + "name": "foo", + "references": Array [ + Object { + "$ref": 5, + }, + ], "scope": Object { - "$ref": 3, + "$ref": 8, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "bar", + "range": Array [ + 53, + 56, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 53, + 64, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 49, + 65, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "bar", + "range": Array [ + 53, + 56, + ], + "type": "Identifier", + }, + ], + "name": "bar", + "references": Array [ + Object { + "$ref": 6, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + Object { + "$id": 4, + "defs": Array [ + Object { + "name": Object { + "name": "fooBar", + "range": Array [ + 76, + 82, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 76, + 93, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 70, + 94, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "fooBar", + "range": Array [ + 76, + 82, + ], + "type": "Identifier", + }, + ], + "name": "fooBar", + "references": Array [ + Object { + "$ref": 7, + }, + ], + "scope": Object { + "$ref": 8, }, }, ], @@ -2909,41 +2416,19 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "abstract", - "range": Array [ - 0, - 8, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 10, }, "variableMap": Object { - "B": Object { + "test": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 9, }, "variables": Array [ Object { @@ -2951,39 +2436,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "B", + "name": "test", "range": Array [ 15, - 16, + 19, ], "type": "Identifier", }, "node": Object { "range": Array [ - 9, - 19, + 0, + 96, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, "parent": null, - "type": "ClassName", + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "B", + "name": "test", "range": Array [ 15, - 16, + 19, ], "type": "Identifier", }, ], - "name": "B", + "name": "test", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 9, }, }, ], @@ -2992,107 +2477,196 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 10, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-multi-line-keyword-declare.src 1`] = ` +exports[`typescript fixtures/basics/await-without-async-function.src 1`] = ` Object { - "$id": 5, + "$id": 8, "block": Object { "range": Array [ 0, - 19, + 64, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 7, "block": Object { "range": Array [ 0, - 19, + 64, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 6, "block": Object { "range": Array [ - 8, - 18, + 0, + 63, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": Object { + "range": Array [ + 31, + 42, + ], + "type": "AwaitExpression", + }, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "baz", + "range": Array [ + 37, + 40, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 53, + 56, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "function", "upperScope": Object { - "$ref": 4, + "$ref": 7, }, "variableMap": Object { - "B": Object { + "arguments": Object { + "$ref": 1, + }, + "bar": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, Object { "$id": 2, "defs": Array [ Object { "name": Object { - "name": "B", + "name": "bar", "range": Array [ - 14, - 15, + 25, + 28, ], "type": "Identifier", }, "node": Object { "range": Array [ - 8, - 18, + 25, + 42, ], - "type": "ClassDeclaration", + "type": "VariableDeclarator", }, - "parent": undefined, - "type": "ClassName", + "parent": Object { + "range": Array [ + 19, + 43, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "B", + "name": "bar", "range": Array [ - 14, - 15, + 25, + 28, ], "type": "Identifier", }, ], - "name": "B", - "references": Array [], + "name": "bar", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + ], "scope": Object { - "$ref": 3, + "$ref": 6, }, }, ], @@ -3100,41 +2674,23 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "declare", - "range": Array [ - 0, - 7, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 4, }, ], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 8, }, "variableMap": Object { - "B": Object { + "foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [ Object { @@ -3142,39 +2698,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "B", + "name": "foo", "range": Array [ - 14, - 15, + 9, + 12, ], "type": "Identifier", }, "node": Object { "range": Array [ - 8, - 18, + 0, + 63, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, "parent": null, - "type": "ClassName", + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "B", + "name": "foo", "range": Array [ - 14, - 15, + 9, + 12, ], "type": "Identifier", }, ], - "name": "B", + "name": "foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 7, }, }, ], @@ -3185,316 +2741,53 @@ Object { "references": Array [], "throughReferences": Array [ Object { - "$ref": 1, + "$ref": 4, }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 8, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-accessibility-modifiers.src 1`] = ` +exports[`typescript fixtures/basics/call-signatures.src 1`] = ` Object { - "$id": 10, + "$id": 1, "block": Object { "range": Array [ 0, - 174, + 62, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 9, + "$id": 0, "block": Object { "range": Array [ 0, - 174, + 62, ], "type": "Program", }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 173, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 82, - 111, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - Object { - "$id": 7, - "block": Object { - "range": Array [ - 131, - 171, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 6, - "from": Object { - "$ref": 7, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 163, - 166, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 5, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 4, - }, - "bar": Object { - "$ref": 5, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 132, - 144, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 131, - 171, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 132, - 144, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "references": Array [ - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 173, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, + "$ref": 1, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 0, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 173, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -3505,242 +2798,46 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 1, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-constructor-and-modifier.src 1`] = ` +exports[`typescript fixtures/basics/call-signatures-with-generics.src 1`] = ` Object { - "$id": 8, + "$id": 1, "block": Object { "range": Array [ 0, - 74, + 68, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 0, "block": Object { "range": Array [ 0, - 74, + 68, ], "type": "Program", }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 73, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 33, - 39, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - Object { - "$id": 5, - "block": Object { - "range": Array [ - 65, - 71, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "C": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 73, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], - }, - ], + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "C": Object { - "$ref": 0, - }, + "$ref": 1, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 0, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 73, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -3751,605 +2848,417 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 1, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-constructor-and-return-type.src 1`] = ` +exports[`typescript fixtures/basics/cast-as-expression.src 1`] = ` Object { - "$id": 8, + "$id": 3, "block": Object { "range": Array [ 0, - 73, + 18, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 2, "block": Object { "range": Array [ 0, - 73, + 18, ], "type": "Program", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 6, - "block": Object { + "$id": 0, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "x", "range": Array [ 0, - 72, + 1, ], - "type": "ClassDeclaration", + "type": "Identifier", }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 23, - 37, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - Object { - "$id": 5, - "block": Object { - "range": Array [ - 56, - 70, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "C": Object { - "$ref": 1, - }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 1, + "from": Object { + "$ref": 2, }, - "variableScope": Object { - "$ref": 7, + "identifier": Object { + "name": "y", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 72, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "C": Object { + "throughReferences": Array [ + Object { "$ref": 0, }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 72, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 7, - }, + "$ref": 1, }, ], + "type": "module", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-constructor-and-type-parameters.src 1`] = ` +exports[`typescript fixtures/basics/cast-as-multi.src 1`] = ` Object { - "$id": 8, + "$id": 2, "block": Object { "range": Array [ 0, - 63, + 15, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 1, "block": Object { "range": Array [ 0, - 63, + 15, ], "type": "Program", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 6, - "block": Object { + "$id": 0, + "from": Object { + "$ref": 1, + }, + "identifier": Object { + "name": "x", "range": Array [ 0, - 62, + 1, ], - "type": "ClassDeclaration", + "type": "Identifier", }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 23, - 32, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - Object { - "$id": 5, - "block": Object { - "range": Array [ - 51, - 60, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "C": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 62, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - ], + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "C": Object { + "throughReferences": Array [ + Object { "$ref": 0, }, + ], + "type": "module", + "upperScope": Object { + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 1, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 62, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 2, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-definite-assignment.src 1`] = ` +exports[`typescript fixtures/basics/cast-as-multi-assign.src 1`] = ` Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, - 26, + 27, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 1, "block": Object { "range": Array [ 0, - 26, + 27, ], "type": "Program", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 2, - "block": Object { + "$id": 0, + "from": Object { + "$ref": 1, + }, + "identifier": Object { + "name": "a", "range": Array [ - 0, - 25, + 1, + 2, ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "X": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 3, + "type": "Identifier", }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "X", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 25, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "X", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "X", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 0, }, ], + "type": "module", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/cast-as-operator.src 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 19, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 19, + ], + "type": "Program", + }, + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 0, + "from": Object { + "$ref": 1, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/cast-as-simple.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 22, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 22, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 12, + 20, + ], + "type": "TSAsExpression", + }, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", "upperScope": Object { "$ref": 4, }, "variableMap": Object { - "X": Object { + "foo": Object { "$ref": 0, }, }, @@ -4362,37 +3271,47 @@ Object { "defs": Array [ Object { "name": Object { - "name": "X", + "name": "foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 6, + 20, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 25, + 21, ], - "type": "ClassDeclaration", + "type": "VariableDeclaration", }, - "parent": null, - "type": "ClassName", + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "X", + "name": "foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, ], - "name": "X", - "references": Array [], + "name": "foo", + "references": Array [ + Object { + "$ref": 1, + }, + ], "scope": Object { "$ref": 3, }, @@ -4403,165 +3322,85 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-export-parameter-properties.src 1`] = ` +exports[`typescript fixtures/basics/class-multi-line-keyword-abstract.src 1`] = ` Object { - "$id": 7, + "$id": 5, "block": Object { "range": Array [ 0, - 58, + 20, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, - 58, + 20, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ - 0, - 56, + 9, + 19, ], "type": "ClassDeclaration", }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 27, - 54, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "a": Object { - "$ref": 3, - }, - "arguments": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 35, - 44, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 27, - 54, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 35, - 44, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 6, + "$ref": 4, }, "variableMap": Object { - "Foo": Object { - "$ref": 1, + "B": Object { + "$ref": 2, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 4, }, "variables": Array [ Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "B", "range": Array [ - 6, - 9, + 15, + 16, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 56, + 9, + 19, ], "type": "ClassDeclaration", }, @@ -4572,18 +3411,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "B", "range": Array [ - 6, - 9, + 15, + 16, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "B", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 3, }, }, ], @@ -4591,19 +3430,41 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "abstract", + "range": Array [ + 0, + 8, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 5, }, "variableMap": Object { - "Foo": Object { + "B": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 4, }, "variables": Array [ Object { @@ -4611,17 +3472,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "B", "range": Array [ - 6, - 9, + 15, + 16, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 56, + 9, + 19, ], "type": "ClassDeclaration", }, @@ -4632,18 +3493,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "B", "range": Array [ - 6, - 9, + 15, + 16, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "B", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 4, }, }, ], @@ -4652,24 +3513,28 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-extends-and-implements.src 1`] = ` +exports[`typescript fixtures/basics/class-multi-line-keyword-declare.src 1`] = ` Object { "$id": 5, "block": Object { "range": Array [ 0, - 81, + 19, ], "type": "Program", }, @@ -4679,7 +3544,7 @@ Object { "block": Object { "range": Array [ 0, - 81, + 19, ], "type": "Program", }, @@ -4688,8 +3553,8 @@ Object { "$id": 3, "block": Object { "range": Array [ - 0, - 80, + 8, + 18, ], "type": "ClassDeclaration", }, @@ -4703,7 +3568,7 @@ Object { "$ref": 4, }, "variableMap": Object { - "ClassWithParentAndInterface": Object { + "B": Object { "$ref": 2, }, }, @@ -4716,17 +3581,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "ClassWithParentAndInterface", + "name": "B", "range": Array [ - 6, - 33, + 14, + 15, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 80, + 8, + 18, ], "type": "ClassDeclaration", }, @@ -4737,15 +3602,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "ClassWithParentAndInterface", + "name": "B", "range": Array [ - 6, - 33, + 14, + 15, ], "type": "Identifier", }, ], - "name": "ClassWithParentAndInterface", + "name": "B", "references": Array [], "scope": Object { "$ref": 3, @@ -4763,10 +3628,10 @@ Object { "$ref": 4, }, "identifier": Object { - "name": "MyOtherClass", + "name": "declare", "range": Array [ - 42, - 54, + 0, + 7, ], "type": "Identifier", }, @@ -4785,7 +3650,7 @@ Object { "$ref": 5, }, "variableMap": Object { - "ClassWithParentAndInterface": Object { + "B": Object { "$ref": 0, }, }, @@ -4798,17 +3663,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "ClassWithParentAndInterface", + "name": "B", "range": Array [ - 6, - 33, + 14, + 15, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 80, + 8, + 18, ], "type": "ClassDeclaration", }, @@ -4819,15 +3684,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "ClassWithParentAndInterface", + "name": "B", "range": Array [ - 6, - 33, + 14, + 15, ], "type": "Identifier", }, ], - "name": "ClassWithParentAndInterface", + "name": "B", "references": Array [], "scope": Object { "$ref": 4, @@ -4854,56 +3719,204 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-extends-generic.src 1`] = ` +exports[`typescript fixtures/basics/class-with-accessibility-modifiers.src 1`] = ` Object { - "$id": 5, + "$id": 10, "block": Object { "range": Array [ 0, - 33, + 174, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 9, "block": Object { "range": Array [ 0, - 33, + 174, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 8, "block": Object { "range": Array [ 0, - 32, + 173, ], "type": "ClassDeclaration", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 82, + 111, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + Object { + "$id": 7, + "block": Object { + "range": Array [ + 131, + 171, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 6, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 163, + 166, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 5, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 4, + }, + "bar": Object { + "$ref": 5, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 4, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + Object { + "$id": 5, + "defs": Array [ + Object { + "name": Object { + "name": "bar", + "range": Array [ + 132, + 144, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 131, + 171, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "bar", + "range": Array [ + 132, + 144, + ], + "type": "Identifier", + }, + ], + "name": "bar", + "references": Array [ + Object { + "$ref": 6, + }, + ], + "scope": Object { + "$ref": 7, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 4, + "$ref": 9, }, "variableMap": Object { "Foo": Object { - "$ref": 2, + "$ref": 1, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 9, }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { @@ -4917,7 +3930,7 @@ Object { "node": Object { "range": Array [ 0, - 32, + 173, ], "type": "ClassDeclaration", }, @@ -4939,7 +3952,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 8, }, }, ], @@ -4947,33 +3960,11 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "Bar", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 10, }, "variableMap": Object { "Foo": Object { @@ -4981,7 +3972,7 @@ Object { }, }, "variableScope": Object { - "$ref": 4, + "$ref": 9, }, "variables": Array [ Object { @@ -4999,7 +3990,7 @@ Object { "node": Object { "range": Array [ 0, - 32, + 173, ], "type": "ClassDeclaration", }, @@ -5021,7 +4012,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 9, }, }, ], @@ -5030,85 +4021,162 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 10, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-extends-generic-multiple.src 1`] = ` +exports[`typescript fixtures/basics/class-with-constructor-and-modifier.src 1`] = ` Object { - "$id": 5, + "$id": 8, "block": Object { "range": Array [ 0, - 46, + 74, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 7, "block": Object { "range": Array [ 0, - 46, + 74, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 6, "block": Object { "range": Array [ 0, - 45, + 73, ], "type": "ClassDeclaration", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ + "childScopes": Array [ Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", + "$id": 3, + "block": Object { + "range": Array [ + 33, + 39, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + Object { + "$id": 5, + "block": Object { + "range": Array [ + 65, + 71, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 4, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 4, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "C": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "C", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 45, + 73, ], "type": "ClassDeclaration", }, @@ -5119,18 +4187,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "C", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "C", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 6, }, }, ], @@ -5138,41 +4206,19 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "Bar", - "range": Array [ - 31, - 34, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 8, }, "variableMap": Object { - "Foo": Object { + "C": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [ Object { @@ -5180,17 +4226,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "C", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 45, + 73, ], "type": "ClassDeclaration", }, @@ -5201,18 +4247,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "C", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "C", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 7, }, }, ], @@ -5221,48 +4267,44 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 8, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-generic-method.src 1`] = ` +exports[`typescript fixtures/basics/class-with-constructor-and-return-type.src 1`] = ` Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, - 31, + 73, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, - 31, + 73, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, - 30, + 72, ], "type": "ClassDeclaration", }, @@ -5271,8 +4313,8 @@ Object { "$id": 3, "block": Object { "range": Array [ - 20, - 28, + 23, + 37, ], "type": "FunctionExpression", }, @@ -5283,7 +4325,7 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { "arguments": Object { @@ -5307,6 +4349,46 @@ Object { }, ], }, + Object { + "$id": 5, + "block": Object { + "range": Array [ + 56, + 70, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 4, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 4, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, ], "functionExpressionScope": false, "isStrict": true, @@ -5314,15 +4396,15 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 5, + "$ref": 7, }, "variableMap": Object { - "Foo": Object { + "C": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [ Object { @@ -5330,17 +4412,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "C", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 30, + 72, ], "type": "ClassDeclaration", }, @@ -5351,18 +4433,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "C", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "C", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 6, }, }, ], @@ -5374,15 +4456,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { - "Foo": Object { + "C": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [ Object { @@ -5390,17 +4472,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "C", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 30, + 72, ], "type": "ClassDeclaration", }, @@ -5411,18 +4493,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "C", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "C", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 7, }, }, ], @@ -5436,39 +4518,39 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 8, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-generic-method-default.src 1`] = ` +exports[`typescript fixtures/basics/class-with-constructor-and-type-parameters.src 1`] = ` Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, - 37, + 63, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ 0, - 37, + 63, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, - 36, + 62, ], "type": "ClassDeclaration", }, @@ -5477,8 +4559,8 @@ Object { "$id": 3, "block": Object { "range": Array [ - 20, - 34, + 23, + 32, ], "type": "FunctionExpression", }, @@ -5489,7 +4571,7 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { "arguments": Object { @@ -5513,6 +4595,46 @@ Object { }, ], }, + Object { + "$id": 5, + "block": Object { + "range": Array [ + 51, + 60, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 4, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 4, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, ], "functionExpressionScope": false, "isStrict": true, @@ -5520,15 +4642,15 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 5, + "$ref": 7, }, "variableMap": Object { - "Foo": Object { + "C": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [ Object { @@ -5536,17 +4658,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "C", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 36, + 62, ], "type": "ClassDeclaration", }, @@ -5557,18 +4679,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "C", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "C", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 6, }, }, ], @@ -5580,15 +4702,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { - "Foo": Object { + "C": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [ Object { @@ -5596,17 +4718,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "C", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 36, + 62, ], "type": "ClassDeclaration", }, @@ -5617,18 +4739,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "C", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "C", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 7, }, }, ], @@ -5642,19 +4764,19 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 8, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-implements.src 1`] = ` +exports[`typescript fixtures/basics/class-with-declare-properties.src 1`] = ` Object { "$id": 4, "block": Object { "range": Array [ 0, - 30, + 271, ], "type": "Program", }, @@ -5664,7 +4786,7 @@ Object { "block": Object { "range": Array [ 0, - 30, + 271, ], "type": "Program", }, @@ -5674,7 +4796,7 @@ Object { "block": Object { "range": Array [ 0, - 29, + 270, ], "type": "ClassDeclaration", }, @@ -5688,7 +4810,7 @@ Object { "$ref": 3, }, "variableMap": Object { - "Foo": Object { + "DeclProps": Object { "$ref": 1, }, }, @@ -5701,17 +4823,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "DeclProps", "range": Array [ 6, - 9, + 15, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 29, + 270, ], "type": "ClassDeclaration", }, @@ -5722,15 +4844,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "DeclProps", "range": Array [ 6, - 9, + 15, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "DeclProps", "references": Array [], "scope": Object { "$ref": 2, @@ -5748,7 +4870,7 @@ Object { "$ref": 4, }, "variableMap": Object { - "Foo": Object { + "DeclProps": Object { "$ref": 0, }, }, @@ -5761,17 +4883,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "DeclProps", "range": Array [ 6, - 9, + 15, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 29, + 270, ], "type": "ClassDeclaration", }, @@ -5782,15 +4904,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "DeclProps", "range": Array [ 6, - 9, + 15, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "DeclProps", "references": Array [], "scope": Object { "$ref": 3, @@ -5813,33 +4935,33 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-implements-and-extends.src 1`] = ` +exports[`typescript fixtures/basics/class-with-definite-assignment.src 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, - 81, + 26, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, - 81, + 26, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, - 80, + 25, ], "type": "ClassDeclaration", }, @@ -5850,33 +4972,33 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object { - "ClassWithParentAndInterface": Object { - "$ref": 2, + "X": Object { + "$ref": 1, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "ClassWithParentAndInterface", + "name": "X", "range": Array [ 6, - 33, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 80, + 25, ], "type": "ClassDeclaration", }, @@ -5887,18 +5009,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "ClassWithParentAndInterface", + "name": "X", "range": Array [ 6, - 33, + 7, ], "type": "Identifier", }, ], - "name": "ClassWithParentAndInterface", + "name": "X", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -5906,41 +5028,19 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "MyOtherClass", - "range": Array [ - 65, - 77, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 4, }, "variableMap": Object { - "ClassWithParentAndInterface": Object { + "X": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [ Object { @@ -5948,17 +5048,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "ClassWithParentAndInterface", + "name": "X", "range": Array [ 6, - 33, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 80, + 25, ], "type": "ClassDeclaration", }, @@ -5969,18 +5069,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "ClassWithParentAndInterface", + "name": "X", "range": Array [ 6, - 33, + 7, ], "type": "Identifier", }, ], - "name": "ClassWithParentAndInterface", + "name": "X", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 3, }, }, ], @@ -5989,67 +5089,147 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-implements-generic.src 1`] = ` +exports[`typescript fixtures/basics/class-with-export-parameter-properties.src 1`] = ` Object { - "$id": 4, + "$id": 7, "block": Object { "range": Array [ 0, - 33, + 58, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 6, "block": Object { "range": Array [ 0, - 33, + 58, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 5, "block": Object { "range": Array [ 0, - 32, + 56, ], "type": "ClassDeclaration", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 27, + 54, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "a": Object { + "$ref": 3, + }, + "arguments": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "a", + "range": Array [ + 35, + 44, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 27, + 54, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 35, + 44, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { "Foo": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 6, }, "variables": Array [ Object { @@ -6067,7 +5247,7 @@ Object { "node": Object { "range": Array [ 0, - 32, + 56, ], "type": "ClassDeclaration", }, @@ -6089,7 +5269,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 5, }, }, ], @@ -6101,7 +5281,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 7, }, "variableMap": Object { "Foo": Object { @@ -6109,7 +5289,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 6, }, "variables": Array [ Object { @@ -6127,7 +5307,7 @@ Object { "node": Object { "range": Array [ 0, - 32, + 56, ], "type": "ClassDeclaration", }, @@ -6149,7 +5329,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 6, }, }, ], @@ -6163,39 +5343,39 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 7, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-implements-generic-multiple.src 1`] = ` +exports[`typescript fixtures/basics/class-with-extends-and-implements.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, - 36, + 81, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, - 36, + 81, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, - 35, + 80, ], "type": "ClassDeclaration", }, @@ -6206,33 +5386,33 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { - "Foo": Object { - "$ref": 1, + "ClassWithParentAndInterface": Object { + "$ref": 2, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "ClassWithParentAndInterface", "range": Array [ 6, - 9, + 33, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 35, + 80, ], "type": "ClassDeclaration", }, @@ -6243,18 +5423,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "ClassWithParentAndInterface", "range": Array [ 6, - 9, + 33, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "ClassWithParentAndInterface", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -6262,19 +5442,41 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "MyOtherClass", + "range": Array [ + 42, + 54, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { - "Foo": Object { + "ClassWithParentAndInterface": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -6282,17 +5484,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "ClassWithParentAndInterface", "range": Array [ 6, - 9, + 33, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 35, + 80, ], "type": "ClassDeclaration", }, @@ -6303,18 +5505,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "ClassWithParentAndInterface", "range": Array [ 6, - 9, + 33, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "ClassWithParentAndInterface", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -6323,202 +5525,85 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-method.src 1`] = ` +exports[`typescript fixtures/basics/class-with-extends-generic.src 1`] = ` Object { - "$id": 10, + "$id": 5, "block": Object { "range": Array [ 0, - 58, + 33, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 9, + "$id": 4, "block": Object { "range": Array [ 0, - 58, + 33, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 3, "block": Object { "range": Array [ 0, - 57, + 32, ], "type": "ClassDeclaration", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ Object { - "$id": 3, - "block": Object { - "range": Array [ - 15, - 29, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - Object { - "$id": 5, - "block": Object { - "range": Array [ - 35, - 44, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 4, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - Object { - "$id": 7, - "block": Object { - "range": Array [ - 50, - 55, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 6, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ - Object { - "$id": 6, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "C": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 1, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "C", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 57, + 32, ], "type": "ClassDeclaration", }, @@ -6529,18 +5614,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "C", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, ], - "name": "C", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 3, }, }, ], @@ -6548,19 +5633,41 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "Bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "module", "upperScope": Object { - "$ref": 10, + "$ref": 5, }, "variableMap": Object { - "C": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 4, }, "variables": Array [ Object { @@ -6568,17 +5675,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "C", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 57, + 32, ], "type": "ClassDeclaration", }, @@ -6589,18 +5696,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "C", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, ], - "name": "C", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 4, }, }, ], @@ -6609,282 +5716,85 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-mixin.src 1`] = ` +exports[`typescript fixtures/basics/class-with-extends-generic-multiple.src 1`] = ` Object { - "$id": 15, + "$id": 5, "block": Object { "range": Array [ 0, - 207, + 46, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 14, + "$id": 4, "block": Object { "range": Array [ 0, - 207, + 46, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 9, + "$id": 3, "block": Object { "range": Array [ 0, - 84, + 45, ], - "type": "FunctionDeclaration", + "type": "ClassDeclaration", }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 60, - 82, - ], - "type": "ClassExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], - }, - ], + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 7, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "Base", - "range": Array [ - 74, - 78, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 6, - }, - "writeExpr": undefined, - }, - ], + "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "class", "upperScope": Object { - "$ref": 14, + "$ref": 4, }, "variableMap": Object { - "Base": Object { - "$ref": 6, - }, - "arguments": Object { - "$ref": 5, + "Foo": Object { + "$ref": 2, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 4, }, "variables": Array [ Object { - "$id": 5, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, - Object { - "$id": 6, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "Base", + "name": "Foo", "range": Array [ - 38, - 45, + 6, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 84, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Base", - "range": Array [ - 38, - 45, - ], - "type": "Identifier", - }, - ], - "name": "Base", - "references": Array [ - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 9, - }, - }, - ], - }, - Object { - "$id": 11, - "block": Object { - "range": Array [ - 86, - 128, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 14, - }, - "variableMap": Object { - "X": Object { - "$ref": 10, - }, - }, - "variableScope": Object { - "$ref": 14, - }, - "variables": Array [ - Object { - "$id": 10, - "defs": Array [ - Object { - "name": Object { - "name": "X", - "range": Array [ - 92, - 93, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 86, - 128, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "X", - "range": Array [ - 92, - 93, - ], - "type": "Identifier", - }, - ], - "name": "X", - "references": Array [], - "scope": Object { - "$ref": 11, - }, - }, - ], - }, - Object { - "$id": 13, - "block": Object { - "range": Array [ - 130, - 141, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 14, - }, - "variableMap": Object { - "C": Object { - "$ref": 12, - }, - }, - "variableScope": Object { - "$ref": 14, - }, - "variables": Array [ - Object { - "$id": 12, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 136, - 137, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 130, - 141, + 45, ], "type": "ClassDeclaration", }, @@ -6895,18 +5805,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "C", + "name": "Foo", "range": Array [ - 136, - 137, + 6, + 9, ], "type": "Identifier", }, ], - "name": "C", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 13, + "$ref": 3, }, }, ], @@ -6916,62 +5826,39 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 14, + "$ref": 4, }, "identifier": Object { - "name": "M", + "name": "Bar", "range": Array [ - 102, - 103, + 31, + 34, ], "type": "Identifier", }, "kind": "r", - "resolved": Object { - "$ref": 0, - }, + "resolved": null, "writeExpr": undefined, }, + ], + "throughReferences": Array [ Object { - "$id": 4, - "from": Object { - "$ref": 14, - }, - "identifier": Object { - "name": "C", - "range": Array [ - 109, - 110, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, + "$ref": 1, }, ], - "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 15, + "$ref": 5, }, "variableMap": Object { - "C": Object { - "$ref": 2, - }, - "M": Object { + "Foo": Object { "$ref": 0, }, - "X": Object { - "$ref": 1, - }, }, "variableScope": Object { - "$ref": 14, + "$ref": 4, }, "variables": Array [ Object { @@ -6979,127 +5866,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "M", + "name": "Foo", "range": Array [ + 6, 9, - 10, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 84, + 45, ], - "type": "FunctionDeclaration", + "type": "ClassDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "M", + "name": "Foo", "range": Array [ + 6, 9, - 10, ], "type": "Identifier", }, ], - "name": "M", - "references": Array [ - Object { - "$ref": 3, - }, - ], + "name": "Foo", + "references": Array [], "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "X", - "range": Array [ - 92, - 93, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 86, - 128, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "X", - "range": Array [ - 92, - 93, - ], - "type": "Identifier", - }, - ], - "name": "X", - "references": Array [], - "scope": Object { - "$ref": 14, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "C", - "range": Array [ - 136, - 137, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 130, - 141, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "C", - "range": Array [ - 136, - 137, - ], - "type": "Identifier", - }, - ], - "name": "C", - "references": Array [ - Object { - "$ref": 4, - }, - ], - "scope": Object { - "$ref": 14, + "$ref": 4, }, }, ], @@ -7108,117 +5907,148 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 15, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-mixin-reference.src 1`] = ` +exports[`typescript fixtures/basics/class-with-generic-method.src 1`] = ` Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, - 50, + 31, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, - 50, + 31, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, - 49, + 30, ], - "type": "FunctionDeclaration", + "type": "ClassDeclaration", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 20, + 28, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "class", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { - "Base": Object { - "$ref": 2, - }, - "arguments": Object { + "Foo": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - Object { - "$id": 2, "defs": Array [ Object { "name": Object { - "name": "Base", + "name": "Foo", "range": Array [ - 37, - 44, + 6, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 49, + 30, ], - "type": "FunctionDeclaration", + "type": "ClassDeclaration", }, - "parent": null, - "type": "Parameter", + "parent": undefined, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Base", + "name": "Foo", "range": Array [ - 37, - 44, + 6, + 9, ], "type": "Identifier", }, ], - "name": "Base", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -7230,15 +6060,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { - "M": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -7246,39 +6076,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "M", + "name": "Foo", "range": Array [ + 6, 9, - 10, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 49, + 30, ], - "type": "FunctionDeclaration", + "type": "ClassDeclaration", }, "parent": null, - "type": "FunctionName", + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "M", + "name": "Foo", "range": Array [ + 6, 9, - 10, ], "type": "Identifier", }, ], - "name": "M", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -7292,80 +6122,99 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-optional-computed-property.src 1`] = ` +exports[`typescript fixtures/basics/class-with-generic-method-default.src 1`] = ` Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, - 46, + 37, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, - 46, + 37, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, - 45, + 36, ], "type": "ClassDeclaration", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "undefined", + "$id": 3, + "block": Object { "range": Array [ - 33, - 42, + 20, + 34, ], - "type": "Identifier", + "type": "FunctionExpression", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { - "X": Object { + "Foo": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -7373,17 +6222,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "X", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 45, + 36, ], "type": "ClassDeclaration", }, @@ -7394,18 +6243,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "X", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, ], - "name": "X", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -7414,22 +6263,18 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { - "X": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [ Object { @@ -7437,17 +6282,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "X", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 45, + 36, ], "type": "ClassDeclaration", }, @@ -7458,18 +6303,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "X", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, ], - "name": "X", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -7478,28 +6323,24 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-optional-methods.src 1`] = ` +exports[`typescript fixtures/basics/class-with-implements.src 1`] = ` Object { "$id": 4, "block": Object { "range": Array [ 0, - 68, + 30, ], "type": "Program", }, @@ -7509,7 +6350,7 @@ Object { "block": Object { "range": Array [ 0, - 68, + 30, ], "type": "Program", }, @@ -7519,7 +6360,7 @@ Object { "block": Object { "range": Array [ 0, - 67, + 29, ], "type": "ClassDeclaration", }, @@ -7556,7 +6397,7 @@ Object { "node": Object { "range": Array [ 0, - 67, + 29, ], "type": "ClassDeclaration", }, @@ -7616,7 +6457,7 @@ Object { "node": Object { "range": Array [ 0, - 67, + 29, ], "type": "ClassDeclaration", }, @@ -7658,116 +6499,70 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-optional-properties.src 1`] = ` +exports[`typescript fixtures/basics/class-with-implements-and-extends.src 1`] = ` Object { - "$id": 10, + "$id": 5, "block": Object { "range": Array [ 0, - 219, + 81, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 9, + "$id": 4, "block": Object { "range": Array [ 0, - 219, + 81, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 3, "block": Object { "range": Array [ - 51, - 218, + 0, + 80, ], "type": "ClassDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 6, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "computed", - "range": Array [ - 116, - 124, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": undefined, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "computed2", - "range": Array [ - 155, - 164, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 6, - }, - Object { - "$ref": 7, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 9, + "$ref": 4, }, "variableMap": Object { - "Foo": Object { - "$ref": 5, + "ClassWithParentAndInterface": Object { + "$ref": 2, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 4, }, "variables": Array [ Object { - "$id": 5, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "ClassWithParentAndInterface", "range": Array [ - 57, - 60, + 6, + 33, ], "type": "Identifier", }, "node": Object { "range": Array [ - 51, - 218, + 0, + 80, ], "type": "ClassDeclaration", }, @@ -7778,18 +6573,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "ClassWithParentAndInterface", "range": Array [ - 57, - 60, + 6, + 33, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "ClassWithParentAndInterface", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 3, }, }, ], @@ -7799,74 +6594,39 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 1, "from": Object { - "$ref": 9, + "$ref": 4, }, "identifier": Object { - "name": "computed", + "name": "MyOtherClass", "range": Array [ - 6, - 14, + 65, + 77, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 17, - 23, - ], - "type": "Literal", - }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, + ], + "throughReferences": Array [ Object { - "$id": 4, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "computed2", - "range": Array [ - 31, - 40, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 43, - 49, - ], - "type": "Literal", - }, + "$ref": 1, }, ], - "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 10, + "$ref": 5, }, "variableMap": Object { - "Foo": Object { - "$ref": 2, - }, - "computed": Object { + "ClassWithParentAndInterface": Object { "$ref": 0, }, - "computed2": Object { - "$ref": 1, - }, }, "variableScope": Object { - "$ref": 9, + "$ref": 4, }, "variables": Array [ Object { @@ -7874,123 +6634,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "computed", + "name": "ClassWithParentAndInterface", "range": Array [ 6, - 14, + 33, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 6, - 23, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 24, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "computed", - "range": Array [ - 6, - 14, - ], - "type": "Identifier", - }, - ], - "name": "computed", - "references": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 6, - }, - ], - "scope": Object { - "$ref": 9, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "computed2", - "range": Array [ - 31, - 40, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 31, - 49, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 25, - 50, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "computed2", - "range": Array [ - 31, - 40, - ], - "type": "Identifier", - }, - ], - "name": "computed2", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 9, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 57, - 60, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 51, - 218, + 80, ], "type": "ClassDeclaration", }, @@ -8001,18 +6655,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "ClassWithParentAndInterface", "range": Array [ - 57, - 60, + 6, + 33, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "ClassWithParentAndInterface", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 4, }, }, ], @@ -8021,85 +6675,67 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 1, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-optional-property-undefined.src 1`] = ` +exports[`typescript fixtures/basics/class-with-implements-generic.src 1`] = ` Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ 0, - 41, + 33, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, - 41, + 33, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, - 39, + 32, ], "type": "ClassDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "undefined", - "range": Array [ - 27, - 36, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 4, + "$ref": 3, }, "variableMap": Object { - "X": Object { + "Foo": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [ Object { @@ -8107,17 +6743,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "X", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 39, + 32, ], "type": "ClassDeclaration", }, @@ -8128,18 +6764,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "X", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, ], - "name": "X", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 2, }, }, ], @@ -8148,22 +6784,18 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 4, }, "variableMap": Object { - "X": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [ Object { @@ -8171,17 +6803,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "X", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 39, + 32, ], "type": "ClassDeclaration", }, @@ -8192,18 +6824,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "X", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, ], - "name": "X", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 3, }, }, ], @@ -8212,140 +6844,238 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-private-parameter-properties.src 1`] = ` +exports[`typescript fixtures/basics/class-with-implements-generic-multiple.src 1`] = ` Object { - "$id": 12, + "$id": 4, "block": Object { "range": Array [ 0, - 203, + 36, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 11, + "$id": 3, "block": Object { "range": Array [ 0, - 203, + 36, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 10, + "$id": 2, "block": Object { "range": Array [ 0, - 203, + 35, ], "type": "ClassDeclaration", }, - "childScopes": Array [ - Object { - "$id": 9, - "block": Object { - "range": Array [ - 25, - 201, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ Object { - "$id": 7, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "age", + "name": Object { + "name": "Foo", "range": Array [ - 124, - 135, + 6, + 9, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 5, - }, - "writeExpr": Object { + "node": Object { "range": Array [ - 138, - 140, + 0, + 35, ], - "type": "Literal", + "type": "ClassDeclaration", }, + "parent": undefined, + "type": "ClassName", }, + ], + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$id": 8, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "student", - "range": Array [ - 173, - 189, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 6, - }, - "writeExpr": Object { - "range": Array [ - 192, - 197, - ], - "type": "Literal", - }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", }, ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 35, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/class-with-method.src 1`] = ` +Object { + "$id": 10, + "block": Object { + "range": Array [ + 0, + 58, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 9, + "block": Object { + "range": Array [ + 0, + 58, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 8, + "block": Object { + "range": Array [ + 0, + 57, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 15, + 29, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 10, + "$ref": 8, }, "variableMap": Object { - "age": Object { - "$ref": 5, - }, "arguments": Object { "$ref": 2, }, - "firstName": Object { - "$ref": 3, - }, - "lastName": Object { - "$ref": 4, - }, - "student": Object { - "$ref": 6, - }, }, "variableScope": Object { - "$ref": 9, + "$ref": 3, }, "variables": Array [ Object { @@ -8356,175 +7086,87 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 3, }, }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "firstName", - "range": Array [ - 34, - 51, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 201, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "firstName", - "range": Array [ - 34, - 51, - ], - "type": "Identifier", - }, - ], - "name": "firstName", - "references": Array [], - "scope": Object { - "$ref": 9, - }, + ], + }, + Object { + "$id": 5, + "block": Object { + "range": Array [ + 35, + 44, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 4, }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ Object { "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "lastName", - "range": Array [ - 84, - 100, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 201, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], + "defs": Array [], "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "lastName", - "range": Array [ - 84, - 100, - ], - "type": "Identifier", - }, - ], - "name": "lastName", + "identifiers": Array [], + "name": "arguments", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 5, }, }, - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "age", - "range": Array [ - 124, - 135, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 201, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "age", - "range": Array [ - 124, - 135, - ], - "type": "Identifier", - }, - ], - "name": "age", - "references": Array [ - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 9, - }, + ], + }, + Object { + "$id": 7, + "block": Object { + "range": Array [ + 50, + 55, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 6, }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ Object { "$id": 6, - "defs": Array [ - Object { - "name": Object { - "name": "student", - "range": Array [ - 173, - 189, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 201, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], + "defs": Array [], "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "student", - "range": Array [ - 173, - 189, - ], - "type": "Identifier", - }, - ], - "name": "student", - "references": Array [ - Object { - "$ref": 8, - }, - ], + "identifiers": Array [], + "name": "arguments", + "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 7, }, }, ], @@ -8536,15 +7178,15 @@ Object { "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 11, + "$ref": 9, }, "variableMap": Object { - "Foo": Object { + "C": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 11, + "$ref": 9, }, "variables": Array [ Object { @@ -8552,17 +7194,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "C", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 203, + 57, ], "type": "ClassDeclaration", }, @@ -8573,18 +7215,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "C", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "C", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 8, }, }, ], @@ -8596,15 +7238,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 12, + "$ref": 10, }, "variableMap": Object { - "Foo": Object { + "C": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 11, + "$ref": 9, }, "variables": Array [ Object { @@ -8612,17 +7254,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "C", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 203, + 57, ], "type": "ClassDeclaration", }, @@ -8633,18 +7275,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "C", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "C", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 9, }, }, ], @@ -8658,151 +7300,277 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 10, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-property-function.src 1`] = ` +exports[`typescript fixtures/basics/class-with-mixin.src 1`] = ` Object { - "$id": 7, + "$id": 15, "block": Object { "range": Array [ 0, - 86, + 207, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 14, "block": Object { "range": Array [ 0, - 86, + 207, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 9, "block": Object { "range": Array [ 0, - 85, + 84, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 8, "block": Object { "range": Array [ - 35, - 54, + 60, + 82, ], - "type": "ArrowFunctionExpression", + "type": "ClassExpression", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "class", "upperScope": Object { - "$ref": 5, + "$ref": 9, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 9, }, "variables": Array [], }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 4, - "block": Object { + "$id": 7, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "Base", "range": Array [ - 72, - 82, + 74, + 78, ], - "type": "ArrowFunctionExpression", + "type": "Identifier", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "kind": "r", + "resolved": Object { + "$ref": 6, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 14, + }, + "variableMap": Object { + "Base": Object { + "$ref": 6, + }, + "arguments": Object { + "$ref": 5, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ + Object { + "$id": 5, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 6, + "defs": Array [ Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "test", + "name": Object { + "name": "Base", "range": Array [ - 78, - 82, + 38, + 45, ], "type": "Identifier", }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "node": Object { + "range": Array [ + 0, + 84, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", }, ], - "throughReferences": Array [ + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$ref": 3, + "name": "Base", + "range": Array [ + 38, + 45, + ], + "type": "Identifier", }, ], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, + "name": "Base", + "references": Array [ + Object { + "$ref": 7, + }, + ], + "scope": Object { + "$ref": 9, }, - "variables": Array [], }, ], + }, + Object { + "$id": 11, + "block": Object { + "range": Array [ + 86, + 128, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 14, + }, + "variableMap": Object { + "X": Object { + "$ref": 10, + }, + }, + "variableScope": Object { + "$ref": 14, + }, + "variables": Array [ Object { - "$ref": 3, + "$id": 10, + "defs": Array [ + Object { + "name": Object { + "name": "X", + "range": Array [ + 92, + 93, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 86, + 128, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "X", + "range": Array [ + 92, + 93, + ], + "type": "Identifier", + }, + ], + "name": "X", + "references": Array [], + "scope": Object { + "$ref": 11, + }, }, ], + }, + Object { + "$id": 13, + "block": Object { + "range": Array [ + 130, + 141, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 6, + "$ref": 14, }, "variableMap": Object { - "Foo": Object { - "$ref": 1, + "C": Object { + "$ref": 12, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 14, }, "variables": Array [ Object { - "$id": 1, + "$id": 12, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "C", "range": Array [ - 6, - 9, + 136, + 137, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 85, + 130, + 141, ], "type": "ClassDeclaration", }, @@ -8813,18 +7581,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "C", "range": Array [ - 6, - 9, + 136, + 137, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "C", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 13, }, }, ], @@ -8832,23 +7600,64 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [ + "references": Array [ Object { - "$ref": 3, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, + "$id": 3, + "from": Object { + "$ref": 14, + }, + "identifier": Object { + "name": "M", + "range": Array [ + 102, + 103, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 14, + }, + "identifier": Object { + "name": "C", + "range": Array [ + 109, + 110, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 15, + }, + "variableMap": Object { + "C": Object { + "$ref": 2, + }, + "M": Object { + "$ref": 0, + }, + "X": Object { + "$ref": 1, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 14, }, "variables": Array [ Object { @@ -8856,17 +7665,61 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "M", "range": Array [ - 6, 9, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 85, + 84, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "M", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + ], + "name": "M", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 14, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "X", + "range": Array [ + 92, + 93, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 86, + 128, ], "type": "ClassDeclaration", }, @@ -8877,18 +7730,62 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "X", "range": Array [ - 6, - 9, + 92, + 93, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "X", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 14, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "C", + "range": Array [ + 136, + 137, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 130, + 141, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "C", + "range": Array [ + 136, + 137, + ], + "type": "Identifier", + }, + ], + "name": "C", + "references": Array [ + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 14, }, }, ], @@ -8897,28 +7794,24 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 15, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-property-values.src 1`] = ` +exports[`typescript fixtures/basics/class-with-mixin-reference.src 1`] = ` Object { "$id": 5, "block": Object { "range": Array [ 0, - 83, + 50, ], "type": "Program", }, @@ -8928,7 +7821,7 @@ Object { "block": Object { "range": Array [ 0, - 83, + 50, ], "type": "Program", }, @@ -8938,85 +7831,77 @@ Object { "block": Object { "range": Array [ 0, - 82, + 49, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "Array", - "range": Array [ - 61, - 66, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "class", + "references": Array [], + "throughReferences": Array [], + "type": "function", "upperScope": Object { "$ref": 4, }, "variableMap": Object { - "Foo": Object { + "Base": Object { + "$ref": 2, + }, + "arguments": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [ Object { "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + Object { + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "Base", "range": Array [ - 6, - 9, + 37, + 44, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 82, + 49, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, - "parent": undefined, - "type": "ClassName", + "parent": null, + "type": "Parameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "Base", "range": Array [ - 6, - 9, + 37, + 44, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "Base", "references": Array [], "scope": Object { "$ref": 3, @@ -9028,17 +7913,13 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { "$ref": 5, }, "variableMap": Object { - "Foo": Object { + "M": Object { "$ref": 0, }, }, @@ -9051,36 +7932,36 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "M", "range": Array [ - 6, 9, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 82, + 49, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, "parent": null, - "type": "ClassName", + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "M", "range": Array [ - 6, 9, + 10, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "M", "references": Array [], "scope": Object { "$ref": 4, @@ -9092,11 +7973,7 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, @@ -9107,316 +7984,239 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-protected-parameter-properties.src 1`] = ` +exports[`typescript fixtures/basics/class-with-optional-computed-property.src 1`] = ` Object { - "$id": 12, + "$id": 5, "block": Object { "range": Array [ 0, - 211, + 46, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 11, + "$id": 4, "block": Object { "range": Array [ 0, - 211, + 46, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 10, + "$id": 3, "block": Object { "range": Array [ 0, - 211, + 45, ], "type": "ClassDeclaration", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 9, - "block": Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "undefined", "range": Array [ - 25, - 209, + 33, + 42, ], - "type": "FunctionExpression", + "type": "Identifier", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], + "type": "class", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "X": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ Object { - "$id": 7, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "age", + "name": Object { + "name": "X", "range": Array [ - 130, - 141, + 6, + 7, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 5, - }, - "writeExpr": Object { + "node": Object { "range": Array [ - 144, - 146, + 0, + 45, ], - "type": "Literal", + "type": "ClassDeclaration", }, + "parent": undefined, + "type": "ClassName", }, + ], + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$id": 8, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "student", - "range": Array [ - 181, - 197, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 6, - }, - "writeExpr": Object { - "range": Array [ - 200, - 205, - ], - "type": "Literal", - }, + "name": "X", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", }, ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 10, + "name": "X", + "references": Array [], + "scope": Object { + "$ref": 3, }, - "variableMap": Object { - "age": Object { - "$ref": 5, - }, - "arguments": Object { - "$ref": 2, - }, - "firstName": Object { - "$ref": 3, - }, - "lastName": Object { - "$ref": 4, - }, - "student": Object { - "$ref": 6, - }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "X": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "X", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", }, - "variableScope": Object { - "$ref": 9, + "node": Object { + "range": Array [ + 0, + 45, + ], + "type": "ClassDeclaration", }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "firstName", - "range": Array [ - 36, - 53, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 209, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "firstName", - "range": Array [ - 36, - 53, - ], - "type": "Identifier", - }, - ], - "name": "firstName", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "lastName", - "range": Array [ - 88, - 104, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 209, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "lastName", - "range": Array [ - 88, - 104, - ], - "type": "Identifier", - }, - ], - "name": "lastName", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, - Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "age", - "range": Array [ - 130, - 141, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 209, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "age", - "range": Array [ - 130, - 141, - ], - "type": "Identifier", - }, - ], - "name": "age", - "references": Array [ - Object { - "$ref": 7, - }, - ], - "scope": Object { - "$ref": 9, - }, - }, - Object { - "$id": 6, - "defs": Array [ - Object { - "name": Object { - "name": "student", - "range": Array [ - 181, - 197, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 209, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "student", - "range": Array [ - 181, - 197, - ], - "type": "Identifier", - }, - ], - "name": "student", - "references": Array [ - Object { - "$ref": 8, - }, - ], - "scope": Object { - "$ref": 9, - }, - }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "X", + "range": Array [ + 6, + 7, ], + "type": "Identifier", }, ], + "name": "X", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/class-with-optional-methods.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 68, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 68, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 67, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "class", "upperScope": Object { - "$ref": 11, + "$ref": 3, }, "variableMap": Object { "Foo": Object { @@ -9424,7 +8224,7 @@ Object { }, }, "variableScope": Object { - "$ref": 11, + "$ref": 3, }, "variables": Array [ Object { @@ -9442,7 +8242,7 @@ Object { "node": Object { "range": Array [ 0, - 211, + 67, ], "type": "ClassDeclaration", }, @@ -9464,7 +8264,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 2, }, }, ], @@ -9476,7 +8276,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 12, + "$ref": 4, }, "variableMap": Object { "Foo": Object { @@ -9484,7 +8284,7 @@ Object { }, }, "variableScope": Object { - "$ref": 11, + "$ref": 3, }, "variables": Array [ Object { @@ -9502,7 +8302,7 @@ Object { "node": Object { "range": Array [ 0, - 211, + 67, ], "type": "ClassDeclaration", }, @@ -9524,7 +8324,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 3, }, }, ], @@ -9538,370 +8338,144 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 4, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-public-parameter-properties.src 1`] = ` +exports[`typescript fixtures/basics/class-with-optional-properties.src 1`] = ` Object { - "$id": 12, + "$id": 10, "block": Object { "range": Array [ 0, - 199, + 219, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 11, + "$id": 9, "block": Object { "range": Array [ 0, - 199, + 219, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 10, + "$id": 8, "block": Object { "range": Array [ - 0, - 199, + 51, + 218, ], "type": "ClassDeclaration", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 9, - "block": Object { + "$id": 6, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "computed", "range": Array [ - 25, - 197, + 116, + 124, ], - "type": "FunctionExpression", + "type": "Identifier", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 7, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "age", - "range": Array [ - 121, - 132, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 5, - }, - "writeExpr": Object { - "range": Array [ - 135, - 137, - ], - "type": "Literal", - }, - }, + "kind": "r", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "computed2", + "range": Array [ + 155, + 164, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + ], + "type": "class", + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 5, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ + Object { + "$id": 5, + "defs": Array [ Object { - "$id": 8, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "student", + "name": Object { + "name": "Foo", "range": Array [ - 169, - 185, + 57, + 60, ], "type": "Identifier", }, - "kind": "w", - "resolved": Object { - "$ref": 6, - }, - "writeExpr": Object { + "node": Object { "range": Array [ - 188, - 193, + 51, + 218, ], - "type": "Literal", + "type": "ClassDeclaration", }, + "parent": undefined, + "type": "ClassName", }, ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 10, - }, - "variableMap": Object { - "age": Object { - "$ref": 5, - }, - "arguments": Object { - "$ref": 2, - }, - "firstName": Object { - "$ref": 3, - }, - "lastName": Object { - "$ref": 4, - }, - "student": Object { - "$ref": 6, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "firstName", - "range": Array [ - 33, - 50, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 197, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "firstName", - "range": Array [ - 33, - 50, - ], - "type": "Identifier", - }, - ], - "name": "firstName", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "lastName", - "range": Array [ - 82, - 98, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 197, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "lastName", - "range": Array [ - 82, - 98, - ], - "type": "Identifier", - }, - ], - "name": "lastName", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$id": 5, - "defs": Array [ - Object { - "name": Object { - "name": "age", - "range": Array [ - 121, - 132, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 197, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "age", - "range": Array [ - 121, - 132, - ], - "type": "Identifier", - }, - ], - "name": "age", - "references": Array [ - Object { - "$ref": 7, - }, + "name": "Foo", + "range": Array [ + 57, + 60, ], - "scope": Object { - "$ref": 9, - }, - }, - Object { - "$id": 6, - "defs": Array [ - Object { - "name": Object { - "name": "student", - "range": Array [ - 169, - 185, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 197, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "student", - "range": Array [ - 169, - 185, - ], - "type": "Identifier", - }, - ], - "name": "student", - "references": Array [ - Object { - "$ref": 8, - }, - ], - "scope": Object { - "$ref": 9, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 11, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 199, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", + "type": "Identifier", }, ], "name": "Foo", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 8, }, }, ], @@ -9909,19 +8483,76 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "computed", + "range": Array [ + 6, + 14, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 17, + 23, + ], + "type": "Literal", + }, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "computed2", + "range": Array [ + 31, + 40, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": Object { + "range": Array [ + 43, + 49, + ], + "type": "Literal", + }, + }, + ], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 12, + "$ref": 10, }, "variableMap": Object { "Foo": Object { + "$ref": 2, + }, + "computed": Object { "$ref": 0, }, + "computed2": Object { + "$ref": 1, + }, }, "variableScope": Object { - "$ref": 11, + "$ref": 9, }, "variables": Array [ Object { @@ -9929,339 +8560,123 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "computed", "range": Array [ 6, - 9, + 14, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 6, + 23, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 199, + 24, ], - "type": "ClassDeclaration", + "type": "VariableDeclaration", }, - "parent": null, - "type": "ClassName", + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "computed", "range": Array [ 6, - 9, + 14, ], "type": "Identifier", }, ], - "name": "Foo", - "references": Array [], + "name": "computed", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 6, + }, + ], "scope": Object { - "$ref": 11, + "$ref": 9, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 12, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/class-with-readonly-parameter-properties.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 109, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 109, - ], - "type": "Program", - }, - "childScopes": Array [ Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 109, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [ + "$id": 1, + "defs": Array [ Object { - "$id": 6, - "block": Object { + "name": Object { + "name": "computed2", "range": Array [ - 25, - 107, + 31, + 40, ], - "type": "FunctionExpression", + "type": "Identifier", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "lastName", - "range": Array [ - 77, - 93, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 4, - }, - "writeExpr": Object { - "range": Array [ - 96, - 103, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 7, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, - "firstName": Object { - "$ref": 3, - }, - "lastName": Object { - "$ref": 4, - }, + "node": Object { + "range": Array [ + 31, + 49, + ], + "type": "VariableDeclarator", }, - "variableScope": Object { - "$ref": 6, + "parent": Object { + "range": Array [ + 25, + 50, + ], + "type": "VariableDeclaration", }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "firstName", - "range": Array [ - 35, - 52, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 107, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "firstName", - "range": Array [ - 35, - 52, - ], - "type": "Identifier", - }, - ], - "name": "firstName", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, - Object { - "$id": 4, - "defs": Array [ - Object { - "name": Object { - "name": "lastName", - "range": Array [ - 77, - 93, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 25, - 107, - ], - "type": "FunctionExpression", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "lastName", - "range": Array [ - 77, - 93, - ], - "type": "Identifier", - }, - ], - "name": "lastName", - "references": Array [ - Object { - "$ref": 5, - }, - ], - "scope": Object { - "$ref": 6, - }, - }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "computed2", + "range": Array [ + 31, + 40, ], + "type": "Identifier", }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 8, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, + "name": "computed2", + "references": Array [ + Object { + "$ref": 4, }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 109, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 7, - }, + "$ref": 7, }, ], + "scope": Object { + "$ref": 9, + }, }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ Object { - "$id": 0, + "$id": 2, "defs": Array [ Object { "name": Object { "name": "Foo", "range": Array [ - 6, - 9, + 57, + 60, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 109, + 51, + 218, ], "type": "ClassDeclaration", }, @@ -10274,8 +8689,8 @@ Object { Object { "name": "Foo", "range": Array [ - 6, - 9, + 57, + 60, ], "type": "Identifier", }, @@ -10283,7 +8698,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 9, }, }, ], @@ -10297,58 +8712,80 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-readonly-property.src 1`] = ` +exports[`typescript fixtures/basics/class-with-optional-property-undefined.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, - 50, + 41, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, - 50, + 41, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, - 49, + 39, ], "type": "ClassDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "undefined", + "range": Array [ + 27, + 36, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "class", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { - "Foo": Object { + "X": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -10356,17 +8793,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "X", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 49, + 39, ], "type": "ClassDeclaration", }, @@ -10377,18 +8814,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "X", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "X", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -10397,18 +8834,22 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { - "Foo": Object { + "X": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -10416,17 +8857,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "X", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 49, + 39, ], "type": "ClassDeclaration", }, @@ -10437,18 +8878,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "X", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "X", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -10457,76 +8898,140 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-static-parameter-properties.src 1`] = ` +exports[`typescript fixtures/basics/class-with-private-parameter-properties.src 1`] = ` Object { - "$id": 7, + "$id": 12, "block": Object { "range": Array [ 0, - 59, + 203, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 11, "block": Object { "range": Array [ 0, - 59, + 203, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 10, "block": Object { "range": Array [ 0, - 56, + 203, ], "type": "ClassDeclaration", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 9, "block": Object { "range": Array [ - 27, - 54, + 25, + 201, ], "type": "FunctionExpression", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 7, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "age", + "range": Array [ + 124, + 135, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 5, + }, + "writeExpr": Object { + "range": Array [ + 138, + 140, + ], + "type": "Literal", + }, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "student", + "range": Array [ + 173, + 189, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 6, + }, + "writeExpr": Object { + "range": Array [ + 192, + 197, + ], + "type": "Literal", + }, + }, + ], "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 5, + "$ref": 10, }, "variableMap": Object { - "a": Object { - "$ref": 3, + "age": Object { + "$ref": 5, }, "arguments": Object { "$ref": 2, }, + "firstName": Object { + "$ref": 3, + }, + "lastName": Object { + "$ref": 4, + }, + "student": Object { + "$ref": 6, + }, }, "variableScope": Object { - "$ref": 4, + "$ref": 9, }, "variables": Array [ Object { @@ -10537,7 +9042,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 9, }, }, Object { @@ -10545,17 +9050,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "a", + "name": "firstName", "range": Array [ - 35, - 44, + 34, + 51, ], "type": "Identifier", }, "node": Object { "range": Array [ - 27, - 54, + 25, + 201, ], "type": "FunctionExpression", }, @@ -10566,68 +9071,196 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "firstName", "range": Array [ - 35, - 44, + 34, + 51, ], "type": "Identifier", }, ], - "name": "a", + "name": "firstName", "references": Array [], "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 56, - ], - "type": "ClassDeclaration", + "$ref": 9, }, - "parent": undefined, - "type": "ClassName", }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "Foo", - "range": Array [ + "$id": 4, + "defs": Array [ + Object { + "name": Object { + "name": "lastName", + "range": Array [ + 84, + 100, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 25, + 201, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "lastName", + "range": Array [ + 84, + 100, + ], + "type": "Identifier", + }, + ], + "name": "lastName", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 5, + "defs": Array [ + Object { + "name": Object { + "name": "age", + "range": Array [ + 124, + 135, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 25, + 201, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "age", + "range": Array [ + 124, + 135, + ], + "type": "Identifier", + }, + ], + "name": "age", + "references": Array [ + Object { + "$ref": 7, + }, + ], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 6, + "defs": Array [ + Object { + "name": Object { + "name": "student", + "range": Array [ + 173, + 189, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 25, + 201, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "student", + "range": Array [ + 173, + 189, + ], + "type": "Identifier", + }, + ], + "name": "student", + "references": Array [ + Object { + "$ref": 8, + }, + ], + "scope": Object { + "$ref": 9, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 11, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 11, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 203, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ 6, 9, ], @@ -10637,7 +9270,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 10, }, }, ], @@ -10649,7 +9282,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 12, }, "variableMap": Object { "Foo": Object { @@ -10657,7 +9290,7 @@ Object { }, }, "variableScope": Object { - "$ref": 6, + "$ref": 11, }, "variables": Array [ Object { @@ -10675,7 +9308,7 @@ Object { "node": Object { "range": Array [ 0, - 56, + 203, ], "type": "ClassDeclaration", }, @@ -10697,7 +9330,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 11, }, }, ], @@ -10711,15 +9344,15 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 12, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-two-methods-computed-constructor.src 1`] = ` +exports[`typescript fixtures/basics/class-with-property-function.src 1`] = ` Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, @@ -10729,7 +9362,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, @@ -10739,23 +9372,23 @@ Object { }, "childScopes": Array [ Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ 0, - 84, + 85, ], "type": "ClassDeclaration", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ - 25, - 44, + 35, + 54, ], - "type": "FunctionExpression", + "type": "ArrowFunctionExpression", }, "childScopes": Array [], "functionExpressionScope": false, @@ -10764,86 +9397,80 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, + "$ref": 5, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], + "variables": Array [], }, Object { - "$id": 5, + "$id": 4, "block": Object { "range": Array [ - 63, + 72, 82, ], - "type": "FunctionExpression", + "type": "ArrowFunctionExpression", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 4, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ + "references": Array [ Object { - "$id": 4, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 5, + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "test", + "range": Array [ + 78, + 82, + ], + "type": "Identifier", }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, }, ], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "class", "upperScope": Object { - "$ref": 7, + "$ref": 6, }, "variableMap": Object { - "A": Object { + "Foo": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [ Object { @@ -10851,17 +9478,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "A", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 84, + 85, ], "type": "ClassDeclaration", }, @@ -10872,18 +9499,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "A", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, ], - "name": "A", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 5, }, }, ], @@ -10892,18 +9519,22 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 7, }, "variableMap": Object { - "A": Object { + "Foo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [ Object { @@ -10911,17 +9542,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "A", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 84, + 85, ], "type": "ClassDeclaration", }, @@ -10932,18 +9563,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "A", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, ], - "name": "A", + "name": "Foo", "references": Array [], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, ], @@ -10952,55 +9583,81 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-type-parameter.src 1`] = ` +exports[`typescript fixtures/basics/class-with-property-values.src 1`] = ` Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ 0, - 18, + 83, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 4, "block": Object { "range": Array [ 0, - 18, + 83, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 3, "block": Object { "range": Array [ 0, - 17, + 82, ], "type": "ClassDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "Array", + "range": Array [ + 61, + 66, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "class", "upperScope": Object { - "$ref": 3, + "$ref": 4, }, "variableMap": Object { "Foo": Object { @@ -11008,7 +9665,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -11026,7 +9683,7 @@ Object { "node": Object { "range": Array [ 0, - 17, + 82, ], "type": "ClassDeclaration", }, @@ -11048,7 +9705,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 3, }, }, ], @@ -11057,10 +9714,14 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 5, }, "variableMap": Object { "Foo": Object { @@ -11068,7 +9729,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { @@ -11086,7 +9747,7 @@ Object { "node": Object { "range": Array [ 0, - 17, + 82, ], "type": "ClassDeclaration", }, @@ -11108,7 +9769,7 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 4, }, }, ], @@ -11117,540 +9778,4384 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/class-with-type-parameter-default.src 1`] = ` +exports[`typescript fixtures/basics/class-with-protected-parameter-properties.src 1`] = ` Object { - "$id": 4, + "$id": 12, "block": Object { "range": Array [ 0, - 24, + 211, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 11, "block": Object { "range": Array [ 0, - 24, + 211, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 10, "block": Object { "range": Array [ 0, - 23, + 211, ], "type": "ClassDeclaration", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ + "childScopes": Array [ Object { - "$id": 1, - "defs": Array [ + "$id": 9, + "block": Object { + "range": Array [ + 25, + 209, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { - "name": "Foo", + "$id": 7, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "age", "range": Array [ - 6, - 9, + 130, + 141, ], "type": "Identifier", }, - "node": Object { + "kind": "w", + "resolved": Object { + "$ref": 5, + }, + "writeExpr": Object { "range": Array [ - 0, - 23, + 144, + 146, ], - "type": "ClassDeclaration", + "type": "Literal", }, - "parent": undefined, - "type": "ClassName", }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "Foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 23, - ], - "type": "ClassDeclaration", - }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - ], - "name": "Foo", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/class-with-type-parameter-underscore.src 1`] = ` -Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 16, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 15, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "A": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "A", + "$id": 8, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "student", "range": Array [ - 6, - 7, + 181, + 197, ], "type": "Identifier", }, - "node": Object { + "kind": "w", + "resolved": Object { + "$ref": 6, + }, + "writeExpr": Object { "range": Array [ - 0, - 15, + 200, + 205, ], - "type": "ClassDeclaration", + "type": "Literal", }, - "parent": undefined, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", }, ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 2, + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 10, }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "A": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", + "variableMap": Object { + "age": Object { + "$ref": 5, + }, + "arguments": Object { + "$ref": 2, + }, + "firstName": Object { + "$ref": 3, + }, + "lastName": Object { + "$ref": 4, + }, + "student": Object { + "$ref": 6, + }, }, - "node": Object { - "range": Array [ - 0, - 15, - ], - "type": "ClassDeclaration", + "variableScope": Object { + "$ref": 9, }, - "parent": null, - "type": "ClassName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "name": "A", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "firstName", + "range": Array [ + 36, + 53, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 25, + 209, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "firstName", + "range": Array [ + 36, + 53, + ], + "type": "Identifier", + }, + ], + "name": "firstName", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 4, + "defs": Array [ + Object { + "name": Object { + "name": "lastName", + "range": Array [ + 88, + 104, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 25, + 209, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "lastName", + "range": Array [ + 88, + 104, + ], + "type": "Identifier", + }, + ], + "name": "lastName", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 5, + "defs": Array [ + Object { + "name": Object { + "name": "age", + "range": Array [ + 130, + 141, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 25, + 209, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "age", + "range": Array [ + 130, + 141, + ], + "type": "Identifier", + }, + ], + "name": "age", + "references": Array [ + Object { + "$ref": 7, + }, + ], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 6, + "defs": Array [ + Object { + "name": Object { + "name": "student", + "range": Array [ + 181, + 197, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 25, + 209, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "student", + "range": Array [ + 181, + 197, + ], + "type": "Identifier", + }, + ], + "name": "student", + "references": Array [ + Object { + "$ref": 8, + }, + ], + "scope": Object { + "$ref": 9, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 11, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 11, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 211, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 10, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 12, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 11, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 211, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 11, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/class-with-public-parameter-properties.src 1`] = ` +Object { + "$id": 12, + "block": Object { + "range": Array [ + 0, + 199, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 11, + "block": Object { + "range": Array [ + 0, + 199, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 10, + "block": Object { + "range": Array [ + 0, + 199, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 9, + "block": Object { + "range": Array [ + 25, + 197, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 7, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "age", + "range": Array [ + 121, + 132, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 5, + }, + "writeExpr": Object { + "range": Array [ + 135, + 137, + ], + "type": "Literal", + }, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "student", + "range": Array [ + 169, + 185, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 6, + }, + "writeExpr": Object { + "range": Array [ + 188, + 193, + ], + "type": "Literal", + }, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 10, + }, + "variableMap": Object { + "age": Object { + "$ref": 5, + }, + "arguments": Object { + "$ref": 2, + }, + "firstName": Object { + "$ref": 3, + }, + "lastName": Object { + "$ref": 4, + }, + "student": Object { + "$ref": 6, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "firstName", + "range": Array [ + 33, + 50, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 25, + 197, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "firstName", + "range": Array [ + 33, + 50, + ], + "type": "Identifier", + }, + ], + "name": "firstName", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 4, + "defs": Array [ + Object { + "name": Object { + "name": "lastName", + "range": Array [ + 82, + 98, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 25, + 197, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "lastName", + "range": Array [ + 82, + 98, + ], + "type": "Identifier", + }, + ], + "name": "lastName", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 5, + "defs": Array [ + Object { + "name": Object { + "name": "age", + "range": Array [ + 121, + 132, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 25, + 197, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "age", + "range": Array [ + 121, + 132, + ], + "type": "Identifier", + }, + ], + "name": "age", + "references": Array [ + Object { + "$ref": 7, + }, + ], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 6, + "defs": Array [ + Object { + "name": Object { + "name": "student", + "range": Array [ + 169, + 185, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 25, + 197, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "student", + "range": Array [ + 169, + 185, + ], + "type": "Identifier", + }, + ], + "name": "student", + "references": Array [ + Object { + "$ref": 8, + }, + ], + "scope": Object { + "$ref": 9, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 11, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 11, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 199, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 10, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 12, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 11, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 199, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 11, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/class-with-readonly-parameter-properties.src 1`] = ` +Object { + "$id": 9, + "block": Object { + "range": Array [ + 0, + 109, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 8, + "block": Object { + "range": Array [ + 0, + 109, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 109, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 25, + 107, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "lastName", + "range": Array [ + 77, + 93, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 4, + }, + "writeExpr": Object { + "range": Array [ + 96, + 103, + ], + "type": "Literal", + }, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + "firstName": Object { + "$ref": 3, + }, + "lastName": Object { + "$ref": 4, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "firstName", + "range": Array [ + 35, + 52, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 25, + 107, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "firstName", + "range": Array [ + 35, + 52, + ], + "type": "Identifier", + }, + ], + "name": "firstName", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 4, + "defs": Array [ + Object { + "name": Object { + "name": "lastName", + "range": Array [ + 77, + 93, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 25, + 107, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "lastName", + "range": Array [ + 77, + 93, + ], + "type": "Identifier", + }, + ], + "name": "lastName", + "references": Array [ + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 109, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 109, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 8, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/class-with-readonly-property.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 50, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 50, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 49, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 49, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 49, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/class-with-static-parameter-properties.src 1`] = ` +Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 59, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 59, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 56, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 27, + 54, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "a": Object { + "$ref": 3, + }, + "arguments": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "a", + "range": Array [ + 35, + 44, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 27, + 54, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "a", + "range": Array [ + 35, + 44, + ], + "type": "Identifier", + }, + ], + "name": "a", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 56, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 56, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/class-with-two-methods-computed-constructor.src 1`] = ` +Object { + "$id": 8, + "block": Object { + "range": Array [ + 0, + 86, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 86, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 84, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 25, + 44, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + Object { + "$id": 5, + "block": Object { + "range": Array [ + 63, + 82, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 4, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 4, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "A": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 84, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object { + "A": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 84, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/class-with-type-parameter.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 18, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 18, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 17, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 17, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 17, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/class-with-type-parameter-default.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 24, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 24, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 23, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 23, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 23, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/class-with-type-parameter-underscore.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 16, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 16, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 15, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "A": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 15, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "A": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 15, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + ], + "name": "A", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/const-assertions.src 1`] = ` +Object { + "$id": 10, + "block": Object { + "range": Array [ + 13, + 323, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 9, + "block": Object { + "range": Array [ + 13, + 323, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 21, + 32, + ], + "type": "TSAsExpression", + }, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "y", + "range": Array [ + 67, + 68, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": Object { + "range": Array [ + 71, + 88, + ], + "type": "TSAsExpression", + }, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "z", + "range": Array [ + 132, + 133, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": Object { + "range": Array [ + 136, + 162, + ], + "type": "TSAsExpression", + }, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 182, + 183, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 186, + 195, + ], + "type": "TSTypeAssertion", + }, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "y", + "range": Array [ + 230, + 231, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": Object { + "range": Array [ + 234, + 249, + ], + "type": "TSTypeAssertion", + }, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "z", + "range": Array [ + 293, + 294, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": Object { + "range": Array [ + 297, + 321, + ], + "type": "TSTypeAssertion", + }, + }, + ], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 10, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + "y": Object { + "$ref": 1, + }, + "z": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 17, + 32, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 13, + 33, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + Object { + "name": Object { + "name": "x", + "range": Array [ + 182, + 183, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 182, + 195, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 178, + 196, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + Object { + "name": "x", + "range": Array [ + 182, + 183, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 6, + }, + ], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "y", + "range": Array [ + 67, + 68, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 67, + 88, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 63, + 89, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + Object { + "name": Object { + "name": "y", + "range": Array [ + 230, + 231, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 230, + 249, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 226, + 250, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "y", + "range": Array [ + 67, + 68, + ], + "type": "Identifier", + }, + Object { + "name": "y", + "range": Array [ + 230, + 231, + ], + "type": "Identifier", + }, + ], + "name": "y", + "references": Array [ + Object { + "$ref": 4, + }, + Object { + "$ref": 7, + }, + ], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "z", + "range": Array [ + 132, + 133, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 132, + 162, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 128, + 163, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + Object { + "name": Object { + "name": "z", + "range": Array [ + 293, + 294, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 293, + 321, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 289, + 322, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "z", + "range": Array [ + 132, + 133, + ], + "type": "Identifier", + }, + Object { + "name": "z", + "range": Array [ + 293, + 294, + ], + "type": "Identifier", + }, + ], + "name": "z", + "references": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 8, + }, + ], + "scope": Object { + "$ref": 9, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 10, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/const-enum.src 1`] = ` +Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 39, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 39, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 39, + ], + "type": "TSEnumDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": Object { + "range": Array [ + 27, + 28, + ], + "type": "Literal", + }, + }, + ], + "throughReferences": Array [], + "type": "enum", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "bar": Object { + "$ref": 2, + }, + "foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 21, + 28, + ], + "type": "TSEnumMember", + }, + "parent": undefined, + "type": "EnumMemberName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "bar", + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 34, + 37, + ], + "type": "TSEnumMember", + }, + "parent": undefined, + "type": "EnumMemberName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "bar", + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + }, + ], + "name": "bar", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 39, + ], + "type": "TSEnumDeclaration", + }, + "parent": undefined, + "type": "EnumName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/declare-class-with-optional-method.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 38, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 38, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 38, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 38, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 38, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/declare-function.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 42, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 42, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 42, + ], + "type": "TSDeclareFunction", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "empty-function", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "bar": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "bar", + "range": Array [ + 21, + 32, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 42, + ], + "type": "TSDeclareFunction", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "bar", + "range": Array [ + 21, + 32, + ], + "type": "Identifier", + }, + ], + "name": "bar", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 42, + ], + "type": "TSDeclareFunction", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/destructuring-assignment.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 21, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 21, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 0, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 3, + 6, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": null, + "writeExpr": Object { + "range": Array [ + 9, + 11, + ], + "type": "ArrayExpression", + }, + }, + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 3, + 6, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": null, + "writeExpr": Object { + "name": "bar", + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + }, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/destructuring-assignment-nested.src 1`] = ` +Object { + "$id": 11, + "block": Object { + "range": Array [ + 0, + 130, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 10, + "block": Object { + "range": Array [ + 0, + 130, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 0, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": null, + "writeExpr": Object { + "range": Array [ + 76, + 79, + ], + "type": "ObjectExpression", + }, + }, + Object { + "$id": 1, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": null, + "writeExpr": Object { + "range": Array [ + 69, + 71, + ], + "type": "ObjectExpression", + }, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": null, + "writeExpr": Object { + "range": Array [ + 62, + 64, + ], + "type": "ArrayExpression", + }, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": null, + "writeExpr": Object { + "range": Array [ + 84, + 127, + ], + "type": "ObjectExpression", + }, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": null, + "writeExpr": Object { + "range": Array [ + 76, + 79, + ], + "type": "ObjectExpression", + }, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": null, + "writeExpr": Object { + "range": Array [ + 69, + 71, + ], + "type": "ObjectExpression", + }, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": null, + "writeExpr": Object { + "range": Array [ + 62, + 64, + ], + "type": "ArrayExpression", + }, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": null, + "writeExpr": Object { + "range": Array [ + 47, + 58, + ], + "type": "ObjectExpression", + }, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": null, + "writeExpr": Object { + "range": Array [ + 39, + 42, + ], + "type": "ArrayExpression", + }, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "x", + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": null, + "writeExpr": Object { + "range": Array [ + 84, + 127, + ], + "type": "ObjectExpression", + }, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 11, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 10, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 11, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/destructuring-assignment-object.src 1`] = ` +Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 22, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 22, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 0, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 3, + 6, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": null, + "writeExpr": Object { + "range": Array [ + 9, + 11, + ], + "type": "ObjectExpression", + }, + }, + Object { + "$id": 1, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 3, + 6, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": null, + "writeExpr": Object { + "name": "bar", + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + }, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/destructuring-assignment-property.src 1`] = ` +Object { + "$id": 8, + "block": Object { + "range": Array [ + 0, + 38, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 38, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 37, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": Object { + "name": "bar", + "range": Array [ + 28, + 31, + ], + "type": "Identifier", + }, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": Object { + "range": Array [ + 21, + 23, + ], + "type": "ArrayExpression", + }, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "bar", + "range": Array [ + 28, + 31, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 5, + }, + ], + "type": "function", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "foo": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 37, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 5, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 37, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 5, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 8, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/const-assertions.src 1`] = ` +exports[`typescript fixtures/basics/directive-in-module.src 1`] = ` Object { - "$id": 10, + "$id": 5, "block": Object { "range": Array [ - 13, - 323, + 0, + 60, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 9, + "$id": 4, "block": Object { "range": Array [ - 13, - 323, + 0, + 60, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { "$id": 3, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 21, - 32, - ], - "type": "TSAsExpression", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 67, - 68, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 71, - 88, - ], - "type": "TSAsExpression", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "z", - "range": Array [ - 132, - 133, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 136, - 162, - ], - "type": "TSAsExpression", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 182, - 183, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 186, - 195, - ], - "type": "TSTypeAssertion", - }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "y", - "range": Array [ - 230, - 231, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 234, - 249, - ], - "type": "TSTypeAssertion", - }, - }, - Object { - "$id": 8, - "from": Object { - "$ref": 9, - }, - "identifier": Object { - "name": "z", + "block": Object { "range": Array [ - 293, - 294, + 11, + 59, ], - "type": "Identifier", + "type": "TSModuleBlock", }, - "kind": "w", - "resolved": Object { - "$ref": 2, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": Object { + "range": Array [ + 39, + 40, + ], + "type": "Literal", + }, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], + "type": "block", + "upperScope": Object { + "$ref": 4, }, - "writeExpr": Object { - "range": Array [ - 297, - 321, - ], - "type": "TSTypeAssertion", + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, }, + "variables": Array [], }, ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 10, + "$ref": 5, }, "variableMap": Object { - "x": Object { - "$ref": 0, - }, - "y": Object { + "a": Object { "$ref": 1, }, - "z": Object { - "$ref": 2, + "foo": Object { + "$ref": 0, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 4, }, "variables": Array [ Object { @@ -11658,49 +14163,64 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "foo", "range": Array [ - 17, - 18, + 7, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ - 17, - 32, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 13, - 33, + 0, + 59, ], - "type": "VariableDeclaration", + "type": "TSModuleDeclaration", }, - "type": "Variable", + "parent": null, + "type": "NamespaceName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 7, + 10, + ], + "type": "Identifier", }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 1, + "defs": Array [ Object { "name": Object { - "name": "x", + "name": "a", "range": Array [ - 182, - 183, + 35, + 36, ], "type": "Identifier", }, "node": Object { "range": Array [ - 182, - 195, + 35, + 40, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ - 178, - 196, + 31, + 41, ], "type": "VariableDeclaration", }, @@ -11710,169 +14230,200 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - Object { - "name": "x", + "name": "a", "range": Array [ - 182, - 183, + 35, + 36, ], "type": "Identifier", }, ], - "name": "x", + "name": "a", "references": Array [ Object { - "$ref": 3, - }, - Object { - "$ref": 6, + "$ref": 2, }, ], "scope": Object { - "$ref": 9, + "$ref": 4, }, }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/directive-in-namespace.src 1`] = ` +Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 63, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 63, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "$id": 1, - "defs": Array [ + "$id": 3, + "block": Object { + "range": Array [ + 14, + 62, + ], + "type": "TSModuleBlock", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { - "name": "y", + "$id": 2, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "a", "range": Array [ - 67, - 68, + 38, + 39, ], "type": "Identifier", }, - "node": Object { - "range": Array [ - 67, - 88, - ], - "type": "VariableDeclarator", + "kind": "w", + "resolved": Object { + "$ref": 1, }, - "parent": Object { + "writeExpr": Object { "range": Array [ - 63, - 89, + 42, + 43, ], - "type": "VariableDeclaration", + "type": "Literal", }, - "type": "Variable", }, + ], + "throughReferences": Array [ + Object { + "$ref": 2, + }, + ], + "type": "block", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "a": Object { + "$ref": 1, + }, + "foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ Object { "name": Object { - "name": "y", + "name": "foo", "range": Array [ - 230, - 231, + 10, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ - 230, - 249, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 226, - 250, + 0, + 62, ], - "type": "VariableDeclaration", + "type": "TSModuleDeclaration", }, - "type": "Variable", + "parent": null, + "type": "NamespaceName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "y", - "range": Array [ - 67, - 68, - ], - "type": "Identifier", - }, - Object { - "name": "y", + "name": "foo", "range": Array [ - 230, - 231, + 10, + 13, ], "type": "Identifier", }, ], - "name": "y", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 7, - }, - ], + "name": "foo", + "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 4, }, }, Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "z", - "range": Array [ - 132, - 133, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 132, - 162, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 128, - 163, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - Object { - "name": Object { - "name": "z", + "name": "a", "range": Array [ - 293, - 294, + 38, + 39, ], "type": "Identifier", }, "node": Object { "range": Array [ - 293, - 321, + 38, + 43, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ - 289, - 322, + 34, + 44, ], "type": "VariableDeclaration", }, @@ -11882,33 +14433,22 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "z", - "range": Array [ - 132, - 133, - ], - "type": "Identifier", - }, - Object { - "name": "z", + "name": "a", "range": Array [ - 293, - 294, + 38, + 39, ], "type": "Identifier", }, ], - "name": "z", + "name": "a", "references": Array [ Object { - "$ref": 5, - }, - Object { - "$ref": 8, + "$ref": 2, }, ], "scope": Object { - "$ref": 9, + "$ref": 4, }, }, ], @@ -11922,19 +14462,171 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/const-enum.src 1`] = ` +exports[`typescript fixtures/basics/export-as-namespace.src 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 23, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 23, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 0, + "from": Object { + "$ref": 1, + }, + "identifier": Object { + "name": "a", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/export-assignment.src 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 14, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 14, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 0, + "from": Object { + "$ref": 1, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/export-declare-const-named-enum.src 1`] = ` Object { "$id": 6, "block": Object { "range": Array [ 0, - 39, + 55, ], "type": "Program", }, @@ -11944,7 +14636,7 @@ Object { "block": Object { "range": Array [ 0, - 39, + 55, ], "type": "Program", }, @@ -11953,8 +14645,8 @@ Object { "$id": 4, "block": Object { "range": Array [ - 0, - 39, + 7, + 54, ], "type": "TSEnumDeclaration", }, @@ -11970,8 +14662,8 @@ Object { "identifier": Object { "name": "foo", "range": Array [ - 21, - 24, + 36, + 39, ], "type": "Identifier", }, @@ -11981,8 +14673,8 @@ Object { }, "writeExpr": Object { "range": Array [ - 27, - 28, + 42, + 43, ], "type": "Literal", }, @@ -12012,15 +14704,15 @@ Object { "name": Object { "name": "foo", "range": Array [ - 21, - 24, + 36, + 39, ], "type": "Identifier", }, "node": Object { "range": Array [ - 21, - 28, + 36, + 43, ], "type": "TSEnumMember", }, @@ -12033,8 +14725,8 @@ Object { Object { "name": "foo", "range": Array [ - 21, - 24, + 36, + 39, ], "type": "Identifier", }, @@ -12056,15 +14748,15 @@ Object { "name": Object { "name": "bar", "range": Array [ - 34, - 37, + 49, + 52, ], "type": "Identifier", }, "node": Object { "range": Array [ - 34, - 37, + 49, + 52, ], "type": "TSEnumMember", }, @@ -12077,8 +14769,8 @@ Object { Object { "name": "bar", "range": Array [ - 34, - 37, + 49, + 52, ], "type": "Identifier", }, @@ -12116,15 +14808,15 @@ Object { "name": Object { "name": "Foo", "range": Array [ - 11, - 14, + 26, + 29, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 39, + 7, + 54, ], "type": "TSEnumDeclaration", }, @@ -12137,8 +14829,8 @@ Object { Object { "name": "Foo", "range": Array [ - 11, - 14, + 26, + 29, ], "type": "Identifier", }, @@ -12166,52 +14858,81 @@ Object { } `; -exports[`typescript fixtures/basics/declare-class-with-optional-method.src 1`] = ` +exports[`typescript fixtures/basics/export-declare-named-enum.src 1`] = ` Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, - 38, + 49, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, - 38, + 49, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ - 0, - 38, + 7, + 48, ], - "type": "ClassDeclaration", + "type": "TSEnumDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 30, + 33, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": Object { + "range": Array [ + 36, + 37, + ], + "type": "Literal", + }, + }, + ], "throughReferences": Array [], - "type": "class", + "type": "enum", "upperScope": Object { - "$ref": 3, + "$ref": 5, }, "variableMap": Object { - "Foo": Object { + "bar": Object { + "$ref": 2, + }, + "foo": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -12219,39 +14940,83 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "foo", "range": Array [ - 14, - 17, + 30, + 33, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 38, + 30, + 37, ], - "type": "ClassDeclaration", + "type": "TSEnumMember", }, "parent": undefined, - "type": "ClassName", + "type": "EnumMemberName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "foo", "range": Array [ - 14, - 17, + 30, + 33, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "foo", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "bar", + "range": Array [ + 43, + 46, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 43, + 46, + ], + "type": "TSEnumMember", + }, + "parent": undefined, + "type": "EnumMemberName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "bar", + "range": Array [ + 43, + 46, + ], + "type": "Identifier", + }, + ], + "name": "bar", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 4, }, }, ], @@ -12263,7 +15028,7 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { "Foo": Object { @@ -12271,7 +15036,7 @@ Object { }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -12281,20 +15046,20 @@ Object { "name": Object { "name": "Foo", "range": Array [ - 14, - 17, + 20, + 23, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 38, + 7, + 48, ], - "type": "ClassDeclaration", + "type": "TSEnumDeclaration", }, - "parent": null, - "type": "ClassName", + "parent": undefined, + "type": "EnumName", }, ], "eslintUsed": undefined, @@ -12302,8 +15067,8 @@ Object { Object { "name": "Foo", "range": Array [ - 14, - 17, + 20, + 23, ], "type": "Identifier", }, @@ -12311,10 +15076,85 @@ Object { "name": "Foo", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/export-default-class-with-generic.src 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 29, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 0, + "block": Object { + "range": Array [ + 15, + 28, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 1, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, }, + "variables": Array [], }, ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], }, ], "functionExpressionScope": false, @@ -12325,101 +15165,56 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/declare-function.src 1`] = ` +exports[`typescript fixtures/basics/export-default-class-with-multiple-generics.src 1`] = ` Object { - "$id": 4, + "$id": 2, "block": Object { "range": Array [ 0, - 42, + 32, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 1, "block": Object { "range": Array [ 0, - 42, + 32, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 0, "block": Object { "range": Array [ - 0, - 42, + 15, + 31, ], - "type": "TSDeclareFunction", + "type": "ClassDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "empty-function", + "type": "class", "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "bar": Object { - "$ref": 1, - }, + "$ref": 1, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 1, }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 21, - 32, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 42, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 21, - 32, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -12428,58 +15223,13 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, + "$ref": 2, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 1, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 42, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -12490,19 +15240,19 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 2, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/destructuring-assignment.src 1`] = ` +exports[`typescript fixtures/basics/export-named-class-with-generic.src 1`] = ` Object { "$id": 4, "block": Object { "range": Array [ 0, - 21, + 25, ], "type": "Program", }, @@ -12512,115 +15262,145 @@ Object { "block": Object { "range": Array [ 0, - 21, + 25, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { - "$id": 0, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 3, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { + "$id": 2, + "block": Object { "range": Array [ - 9, - 11, + 7, + 24, ], - "type": "ArrayExpression", + "type": "ClassDeclaration", }, - }, - Object { - "$id": 1, - "from": Object { + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { "$ref": 3, }, - "identifier": Object { - "name": "foo", - "range": Array [ - 3, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "bar", - "range": Array [ - 16, - 19, - ], - "type": "Identifier", + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, }, - }, - Object { - "$id": 2, - "from": Object { + "variableScope": Object { "$ref": 3, }, - "identifier": Object { - "name": "bar", - "range": Array [ - 16, - 19, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 24, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], "type": "module", "upperScope": Object { "$ref": 4, }, - "variableMap": Object {}, + "variableMap": Object { + "Foo": Object { + "$ref": 0, + }, + }, "variableScope": Object { "$ref": 3, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 24, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, @@ -12631,300 +15411,491 @@ Object { } `; -exports[`typescript fixtures/basics/destructuring-assignment-nested.src 1`] = ` +exports[`typescript fixtures/basics/export-named-class-with-multiple-generics.src 1`] = ` Object { - "$id": 11, + "$id": 4, "block": Object { "range": Array [ 0, - 130, + 28, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 10, + "$id": 3, "block": Object { "range": Array [ 0, - 130, + 28, ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 76, - 79, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 69, - 71, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 62, - 64, - ], - "type": "ArrayExpression", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 84, - 127, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 34, - 35, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 76, - 79, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 34, - 35, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 69, - 71, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 6, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 34, - 35, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { "range": Array [ - 62, - 64, + 7, + 27, ], - "type": "ArrayExpression", + "type": "ClassDeclaration", }, - }, - Object { - "$id": 7, - "from": Object { - "$ref": 10, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 3, }, - "identifier": Object { - "name": "x", - "range": Array [ - 34, - 35, - ], - "type": "Identifier", + "variableMap": Object { + "Foo": Object { + "$ref": 1, + }, }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 47, - 58, - ], - "type": "ObjectExpression", + "variableScope": Object { + "$ref": 3, }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 27, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "Foo": Object { + "$ref": 0, }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ Object { - "$id": 8, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "x", - "range": Array [ - 34, - 35, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 39, - 42, - ], - "type": "ArrayExpression", + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 27, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 3, }, }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/export-named-enum.src 1`] = ` +Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 40, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 40, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "$id": 9, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "x", + "$id": 4, + "block": Object { "range": Array [ - 34, - 35, + 7, + 40, ], - "type": "Identifier", + "type": "TSEnumDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 1, + }, + "writeExpr": Object { + "range": Array [ + 28, + 29, + ], + "type": "Literal", + }, + }, + ], + "throughReferences": Array [], + "type": "enum", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "bar": Object { + "$ref": 2, + }, + "foo": Object { + "$ref": 1, + }, }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 84, - 127, - ], - "type": "ObjectExpression", + "variableScope": Object { + "$ref": 5, }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 22, + 29, + ], + "type": "TSEnumMember", + }, + "parent": undefined, + "type": "EnumMemberName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "bar", + "range": Array [ + 35, + 38, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 35, + 38, + ], + "type": "TSEnumMember", + }, + "parent": undefined, + "type": "EnumMemberName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "bar", + "range": Array [ + 35, + 38, + ], + "type": "Identifier", + }, + ], + "name": "bar", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], }, ], - "throughReferences": Array [ - Object { + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "Foo": Object { "$ref": 0, }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - Object { - "$ref": 7, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 9, + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "Foo", + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 40, + ], + "type": "TSEnumDeclaration", + }, + "parent": undefined, + "type": "EnumName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "Foo", + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + }, + ], + "name": "Foo", + "references": Array [], + "scope": Object { + "$ref": 5, + }, }, ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/export-type-alias-declaration.src 1`] = ` +Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 40, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 0, + "block": Object { + "range": Array [ + 0, + 40, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 1, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 0, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/export-type-class-declaration.src 1`] = ` +Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 51, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 0, + "block": Object { + "range": Array [ + 0, + 51, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 11, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 0, }, "variables": Array [], }, @@ -12932,155 +15903,49 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - Object { - "$ref": 3, - }, - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - Object { - "$ref": 6, - }, - Object { - "$ref": 7, - }, - Object { - "$ref": 8, - }, - Object { - "$ref": 9, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 11, + "$ref": 1, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/destructuring-assignment-object.src 1`] = ` +exports[`typescript fixtures/basics/export-type-function-declaration.src 1`] = ` Object { - "$id": 4, + "$id": 1, "block": Object { "range": Array [ 0, - 22, + 47, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 0, "block": Object { "range": Array [ 0, - 22, + 47, ], "type": "Program", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 3, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "range": Array [ - 9, - 11, - ], - "type": "ObjectExpression", - }, - }, - Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 3, - 6, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": null, - "writeExpr": Object { - "name": "bar", - "range": Array [ - 16, - 19, - ], - "type": "Identifier", - }, - }, - Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 16, - 19, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 1, }, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 0, }, "variables": Array [], }, @@ -13088,180 +15953,117 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 1, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/destructuring-assignment-property.src 1`] = ` +exports[`typescript fixtures/basics/function-anonymus-with-type-parameters.src 1`] = ` Object { - "$id": 8, + "$id": 7, "block": Object { "range": Array [ 0, - 38, + 51, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 6, "block": Object { "range": Array [ 0, - 38, + 51, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 5, "block": Object { "range": Array [ - 0, - 37, + 10, + 49, ], - "type": "FunctionDeclaration", + "type": "FunctionExpression", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "name": "bar", - "range": Array [ - 28, - 31, - ], - "type": "Identifier", - }, - }, Object { "$id": 4, "from": Object { - "$ref": 6, + "$ref": 5, }, "identifier": Object { - "name": "foo", + "name": "a", "range": Array [ - 15, - 18, + 45, + 46, ], "type": "Identifier", }, - "kind": "w", + "kind": "r", "resolved": Object { - "$ref": 2, - }, - "writeExpr": Object { - "range": Array [ - 21, - 23, - ], - "type": "ArrayExpression", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "bar", - "range": Array [ - 28, - 31, - ], - "type": "Identifier", + "$ref": 3, }, - "kind": "r", - "resolved": null, "writeExpr": undefined, }, ], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - ], + "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 7, + "$ref": 6, }, "variableMap": Object { - "arguments": Object { - "$ref": 1, + "a": Object { + "$ref": 3, }, - "foo": Object { + "arguments": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 5, }, "variables": Array [ Object { - "$id": 1, + "$id": 2, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 5, }, }, Object { - "$id": 2, + "$id": 3, "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "a", "range": Array [ - 15, - 18, + 23, + 32, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 37, + 10, + 49, ], - "type": "FunctionDeclaration", + "type": "FunctionExpression", }, "parent": null, "type": "Parameter", @@ -13270,25 +16072,22 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "a", "range": Array [ - 15, - 18, + 23, + 32, ], "type": "Identifier", }, ], - "name": "foo", + "name": "a", "references": Array [ - Object { - "$ref": 3, - }, Object { "$ref": 4, }, ], "scope": Object { - "$ref": 6, + "$ref": 5, }, }, ], @@ -13296,23 +16095,45 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [ + "references": Array [ Object { - "$ref": 5, + "$id": 1, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "obj", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 10, + 49, + ], + "type": "FunctionExpression", + }, }, ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 7, }, "variableMap": Object { - "Foo": Object { + "obj": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 6, }, "variables": Array [ Object { @@ -13320,39 +16141,49 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "obj", "range": Array [ - 9, - 12, + 4, + 7, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 4, + 49, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 37, + 50, ], - "type": "FunctionDeclaration", + "type": "VariableDeclaration", }, - "parent": null, - "type": "FunctionName", + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "obj", "range": Array [ - 9, - 12, + 4, + 7, ], "type": "Identifier", }, ], - "name": "Foo", - "references": Array [], + "name": "obj", + "references": Array [ + Object { + "$ref": 1, + }, + ], "scope": Object { - "$ref": 7, + "$ref": 6, }, }, ], @@ -13361,28 +16192,24 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 5, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 7, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/directive-in-module.src 1`] = ` +exports[`typescript fixtures/basics/function-anynomus-with-return-type.src 1`] = ` Object { "$id": 5, "block": Object { "range": Array [ 0, - 60, + 33, ], "type": "Program", }, @@ -13392,7 +16219,7 @@ Object { "block": Object { "range": Array [ 0, - 60, + 33, ], "type": "Program", }, @@ -13401,70 +16228,79 @@ Object { "$id": 3, "block": Object { "range": Array [ - 11, - 59, + 10, + 31, ], - "type": "TSModuleBlock", + "type": "FunctionExpression", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ Object { "$id": 2, - "from": Object { + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { "$ref": 3, }, - "identifier": Object { - "name": "a", - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 39, - 40, - ], - "type": "Literal", - }, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 2, }, ], - "type": "block", - "upperScope": Object { + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 1, + "from": Object { "$ref": 4, }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, + "identifier": Object { + "name": "obj", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 10, + 31, + ], + "type": "FunctionExpression", }, - "variables": Array [], }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { "$ref": 5, }, "variableMap": Object { - "a": Object { - "$ref": 1, - }, - "foo": Object { + "obj": Object { "$ref": 0, }, }, @@ -13477,64 +16313,24 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "obj", "range": Array [ + 4, 7, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 59, - ], - "type": "TSModuleDeclaration", - }, - "parent": null, - "type": "NamespaceName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 7, - 10, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 35, - 36, ], "type": "Identifier", }, "node": Object { "range": Array [ - 35, - 40, + 4, + 31, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ - 31, - 41, + 0, + 32, ], "type": "VariableDeclaration", }, @@ -13544,18 +16340,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "obj", "range": Array [ - 35, - 36, + 4, + 7, ], "type": "Identifier", }, ], - "name": "a", + "name": "obj", "references": Array [ Object { - "$ref": 2, + "$ref": 1, }, ], "scope": Object { @@ -13579,80 +16375,271 @@ Object { } `; -exports[`typescript fixtures/basics/directive-in-namespace.src 1`] = ` +exports[`typescript fixtures/basics/function-overloads.src 1`] = ` Object { - "$id": 5, + "$id": 10, "block": Object { "range": Array [ 0, - 63, + 147, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 9, "block": Object { "range": Array [ 0, - 63, + 147, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ - 14, - 62, + 7, + 37, ], - "type": "TSModuleBlock", + "type": "TSDeclareFunction", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "empty-function", + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { + "x": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 18, + 27, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 7, + 37, + ], + "type": "TSDeclareFunction", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 18, + 27, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + Object { + "$id": 4, + "block": Object { + "range": Array [ + 45, + 75, + ], + "type": "TSDeclareFunction", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "empty-function", + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { + "x": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 56, + 65, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 45, + 75, + ], + "type": "TSDeclareFunction", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": true, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 56, + 65, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + Object { + "$id": 8, + "block": Object { + "range": Array [ + 83, + 146, + ], + "type": "FunctionDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 2, + "$id": 7, "from": Object { - "$ref": 3, + "$ref": 8, }, "identifier": Object { - "name": "a", + "name": "x", "range": Array [ - 38, - 39, + 142, + 143, ], "type": "Identifier", }, - "kind": "w", + "kind": "r", "resolved": Object { - "$ref": 1, + "$ref": 6, }, - "writeExpr": Object { - "range": Array [ - 42, - 43, - ], - "type": "Literal", + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 5, + }, + "x": Object { + "$ref": 6, + }, + }, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [ + Object { + "$id": 5, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 8, + }, + }, + Object { + "$id": 6, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 94, + 112, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 83, + 146, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 94, + 112, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [ + Object { + "$ref": 7, + }, + ], + "scope": Object { + "$ref": 8, }, }, ], - "throughReferences": Array [ - Object { - "$ref": 2, - }, - ], - "type": "block", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [], }, ], "functionExpressionScope": false, @@ -13661,18 +16648,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 10, }, "variableMap": Object { - "a": Object { - "$ref": 1, - }, - "foo": Object { + "f": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 9, }, "variables": Array [ Object { @@ -13680,267 +16664,65 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "f", "range": Array [ - 10, - 13, + 92, + 93, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 62, + 83, + 146, ], - "type": "TSModuleDeclaration", + "type": "FunctionDeclaration", }, "parent": null, - "type": "NamespaceName", + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "f", "range": Array [ - 10, - 13, + 92, + 93, ], "type": "Identifier", }, ], - "name": "foo", + "name": "f", "references": Array [], "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 38, - 43, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 34, - 44, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [ - Object { - "$ref": 2, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/export-as-namespace.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 23, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "a", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/export-assignment.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 14, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 14, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 0, - "from": Object { - "$ref": 1, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", + "$ref": 9, }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, }, ], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 10, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/export-declare-const-named-enum.src 1`] = ` +exports[`typescript fixtures/basics/function-with-await.src 1`] = ` Object { "$id": 6, "block": Object { "range": Array [ 0, - 55, + 50, ], "type": "Program", }, @@ -13950,7 +16732,7 @@ Object { "block": Object { "range": Array [ 0, - 55, + 50, ], "type": "Program", }, @@ -13959,10 +16741,10 @@ Object { "$id": 4, "block": Object { "range": Array [ - 7, - 54, + 0, + 49, ], - "type": "TSEnumDeclaration", + "type": "FunctionDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, @@ -13974,83 +16756,44 @@ Object { "$ref": 4, }, "identifier": Object { - "name": "foo", + "name": "future", "range": Array [ - 36, - 39, + 40, + 46, ], "type": "Identifier", }, - "kind": "w", + "kind": "r", "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 42, - 43, - ], - "type": "Literal", + "$ref": 2, }, + "writeExpr": undefined, }, ], "throughReferences": Array [], - "type": "enum", + "type": "function", "upperScope": Object { "$ref": 5, }, "variableMap": Object { - "bar": Object { - "$ref": 2, - }, - "foo": Object { + "arguments": Object { "$ref": 1, }, + "future": Object { + "$ref": 2, + }, }, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [ Object { "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 36, - 39, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 36, - 43, - ], - "type": "TSEnumMember", - }, - "parent": undefined, - "type": "EnumMemberName", - }, - ], + "defs": Array [], "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 36, - 39, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [ - Object { - "$ref": 3, - }, - ], + "identifiers": Array [], + "name": "arguments", + "references": Array [], "scope": Object { "$ref": 4, }, @@ -14060,37 +16803,41 @@ Object { "defs": Array [ Object { "name": Object { - "name": "bar", + "name": "future", "range": Array [ - 49, - 52, + 20, + 26, ], "type": "Identifier", }, "node": Object { "range": Array [ + 0, 49, - 52, ], - "type": "TSEnumMember", + "type": "FunctionDeclaration", }, - "parent": undefined, - "type": "EnumMemberName", + "parent": null, + "type": "Parameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "bar", + "name": "future", "range": Array [ - 49, - 52, + 20, + 26, ], "type": "Identifier", }, ], - "name": "bar", - "references": Array [], + "name": "future", + "references": Array [ + Object { + "$ref": 3, + }, + ], "scope": Object { "$ref": 4, }, @@ -14107,7 +16854,7 @@ Object { "$ref": 6, }, "variableMap": Object { - "Foo": Object { + "hope": Object { "$ref": 0, }, }, @@ -14120,36 +16867,36 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "hope", "range": Array [ - 26, - 29, + 15, + 19, ], "type": "Identifier", }, "node": Object { "range": Array [ - 7, - 54, + 0, + 49, ], - "type": "TSEnumDeclaration", + "type": "FunctionDeclaration", }, - "parent": undefined, - "type": "EnumName", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "hope", "range": Array [ - 26, - 29, + 15, + 19, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "hope", "references": Array [], "scope": Object { "$ref": 5, @@ -14172,13 +16919,13 @@ Object { } `; -exports[`typescript fixtures/basics/export-declare-named-enum.src 1`] = ` +exports[`typescript fixtures/basics/function-with-object-type-with-optional-properties.src 1`] = ` Object { "$id": 6, "block": Object { "range": Array [ 0, - 49, + 52, ], "type": "Program", }, @@ -14188,7 +16935,7 @@ Object { "block": Object { "range": Array [ 0, - 49, + 52, ], "type": "Program", }, @@ -14197,137 +16944,121 @@ Object { "$id": 4, "block": Object { "range": Array [ - 7, - 48, + 0, + 51, ], - "type": "TSEnumDeclaration", + "type": "FunctionDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 30, - 33, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 36, - 37, - ], - "type": "Literal", - }, - }, - ], + "references": Array [], "throughReferences": Array [], - "type": "enum", + "type": "function", "upperScope": Object { "$ref": 5, }, "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, "bar": Object { "$ref": 2, }, - "foo": Object { - "$ref": 1, + "baz": Object { + "$ref": 3, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [ Object { "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "bar", "range": Array [ - 30, - 33, + 14, + 17, ], "type": "Identifier", }, "node": Object { "range": Array [ - 30, - 37, + 0, + 51, ], - "type": "TSEnumMember", + "type": "FunctionDeclaration", }, - "parent": undefined, - "type": "EnumMemberName", + "parent": null, + "type": "Parameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "bar", "range": Array [ - 30, - 33, + 14, + 17, ], "type": "Identifier", }, ], - "name": "foo", - "references": Array [ - Object { - "$ref": 3, - }, - ], + "name": "bar", + "references": Array [], "scope": Object { "$ref": 4, }, }, Object { - "$id": 2, + "$id": 3, "defs": Array [ Object { "name": Object { - "name": "bar", + "name": "baz", "range": Array [ - 43, - 46, + 19, + 22, ], "type": "Identifier", }, "node": Object { "range": Array [ - 43, - 46, + 0, + 51, ], - "type": "TSEnumMember", + "type": "FunctionDeclaration", }, - "parent": undefined, - "type": "EnumMemberName", + "parent": null, + "type": "Parameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "bar", - "range": Array [ - 43, - 46, + "name": "baz", + "range": Array [ + 19, + 22, ], "type": "Identifier", }, ], - "name": "bar", + "name": "baz", "references": Array [], "scope": Object { "$ref": 4, @@ -14345,7 +17076,7 @@ Object { "$ref": 6, }, "variableMap": Object { - "Foo": Object { + "foo": Object { "$ref": 0, }, }, @@ -14358,36 +17089,36 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "foo", "range": Array [ - 20, - 23, + 9, + 12, ], "type": "Identifier", }, "node": Object { "range": Array [ - 7, - 48, + 0, + 51, ], - "type": "TSEnumDeclaration", + "type": "FunctionDeclaration", }, - "parent": undefined, - "type": "EnumName", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "foo", "range": Array [ - 20, - 23, + 9, + 12, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "foo", "references": Array [], "scope": Object { "$ref": 5, @@ -14410,50 +17141,152 @@ Object { } `; -exports[`typescript fixtures/basics/export-default-class-with-generic.src 1`] = ` +exports[`typescript fixtures/basics/function-with-object-type-without-annotation.src 1`] = ` Object { - "$id": 2, + "$id": 6, "block": Object { "range": Array [ 0, - 29, + 50, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, - 29, + 50, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 4, "block": Object { "range": Array [ - 15, - 28, + 0, + 49, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "class", + "type": "function", "upperScope": Object { - "$ref": 1, + "$ref": 5, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "bar": Object { + "$ref": 2, + }, + "baz": Object { + "$ref": 3, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 4, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "bar", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 49, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "bar", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + ], + "name": "bar", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "baz", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 49, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "baz", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, + ], + "name": "baz", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -14462,88 +17295,58 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 2, + "$ref": 6, }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/export-default-class-with-multiple-generics.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 32, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 32, - ], - "type": "Program", + "variableScope": Object { + "$ref": 5, }, - "childScopes": Array [ + "variables": Array [ Object { "$id": 0, - "block": Object { - "range": Array [ - 15, - 31, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 49, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 5, }, - "variables": Array [], }, ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], }, ], "functionExpressionScope": false, @@ -14554,98 +17357,136 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 2, + "$ref": 6, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/export-named-class-with-generic.src 1`] = ` +exports[`typescript fixtures/basics/function-with-type-parameters.src 1`] = ` Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ 0, - 25, + 41, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, - 25, + 41, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ - 7, - 24, + 0, + 40, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "b", + "range": Array [ + 36, + 37, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], "throughReferences": Array [], - "type": "class", + "type": "function", "upperScope": Object { - "$ref": 3, + "$ref": 5, }, "variableMap": Object { - "Foo": Object { + "arguments": Object { "$ref": 1, }, + "b": Object { + "$ref": 2, + }, }, "variableScope": Object { - "$ref": 3, + "$ref": 4, }, "variables": Array [ Object { "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "b", "range": Array [ - 13, - 16, + 14, + 18, ], "type": "Identifier", }, "node": Object { "range": Array [ - 7, - 24, + 0, + 40, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, - "parent": undefined, - "type": "ClassName", + "parent": null, + "type": "Parameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "b", "range": Array [ - 13, - 16, + 14, + 18, ], "type": "Identifier", }, ], - "name": "Foo", - "references": Array [], + "name": "b", + "references": Array [ + Object { + "$ref": 3, + }, + ], "scope": Object { - "$ref": 2, + "$ref": 4, }, }, ], @@ -14657,15 +17498,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, + "$ref": 6, }, "variableMap": Object { - "Foo": Object { + "a": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [ Object { @@ -14673,39 +17514,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "a", "range": Array [ - 13, - 16, + 9, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ - 7, - 24, + 0, + 40, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, "parent": null, - "type": "ClassName", + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "a", "range": Array [ - 13, - 16, + 9, + 10, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "a", "references": Array [], "scope": Object { - "$ref": 3, + "$ref": 5, }, }, ], @@ -14719,19 +17560,19 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/export-named-class-with-multiple-generics.src 1`] = ` +exports[`typescript fixtures/basics/function-with-type-parameters-that-have-comments.src 1`] = ` Object { "$id": 4, "block": Object { "range": Array [ 0, - 28, + 35, ], "type": "Program", }, @@ -14741,7 +17582,7 @@ Object { "block": Object { "range": Array [ 0, - 28, + 35, ], "type": "Program", }, @@ -14750,64 +17591,35 @@ Object { "$id": 2, "block": Object { "range": Array [ - 7, - 27, + 0, + 35, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], - "type": "class", + "type": "function", "upperScope": Object { "$ref": 3, }, "variableMap": Object { - "Foo": Object { + "arguments": Object { "$ref": 1, }, }, "variableScope": Object { - "$ref": 3, + "$ref": 2, }, "variables": Array [ Object { "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "Foo", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 27, - ], - "type": "ClassDeclaration", - }, - "parent": undefined, - "type": "ClassName", - }, - ], + "defs": Array [], "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "Foo", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - ], - "name": "Foo", + "identifiers": Array [], + "name": "arguments", "references": Array [], "scope": Object { "$ref": 2, @@ -14825,7 +17637,7 @@ Object { "$ref": 4, }, "variableMap": Object { - "Foo": Object { + "compare": Object { "$ref": 0, }, }, @@ -14838,36 +17650,36 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "compare", "range": Array [ - 13, + 9, 16, ], "type": "Identifier", }, "node": Object { "range": Array [ - 7, - 27, + 0, + 35, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, "parent": null, - "type": "ClassName", + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "compare", "range": Array [ - 13, + 9, 16, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "compare", "references": Array [], "scope": Object { "$ref": 3, @@ -14890,13 +17702,13 @@ Object { } `; -exports[`typescript fixtures/basics/export-named-enum.src 1`] = ` +exports[`typescript fixtures/basics/function-with-type-parameters-with-constraint.src 1`] = ` Object { "$id": 6, "block": Object { "range": Array [ 0, - 40, + 52, ], "type": "Program", }, @@ -14906,7 +17718,7 @@ Object { "block": Object { "range": Array [ 0, - 40, + 52, ], "type": "Program", }, @@ -14915,10 +17727,10 @@ Object { "$id": 4, "block": Object { "range": Array [ - 7, - 40, + 0, + 51, ], - "type": "TSEnumDeclaration", + "type": "FunctionDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, @@ -14930,83 +17742,44 @@ Object { "$ref": 4, }, "identifier": Object { - "name": "foo", + "name": "b", "range": Array [ - 22, - 25, + 47, + 48, ], "type": "Identifier", }, - "kind": "w", + "kind": "r", "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 28, - 29, - ], - "type": "Literal", + "$ref": 2, }, + "writeExpr": undefined, }, ], "throughReferences": Array [], - "type": "enum", + "type": "function", "upperScope": Object { "$ref": 5, }, "variableMap": Object { - "bar": Object { - "$ref": 2, - }, - "foo": Object { + "arguments": Object { "$ref": 1, }, + "b": Object { + "$ref": 2, + }, }, "variableScope": Object { - "$ref": 5, + "$ref": 4, }, "variables": Array [ Object { "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 22, - 29, - ], - "type": "TSEnumMember", - }, - "parent": undefined, - "type": "EnumMemberName", - }, - ], + "defs": Array [], "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [ - Object { - "$ref": 3, - }, - ], + "identifiers": Array [], + "name": "arguments", + "references": Array [], "scope": Object { "$ref": 4, }, @@ -15016,37 +17789,41 @@ Object { "defs": Array [ Object { "name": Object { - "name": "bar", + "name": "b", "range": Array [ - 35, - 38, + 25, + 29, ], "type": "Identifier", }, "node": Object { "range": Array [ - 35, - 38, + 0, + 51, ], - "type": "TSEnumMember", + "type": "FunctionDeclaration", }, - "parent": undefined, - "type": "EnumMemberName", + "parent": null, + "type": "Parameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "bar", + "name": "b", "range": Array [ - 35, - 38, + 25, + 29, ], "type": "Identifier", }, ], - "name": "bar", - "references": Array [], + "name": "b", + "references": Array [ + Object { + "$ref": 3, + }, + ], "scope": Object { "$ref": 4, }, @@ -15063,7 +17840,7 @@ Object { "$ref": 6, }, "variableMap": Object { - "Foo": Object { + "a": Object { "$ref": 0, }, }, @@ -15076,36 +17853,36 @@ Object { "defs": Array [ Object { "name": Object { - "name": "Foo", + "name": "a", "range": Array [ - 12, - 15, + 9, + 10, ], "type": "Identifier", }, "node": Object { "range": Array [ - 7, - 40, + 0, + 51, ], - "type": "TSEnumDeclaration", + "type": "FunctionDeclaration", }, - "parent": undefined, - "type": "EnumName", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "Foo", + "name": "a", "range": Array [ - 12, - 15, + 9, + 10, ], "type": "Identifier", }, ], - "name": "Foo", + "name": "a", "references": Array [], "scope": Object { "$ref": 5, @@ -15128,140 +17905,193 @@ Object { } `; -exports[`typescript fixtures/basics/export-type-alias-declaration.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/export-type-class-declaration.src 1`] = ` +exports[`typescript fixtures/basics/function-with-types.src 1`] = ` Object { - "$id": 1, + "$id": 6, "block": Object { "range": Array [ 0, - 51, + 58, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 5, "block": Object { "range": Array [ 0, - 51, + 58, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 57, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "name", + "range": Array [ + 50, + 54, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "name": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "name", + "range": Array [ + 17, + 28, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 57, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "name", + "range": Array [ + 17, + 28, + ], + "type": "Identifier", + }, + ], + "name": "name", + "references": Array [ + Object { + "$ref": 3, + }, + ], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/export-type-function-declaration.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 47, - ], - "type": "Program", + "$ref": 6, }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, + "variableMap": Object { + "message": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 5, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "message", + "range": Array [ + 9, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 57, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "message", + "range": Array [ + 9, + 16, + ], + "type": "Identifier", + }, + ], + "name": "message", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -15272,62 +18102,87 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 6, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/function-anonymus-with-type-parameters.src 1`] = ` +exports[`typescript fixtures/basics/function-with-types-assignation.src 1`] = ` Object { - "$id": 7, + "$id": 9, "block": Object { "range": Array [ 0, - 51, + 97, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 8, "block": Object { "range": Array [ 0, - 51, + 97, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ - 10, - 49, + 0, + 96, ], - "type": "FunctionExpression", + "type": "FunctionDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 5, + "$ref": 7, }, "identifier": Object { - "name": "a", + "name": "age", "range": Array [ - 45, + 30, + 40, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": Object { + "range": Array [ + 43, 46, ], + "type": "Literal", + }, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 7, + }, + "identifier": Object { + "name": "name", + "range": Array [ + 89, + 93, + ], "type": "Identifier", }, "kind": "r", "resolved": Object { - "$ref": 3, + "$ref": 2, }, "writeExpr": undefined, }, @@ -15335,49 +18190,143 @@ Object { "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 6, + "$ref": 8, }, "variableMap": Object { - "a": Object { + "age": Object { "$ref": 3, }, + "args": Object { + "$ref": 4, + }, "arguments": Object { + "$ref": 1, + }, + "name": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [], "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "name", + "range": Array [ + 17, + 28, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 96, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "name", + "range": Array [ + 17, + 28, + ], + "type": "Identifier", + }, + ], + "name": "name", + "references": Array [ + Object { + "$ref": 6, + }, + ], + "scope": Object { + "$ref": 7, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "age", + "range": Array [ + 30, + 40, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 96, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "age", + "range": Array [ + 30, + 40, + ], + "type": "Identifier", + }, + ], + "name": "age", + "references": Array [ + Object { + "$ref": 5, + }, + ], "scope": Object { - "$ref": 5, + "$ref": 7, }, }, Object { - "$id": 3, + "$id": 4, "defs": Array [ Object { "name": Object { - "name": "a", + "name": "args", "range": Array [ - 23, - 32, + 51, + 55, ], "type": "Identifier", }, "node": Object { "range": Array [ - 10, - 49, + 0, + 96, ], - "type": "FunctionExpression", + "type": "FunctionDeclaration", }, "parent": null, "type": "Parameter", @@ -15386,22 +18335,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "a", + "name": "args", "range": Array [ - 23, - 32, + 51, + 55, ], "type": "Identifier", }, ], - "name": "a", - "references": Array [ - Object { - "$ref": 4, - }, - ], + "name": "args", + "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 7, }, }, ], @@ -15409,45 +18354,19 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 10, - 49, - ], - "type": "FunctionExpression", - }, - }, - ], + "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 9, }, "variableMap": Object { - "obj": Object { + "message": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 8, }, "variables": Array [ Object { @@ -15455,49 +18374,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "obj", + "name": "message", "range": Array [ - 4, - 7, + 9, + 16, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 49, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 50, + 96, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "obj", + "name": "message", "range": Array [ - 4, - 7, + 9, + 16, ], "type": "Identifier", }, ], - "name": "obj", - "references": Array [ - Object { - "$ref": 1, - }, - ], + "name": "message", + "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 8, }, }, ], @@ -15511,115 +18420,143 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 7, + "$ref": 9, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/function-anynomus-with-return-type.src 1`] = ` +exports[`typescript fixtures/basics/global-this.src 1`] = ` Object { - "$id": 5, + "$id": 7, "block": Object { "range": Array [ - 0, - 33, + 22, + 206, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 6, "block": Object { "range": Array [ - 0, - 33, + 22, + 206, ], "type": "Program", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 3, - "block": Object { + "$id": 2, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "abc", "range": Array [ - 10, - 31, + 26, + 29, ], - "type": "FunctionExpression", + "type": "Identifier", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 4, + "kind": "w", + "resolved": Object { + "$ref": 0, }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, - }, + "writeExpr": Object { + "range": Array [ + 32, + 35, + ], + "type": "Literal", }, - "variableScope": Object { - "$ref": 3, + }, + Object { + "$id": 3, + "from": Object { + "$ref": 6, }, - "variables": Array [ - Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], + "identifier": Object { + "name": "globalThis", + "range": Array [ + 69, + 79, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ Object { - "$id": 1, + "$id": 4, "from": Object { - "$ref": 4, + "$ref": 6, }, "identifier": Object { - "name": "obj", + "name": "answer", "range": Array [ - 4, - 7, + 97, + 103, ], "type": "Identifier", }, "kind": "w", "resolved": Object { - "$ref": 0, + "$ref": 1, }, "writeExpr": Object { "range": Array [ - 10, - 31, + 106, + 108, ], - "type": "FunctionExpression", + "type": "Literal", }, }, + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "globalThis", + "range": Array [ + 178, + 188, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, ], - "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 5, + "$ref": 7, }, "variableMap": Object { - "obj": Object { + "abc": Object { "$ref": 0, }, + "answer": Object { + "$ref": 1, + }, }, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [ Object { @@ -15627,24 +18564,24 @@ Object { "defs": Array [ Object { "name": Object { - "name": "obj", + "name": "abc", "range": Array [ - 4, - 7, + 26, + 29, ], "type": "Identifier", }, "node": Object { "range": Array [ - 4, - 31, + 26, + 35, ], "type": "VariableDeclarator", }, "parent": Object { "range": Array [ - 0, - 32, + 22, + 36, ], "type": "VariableDeclaration", }, @@ -15654,22 +18591,72 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "obj", + "name": "abc", "range": Array [ - 4, - 7, + 26, + 29, ], "type": "Identifier", }, ], - "name": "obj", + "name": "abc", "references": Array [ Object { - "$ref": 1, + "$ref": 2, }, ], "scope": Object { - "$ref": 4, + "$ref": 6, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "answer", + "range": Array [ + 97, + 103, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 97, + 108, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 93, + 109, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "answer", + "range": Array [ + 97, + 103, + ], + "type": "Identifier", + }, + ], + "name": "answer", + "references": Array [ + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 6, }, }, ], @@ -15678,342 +18665,448 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 5, + }, + ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 7, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/function-overloads.src 1`] = ` +exports[`typescript fixtures/basics/import-equal-declaration.src 1`] = ` Object { - "$id": 10, + "$id": 2, "block": Object { "range": Array [ 0, - 147, + 29, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 9, + "$id": 1, "block": Object { "range": Array [ 0, - 147, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 7, - 37, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "x": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 18, - 27, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 7, - 37, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 18, - 27, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - Object { - "$id": 4, - "block": Object { - "range": Array [ - 45, - 75, - ], - "type": "TSDeclareFunction", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "empty-function", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "x": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [ - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 56, - 65, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 45, - 75, - ], - "type": "TSDeclareFunction", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": true, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 56, - 65, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], + 29, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ Object { - "$id": 8, - "block": Object { - "range": Array [ - 83, - 146, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "$id": 0, + "defs": Array [ Object { - "$id": 7, - "from": Object { - "$ref": 8, - }, - "identifier": Object { - "name": "x", + "name": Object { + "name": "foo", "range": Array [ - 142, - 143, + 7, + 10, ], "type": "Identifier", }, - "kind": "r", - "resolved": Object { - "$ref": 6, + "node": Object { + "range": Array [ + 0, + 28, + ], + "type": "TSImportEqualsDeclaration", }, - "writeExpr": undefined, + "parent": null, + "type": "ImportBinding", }, ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 5, - }, - "x": Object { - "$ref": 6, + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 7, + 10, + ], + "type": "Identifier", }, + ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 1, }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/import-export-equal-declaration.src 1`] = ` +Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 36, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 36, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 2, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ Object { - "$id": 5, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 8, + "name": Object { + "name": "foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 35, + ], + "type": "TSImportEqualsDeclaration", }, + "parent": null, + "type": "ImportBinding", }, + ], + "eslintUsed": undefined, + "identifiers": Array [ Object { - "$id": 6, - "defs": Array [ - Object { - "name": Object { - "name": "x", - "range": Array [ - 94, - 112, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 83, - 146, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 94, - 112, - ], - "type": "Identifier", - }, - ], - "name": "x", - "references": Array [ - Object { - "$ref": 7, - }, + "name": "foo", + "range": Array [ + 14, + 17, ], - "scope": Object { - "$ref": 8, - }, + "type": "Identifier", }, ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 1, + }, }, ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/import-type.src 1`] = ` +Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 56, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 0, + "block": Object { + "range": Array [ + 0, + 56, + ], + "type": "Program", + }, + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 10, + "$ref": 1, }, - "variableMap": Object { - "f": Object { - "$ref": 0, - }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 0, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/import-type-with-type-parameters-in-type-reference.src 1`] = ` +Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 31, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 0, + "block": Object { + "range": Array [ + 0, + 31, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 1, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 9, + "$ref": 0, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "f", - "range": Array [ - 92, - 93, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 83, - 146, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "f", - "range": Array [ - 92, - 93, - ], - "type": "Identifier", - }, - ], - "name": "f", - "references": Array [], - "scope": Object { - "$ref": 9, - }, - }, - ], + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/interface-extends.src 1`] = ` +Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 31, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 0, + "block": Object { + "range": Array [ + 0, + 31, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 1, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 0, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/interface-extends-multiple.src 1`] = ` +Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 35, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 0, + "block": Object { + "range": Array [ + 0, + 35, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 1, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 0, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/interface-type-parameters.src 1`] = ` +Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 22, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 0, + "block": Object { + "range": Array [ + 0, + 22, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 1, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 0, + }, + "variables": Array [], }, ], "functionExpressionScope": false, @@ -16024,199 +19117,218 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 1, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/function-with-await.src 1`] = ` +exports[`typescript fixtures/basics/interface-with-all-property-types.src 1`] = ` Object { - "$id": 6, + "$id": 4, "block": Object { "range": Array [ 0, - 50, + 297, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 3, "block": Object { "range": Array [ 0, - 50, + 297, ], "type": "Program", }, - "childScopes": Array [ + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "$id": 4, - "block": Object { + "$id": 0, + "from": Object { + "$ref": 3, + }, + "identifier": Object { + "name": "bax", "range": Array [ - 0, - 49, + 56, + 59, ], - "type": "FunctionDeclaration", + "type": "Identifier", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "future", - "range": Array [ - 40, - 46, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 1, + "from": Object { + "$ref": 3, }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "future": Object { - "$ref": 2, - }, + "identifier": Object { + "name": "baz", + "range": Array [ + 75, + 78, + ], + "type": "Identifier", }, - "variableScope": Object { - "$ref": 4, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 2, + "from": Object { + "$ref": 3, }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "future", - "range": Array [ - 20, - 26, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 49, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "future", - "range": Array [ - 20, - 26, - ], - "type": "Identifier", - }, - ], - "name": "future", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], + "identifier": Object { + "name": "loo", + "range": Array [ + 192, + 195, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, }, ], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + Object { + "$ref": 2, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/interface-with-construct-signature-with-parameter-accessibility.src 1`] = ` +Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 50, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 0, + "block": Object { + "range": Array [ + 0, + 50, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 1, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 0, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/interface-with-extends-member-expression.src 1`] = ` +Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 34, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 0, + "block": Object { + "range": Array [ + 0, + 34, + ], + "type": "Program", + }, + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "hope": Object { - "$ref": 0, - }, + "$ref": 1, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 0, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "hope", - "range": Array [ - 15, - 19, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 49, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "hope", - "range": Array [ - 15, - 19, - ], - "type": "Identifier", - }, - ], - "name": "hope", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -16227,218 +19339,96 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 1, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/function-with-object-type-with-optional-properties.src 1`] = ` +exports[`typescript fixtures/basics/interface-with-extends-type-parameters.src 1`] = ` Object { - "$id": 6, + "$id": 1, "block": Object { "range": Array [ 0, - 52, + 37, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 0, "block": Object { "range": Array [ 0, - 52, + 37, ], "type": "Program", }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 51, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "bar": Object { - "$ref": 2, - }, - "baz": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 51, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "baz", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 51, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "baz", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - ], - "name": "baz", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 1, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 0, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/interface-with-generic.src 1`] = ` +Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 22, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 0, + "block": Object { + "range": Array [ + 0, + 22, + ], + "type": "Program", + }, + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, + "$ref": 1, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 0, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 51, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -16449,218 +19439,46 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 1, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/function-with-object-type-without-annotation.src 1`] = ` +exports[`typescript fixtures/basics/interface-with-jsdoc.src 1`] = ` Object { - "$id": 6, + "$id": 1, "block": Object { "range": Array [ 0, - 50, + 88, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 0, "block": Object { "range": Array [ 0, - 50, + 88, ], "type": "Program", }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 49, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "bar": Object { - "$ref": 2, - }, - "baz": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "bar", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 49, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "bar", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - ], - "name": "bar", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 3, - "defs": Array [ - Object { - "name": Object { - "name": "baz", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 49, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "baz", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - ], - "name": "baz", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, + "$ref": 1, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 49, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - ], - "name": "foo", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], + "$ref": 0, + }, + "variables": Array [], }, ], "functionExpressionScope": false, @@ -16671,199 +19489,46 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 1, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/function-with-type-parameters.src 1`] = ` +exports[`typescript fixtures/basics/interface-with-method.src 1`] = ` Object { - "$id": 6, + "$id": 1, "block": Object { "range": Array [ 0, - 41, + 62, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 0, "block": Object { "range": Array [ 0, - 41, + 62, ], "type": "Program", }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 40, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 36, - 37, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "b": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 14, - 18, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 40, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 14, - 18, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, + "$ref": 1, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 5, + "$ref": 0, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 40, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -16874,132 +19539,96 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 1, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/function-with-type-parameters-that-have-comments.src 1`] = ` +exports[`typescript fixtures/basics/interface-with-optional-properties.src 1`] = ` Object { - "$id": 4, + "$id": 1, "block": Object { "range": Array [ 0, - 35, + 82, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 0, "block": Object { "range": Array [ 0, - 35, + 82, ], "type": "Program", }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 35, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 1, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 0, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/interface-without-type-annotation.src 1`] = ` +Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 0, + "block": Object { + "range": Array [ + 0, + 28, + ], + "type": "Program", + }, + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object { - "compare": Object { - "$ref": 0, - }, + "$ref": 1, }, + "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 0, }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "compare", - "range": Array [ - 9, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 35, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "compare", - "range": Array [ - 9, - 16, - ], - "type": "Identifier", - }, - ], - "name": "compare", - "references": Array [], - "scope": Object { - "$ref": 3, - }, - }, - ], + "variables": Array [], }, ], "functionExpressionScope": false, @@ -17010,199 +19639,46 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 1, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/function-with-type-parameters-with-constraint.src 1`] = ` +exports[`typescript fixtures/basics/keyof-operator.src 1`] = ` Object { - "$id": 6, + "$id": 1, "block": Object { "range": Array [ 0, - 52, + 20, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 0, "block": Object { "range": Array [ 0, - 52, + 20, ], "type": "Program", }, - "childScopes": Array [ - Object { - "$id": 4, - "block": Object { - "range": Array [ - 0, - 51, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 4, - }, - "identifier": Object { - "name": "b", - "range": Array [ - 47, - 48, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "b": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, - }, - }, - Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "b", - "range": Array [ - 25, - 29, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 51, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "b", - "range": Array [ - 25, - 29, - ], - "type": "Identifier", - }, - ], - "name": "b", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, - }, - }, - ], - }, - ], + "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "a": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "a", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 51, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "a", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - ], - "name": "a", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 1, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 0, + }, + "variables": Array [], }, ], "functionExpressionScope": false, @@ -17213,664 +19689,559 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 1, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/function-with-types.src 1`] = ` +exports[`typescript fixtures/basics/keyword-variables.src 1`] = ` Object { - "$id": 6, + "$id": 20, "block": Object { "range": Array [ 0, - 58, + 190, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 19, "block": Object { "range": Array [ 0, - 58, + 190, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 18, "block": Object { "range": Array [ 0, - 57, + 110, ], - "type": "FunctionDeclaration", + "type": "BlockStatement", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 3, + "$id": 12, "from": Object { - "$ref": 4, + "$ref": 18, }, "identifier": Object { - "name": "name", + "name": "get", "range": Array [ - 50, - 54, + 10, + 13, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { - "$ref": 2, + "$ref": 6, }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "name": Object { - "$ref": 2, - }, - }, - "variableScope": Object { - "$ref": 4, - }, - "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 4, + "writeExpr": Object { + "range": Array [ + 16, + 17, + ], + "type": "Literal", }, }, Object { - "$id": 2, - "defs": Array [ - Object { - "name": Object { - "name": "name", - "range": Array [ - 17, - 28, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 57, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "Parameter", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "name", - "range": Array [ - 17, - 28, - ], - "type": "Identifier", - }, - ], - "name": "name", - "references": Array [ - Object { - "$ref": 3, - }, - ], - "scope": Object { - "$ref": 4, + "$id": 13, + "from": Object { + "$ref": 18, }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 6, - }, - "variableMap": Object { - "message": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "message", + "identifier": Object { + "name": "set", "range": Array [ - 9, - 16, + 27, + 30, ], "type": "Identifier", }, - "node": Object { + "kind": "w", + "resolved": Object { + "$ref": 7, + }, + "writeExpr": Object { "range": Array [ - 0, - 57, + 33, + 34, ], - "type": "FunctionDeclaration", + "type": "Literal", }, - "parent": null, - "type": "FunctionName", }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "message", - "range": Array [ - 9, - 16, - ], - "type": "Identifier", - }, - ], - "name": "message", - "references": Array [], - "scope": Object { - "$ref": 5, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 6, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/function-with-types-assignation.src 1`] = ` -Object { - "$id": 9, - "block": Object { - "range": Array [ - 0, - 97, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 8, - "block": Object { - "range": Array [ - 0, - 97, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 7, - "block": Object { - "range": Array [ - 0, - 96, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "$id": 14, + "from": Object { + "$ref": 18, + }, + "identifier": Object { + "name": "module", + "range": Array [ + 44, + 50, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 8, + }, + "writeExpr": Object { + "range": Array [ + 53, + 54, + ], + "type": "Literal", + }, + }, Object { - "$id": 5, + "$id": 15, "from": Object { - "$ref": 7, + "$ref": 18, }, "identifier": Object { - "name": "age", + "name": "type", "range": Array [ - 30, - 40, + 64, + 68, ], "type": "Identifier", }, "kind": "w", "resolved": Object { - "$ref": 3, + "$ref": 9, }, "writeExpr": Object { "range": Array [ - 43, - 46, + 71, + 72, ], "type": "Literal", }, }, Object { - "$id": 6, + "$id": 16, "from": Object { - "$ref": 7, + "$ref": 18, }, "identifier": Object { - "name": "name", + "name": "async", "range": Array [ - 89, - 93, + 82, + 87, ], "type": "Identifier", }, - "kind": "r", + "kind": "w", "resolved": Object { - "$ref": 2, + "$ref": 10, + }, + "writeExpr": Object { + "range": Array [ + 90, + 91, + ], + "type": "Literal", + }, + }, + Object { + "$id": 17, + "from": Object { + "$ref": 18, + }, + "identifier": Object { + "name": "is", + "range": Array [ + 101, + 103, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 11, + }, + "writeExpr": Object { + "range": Array [ + 106, + 107, + ], + "type": "Literal", }, - "writeExpr": undefined, }, ], "throughReferences": Array [], - "type": "function", + "type": "block", "upperScope": Object { - "$ref": 8, + "$ref": 19, }, "variableMap": Object { - "age": Object { - "$ref": 3, + "async": Object { + "$ref": 10, }, - "args": Object { - "$ref": 4, + "get": Object { + "$ref": 6, }, - "arguments": Object { - "$ref": 1, + "is": Object { + "$ref": 11, }, - "name": Object { - "$ref": 2, + "module": Object { + "$ref": 8, + }, + "set": Object { + "$ref": 7, + }, + "type": Object { + "$ref": 9, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 19, }, "variables": Array [ Object { - "$id": 1, - "defs": Array [], + "$id": 6, + "defs": Array [ + Object { + "name": Object { + "name": "get", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 10, + 17, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 4, + 18, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], + "identifiers": Array [ + Object { + "name": "get", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + ], + "name": "get", + "references": Array [ + Object { + "$ref": 12, + }, + ], "scope": Object { - "$ref": 7, + "$ref": 18, }, }, Object { - "$id": 2, + "$id": 7, "defs": Array [ Object { "name": Object { - "name": "name", + "name": "set", "range": Array [ - 17, - 28, + 27, + 30, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 96, + 27, + 34, ], - "type": "FunctionDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "Parameter", + "parent": Object { + "range": Array [ + 21, + 35, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "name", + "name": "set", "range": Array [ - 17, - 28, + 27, + 30, ], "type": "Identifier", }, ], - "name": "name", + "name": "set", "references": Array [ Object { - "$ref": 6, + "$ref": 13, }, ], "scope": Object { - "$ref": 7, + "$ref": 18, }, }, Object { - "$id": 3, + "$id": 8, "defs": Array [ Object { "name": Object { - "name": "age", + "name": "module", "range": Array [ - 30, - 40, + 44, + 50, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 96, + 44, + 54, ], - "type": "FunctionDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "Parameter", + "parent": Object { + "range": Array [ + 38, + 55, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "module", + "range": Array [ + 44, + 50, + ], + "type": "Identifier", + }, + ], + "name": "module", + "references": Array [ + Object { + "$ref": 14, + }, + ], + "scope": Object { + "$ref": 18, + }, + }, + Object { + "$id": 9, + "defs": Array [ + Object { + "name": Object { + "name": "type", + "range": Array [ + 64, + 68, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 64, + 72, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 58, + 73, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "age", + "name": "type", "range": Array [ - 30, - 40, + 64, + 68, ], "type": "Identifier", }, ], - "name": "age", + "name": "type", "references": Array [ Object { - "$ref": 5, + "$ref": 15, }, ], "scope": Object { - "$ref": 7, + "$ref": 18, }, }, Object { - "$id": 4, + "$id": 10, "defs": Array [ Object { "name": Object { - "name": "args", + "name": "async", "range": Array [ - 51, - 55, + 82, + 87, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 96, + 82, + 91, ], - "type": "FunctionDeclaration", + "type": "VariableDeclarator", }, - "parent": null, - "type": "Parameter", + "parent": Object { + "range": Array [ + 76, + 92, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "args", + "name": "async", "range": Array [ - 51, - 55, + 82, + 87, ], "type": "Identifier", }, ], - "name": "args", - "references": Array [], + "name": "async", + "references": Array [ + Object { + "$ref": 16, + }, + ], "scope": Object { - "$ref": 7, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 9, - }, - "variableMap": Object { - "message": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 8, - }, - "variables": Array [ - Object { - "$id": 0, - "defs": Array [ - Object { - "name": Object { - "name": "message", - "range": Array [ - 9, - 16, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 0, - 96, - ], - "type": "FunctionDeclaration", + "$ref": 18, }, - "parent": null, - "type": "FunctionName", }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "message", - "range": Array [ - 9, - 16, - ], - "type": "Identifier", - }, - ], - "name": "message", - "references": Array [], - "scope": Object { - "$ref": 8, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 9, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/global-this.src 1`] = ` -Object { - "$id": 7, - "block": Object { - "range": Array [ - 22, - 206, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 6, - "block": Object { - "range": Array [ - 22, - 206, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ - Object { - "$id": 2, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "abc", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 32, - 35, - ], - "type": "Literal", - }, - }, - Object { - "$id": 3, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "globalThis", - "range": Array [ - 69, - 79, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "answer", - "range": Array [ - 97, - 103, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 1, - }, - "writeExpr": Object { - "range": Array [ - 106, - 108, - ], - "type": "Literal", - }, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "globalThis", - "range": Array [ - 178, - 188, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, + "$id": 11, + "defs": Array [ + Object { + "name": Object { + "name": "is", + "range": Array [ + 101, + 103, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 101, + 107, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 95, + 108, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "is", + "range": Array [ + 101, + 103, + ], + "type": "Identifier", + }, + ], + "name": "is", + "references": Array [ + Object { + "$ref": 17, + }, + ], + "scope": Object { + "$ref": 18, + }, + }, + ], }, ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 7, + "$ref": 20, }, "variableMap": Object { - "abc": Object { + "async": Object { + "$ref": 4, + }, + "get": Object { "$ref": 0, }, - "answer": Object { + "is": Object { + "$ref": 5, + }, + "module": Object { + "$ref": 2, + }, + "set": Object { "$ref": 1, }, + "type": Object { + "$ref": 3, + }, }, "variableScope": Object { - "$ref": 6, + "$ref": 19, }, "variables": Array [ Object { @@ -17878,49 +20249,45 @@ Object { "defs": Array [ Object { "name": Object { - "name": "abc", + "name": "get", "range": Array [ - 26, - 29, + 123, + 126, ], "type": "Identifier", }, "node": Object { "range": Array [ - 26, - 35, + 123, + 126, ], - "type": "VariableDeclarator", + "type": "ImportSpecifier", }, "parent": Object { "range": Array [ - 22, - 36, + 112, + 189, ], - "type": "VariableDeclaration", + "type": "ImportDeclaration", }, - "type": "Variable", + "type": "ImportBinding", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "abc", + "name": "get", "range": Array [ - 26, - 29, + 123, + 126, ], "type": "Identifier", }, ], - "name": "abc", - "references": Array [ - Object { - "$ref": 2, - }, - ], + "name": "get", + "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 19, }, }, Object { @@ -17928,399 +20295,232 @@ Object { "defs": Array [ Object { "name": Object { - "name": "answer", + "name": "set", "range": Array [ - 97, - 103, + 130, + 133, ], "type": "Identifier", }, "node": Object { "range": Array [ - 97, - 108, + 130, + 133, ], - "type": "VariableDeclarator", + "type": "ImportSpecifier", }, "parent": Object { "range": Array [ - 93, - 109, + 112, + 189, ], - "type": "VariableDeclaration", + "type": "ImportDeclaration", }, - "type": "Variable", + "type": "ImportBinding", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "answer", + "name": "set", "range": Array [ - 97, - 103, + 130, + 133, ], "type": "Identifier", }, ], - "name": "answer", - "references": Array [ + "name": "set", + "references": Array [], + "scope": Object { + "$ref": 19, + }, + }, + Object { + "$id": 2, + "defs": Array [ Object { - "$ref": 4, + "name": Object { + "name": "module", + "range": Array [ + 137, + 143, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 137, + 143, + ], + "type": "ImportSpecifier", + }, + "parent": Object { + "range": Array [ + 112, + 189, + ], + "type": "ImportDeclaration", + }, + "type": "ImportBinding", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "module", + "range": Array [ + 137, + 143, + ], + "type": "Identifier", }, ], + "name": "module", + "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 19, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - Object { - "$ref": 5, - }, - ], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/import-equal-declaration.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 29, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ Object { - "$id": 0, + "$id": 3, "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "type", "range": Array [ - 7, - 10, + 147, + 151, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 28, + 147, + 151, ], - "type": "TSImportEqualsDeclaration", + "type": "ImportSpecifier", + }, + "parent": Object { + "range": Array [ + 112, + 189, + ], + "type": "ImportDeclaration", }, - "parent": null, "type": "ImportBinding", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "type", "range": Array [ - 7, - 10, + 147, + 151, ], "type": "Identifier", }, ], - "name": "foo", + "name": "type", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 19, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/import-export-equal-declaration.src 1`] = ` -Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 36, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 36, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "foo": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ Object { - "$id": 0, + "$id": 4, "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "async", "range": Array [ - 14, - 17, + 155, + 160, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 35, + 155, + 160, ], - "type": "TSImportEqualsDeclaration", + "type": "ImportSpecifier", + }, + "parent": Object { + "range": Array [ + 112, + 189, + ], + "type": "ImportDeclaration", }, - "parent": null, "type": "ImportBinding", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "async", "range": Array [ - 14, - 17, + 155, + 160, ], "type": "Identifier", }, ], - "name": "foo", + "name": "async", "references": Array [], "scope": Object { - "$ref": 1, + "$ref": 19, }, }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/import-type.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 56, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 56, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/import-type-with-type-parameters-in-type-reference.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/interface-extends.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 31, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], + Object { + "$id": 5, + "defs": Array [ + Object { + "name": Object { + "name": "is", + "range": Array [ + 164, + 166, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 164, + 166, + ], + "type": "ImportSpecifier", + }, + "parent": Object { + "range": Array [ + 112, + 189, + ], + "type": "ImportDeclaration", + }, + "type": "ImportBinding", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "is", + "range": Array [ + 164, + 166, + ], + "type": "Identifier", + }, + ], + "name": "is", + "references": Array [], + "scope": Object { + "$ref": 19, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -18331,29 +20531,29 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 20, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/interface-extends-multiple.src 1`] = ` +exports[`typescript fixtures/basics/nested-type-arguments.src 1`] = ` Object { - "$id": 1, + "$id": 2, "block": Object { "range": Array [ 0, - 35, + 44, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 1, "block": Object { "range": Array [ 0, - 35, + 44, ], "type": "Program", }, @@ -18364,63 +20564,64 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/interface-type-parameters.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 22, - ], - "type": "Program", + "$ref": 2, }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, + "variableMap": Object { + "nestedArray": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 1, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "nestedArray", + "range": Array [ + 4, + 44, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 44, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 44, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "nestedArray", + "range": Array [ + 4, + 44, + ], + "type": "Identifier", + }, + ], + "name": "nestedArray", + "references": Array [], + "scope": Object { + "$ref": 1, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -18431,29 +20632,29 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 2, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/interface-with-all-property-types.src 1`] = ` +exports[`typescript fixtures/basics/never-type-param.src 1`] = ` Object { - "$id": 4, + "$id": 3, "block": Object { "range": Array [ 0, - 297, + 46, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 2, "block": Object { "range": Array [ 0, - 297, + 46, ], "type": "Program", }, @@ -18462,15 +20663,15 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 0, + "$id": 1, "from": Object { - "$ref": 3, + "$ref": 2, }, "identifier": Object { - "name": "bax", + "name": "Observable", "range": Array [ - 56, - 59, + 19, + 29, ], "type": "Identifier", }, @@ -18478,254 +20679,441 @@ Object { "resolved": null, "writeExpr": undefined, }, + ], + "throughReferences": Array [ Object { - "$id": 1, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "baz", - "range": Array [ - 75, - 78, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, + "$ref": 1, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object { + "x": Object { + "$ref": 0, }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ Object { - "$id": 2, - "from": Object { - "$ref": 3, - }, - "identifier": Object { - "name": "loo", - "range": Array [ - 192, - 195, - ], - "type": "Identifier", + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 6, + 17, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 6, + 17, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 18, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 6, + 17, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 2, }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 0, - }, - Object { - "$ref": 1, - }, - Object { - "$ref": 2, }, ], - "type": "module", - "upperScope": Object { - "$ref": 4, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], "throughReferences": Array [ - Object { - "$ref": 0, - }, Object { "$ref": 1, }, - Object { - "$ref": 2, - }, ], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 4, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/interface-with-construct-signature-with-parameter-accessibility.src 1`] = ` +exports[`typescript fixtures/basics/non-null-assertion-operator.src 1`] = ` Object { - "$id": 1, + "$id": 10, "block": Object { "range": Array [ 0, - 50, + 82, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 9, "block": Object { "range": Array [ 0, - 50, + 82, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 8, + "block": Object { + "range": Array [ + 0, + 82, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "validateEntity", + "range": Array [ + 41, + 55, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "e", + "range": Array [ + 56, + 57, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "s", + "range": Array [ + 68, + 69, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": Object { + "range": Array [ + 72, + 79, + ], + "type": "MemberExpression", + }, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 8, + }, + "identifier": Object { + "name": "e", + "range": Array [ + 72, + 73, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], + "type": "function", + "upperScope": Object { + "$ref": 9, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "e": Object { + "$ref": 2, + }, + "s": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 8, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "e", + "range": Array [ + 23, + 33, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 82, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "e", + "range": Array [ + 23, + 33, + ], + "type": "Identifier", + }, + ], + "name": "e", + "references": Array [ + Object { + "$ref": 5, + }, + Object { + "$ref": 7, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "s", + "range": Array [ + 68, + 69, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 68, + 79, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 64, + 80, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "s", + "range": Array [ + 68, + 69, + ], + "type": "Identifier", + }, + ], + "name": "s", + "references": Array [ + Object { + "$ref": 6, + }, + ], + "scope": Object { + "$ref": 8, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 4, + }, + ], "type": "module", "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/interface-with-extends-member-expression.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 34, - ], - "type": "Program", + "$ref": 10, }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, + "variableMap": Object { + "processEntity": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 9, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "processEntity", + "range": Array [ + 9, + 22, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 82, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "processEntity", + "range": Array [ + 9, + 22, + ], + "type": "Identifier", + }, + ], + "name": "processEntity", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + ], }, ], "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/interface-with-extends-type-parameters.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [ + "throughReferences": Array [ Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 37, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], + "$ref": 4, }, ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 10, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/interface-with-generic.src 1`] = ` +exports[`typescript fixtures/basics/null-and-undefined-type-annotations.src 1`] = ` Object { - "$id": 1, + "$id": 3, "block": Object { "range": Array [ 0, - 22, + 30, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 2, "block": Object { "range": Array [ 0, - 22, + 30, ], "type": "Program", }, @@ -18736,63 +21124,113 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/interface-with-jsdoc.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 88, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 88, - ], - "type": "Program", + "$ref": 3, }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, + "variableMap": Object { + "x": Object { + "$ref": 0, + }, + "y": Object { + "$ref": 1, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 2, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 4, + 11, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 4, + 11, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 12, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 4, + 11, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "y", + "range": Array [ + 17, + 29, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 17, + 29, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 13, + 30, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "y", + "range": Array [ + 17, + 29, + ], + "type": "Identifier", + }, + ], + "name": "y", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -18803,46 +21241,277 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 3, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/interface-with-method.src 1`] = ` +exports[`typescript fixtures/basics/nullish-coalescing.src 1`] = ` Object { - "$id": 1, + "$id": 8, "block": Object { "range": Array [ 0, - 62, + 71, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 7, "block": Object { "range": Array [ 0, - 62, + 71, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 70, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 4, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "len", + "range": Array [ + 52, + 55, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 3, + }, + "writeExpr": Object { + "range": Array [ + 59, + 66, + ], + "type": "LogicalExpression", + }, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "s", + "range": Array [ + 59, + 60, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 7, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "len": Object { + "$ref": 3, + }, + "s": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "s", + "range": Array [ + 32, + 42, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 70, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "s", + "range": Array [ + 32, + 42, + ], + "type": "Identifier", + }, + ], + "name": "s", + "references": Array [ + Object { + "$ref": 5, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "len", + "range": Array [ + 52, + 55, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 52, + 67, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 48, + 68, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "len", + "range": Array [ + 52, + 55, + ], + "type": "Identifier", + }, + ], + "name": "len", + "references": Array [ + Object { + "$ref": 4, + }, + ], + "scope": Object { + "$ref": 6, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 1, + "$ref": 8, + }, + "variableMap": Object { + "processNullishCoalesce": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 7, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "processNullishCoalesce", + "range": Array [ + 9, + 31, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 70, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "processNullishCoalesce", + "range": Array [ + 9, + 31, + ], + "type": "Identifier", + }, + ], + "name": "processNullishCoalesce", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -18853,15 +21522,15 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 8, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/interface-with-optional-properties.src 1`] = ` +exports[`typescript fixtures/basics/object-with-escaped-properties.src 1`] = ` Object { - "$id": 1, + "$id": 6, "block": Object { "range": Array [ 0, @@ -18871,7 +21540,7 @@ Object { }, "childScopes": Array [ Object { - "$id": 0, + "$id": 5, "block": Object { "range": Array [ 0, @@ -18879,70 +21548,175 @@ Object { ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 26, + 31, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 2, + }, + }, + ], + }, + Object { + "$id": 4, + "block": Object { + "range": Array [ + 58, + 81, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "X": Object { + "$ref": 3, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 3, + "defs": Array [ + Object { + "name": Object { + "name": "X", + "range": Array [ + 64, + 65, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 58, + 81, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "X", + "range": Array [ + 64, + 65, + ], + "type": "Identifier", + }, + ], + "name": "X", + "references": Array [], + "scope": Object { + "$ref": 4, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/interface-without-type-annotation.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 0, - 28, - ], - "type": "Program", + "$ref": 6, }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, + "variableMap": Object { + "X": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 5, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "X", + "range": Array [ + 64, + 65, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 58, + 81, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "X", + "range": Array [ + 64, + 65, + ], + "type": "Identifier", + }, + ], + "name": "X", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -18953,46 +21727,331 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 6, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/keyof-operator.src 1`] = ` +exports[`typescript fixtures/basics/object-with-typed-methods.src 1`] = ` Object { - "$id": 1, + "$id": 12, "block": Object { "range": Array [ 0, - 20, + 176, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 11, "block": Object { "range": Array [ 0, - 20, + 176, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 29, + 61, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 11, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + Object { + "$id": 5, + "block": Object { + "range": Array [ + 68, + 100, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 11, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 4, + }, + }, + "variableScope": Object { + "$ref": 5, + }, + "variables": Array [ + Object { + "$id": 4, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + Object { + "$id": 7, + "block": Object { + "range": Array [ + 109, + 138, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 11, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 6, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 6, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + ], + }, + Object { + "$id": 10, + "block": Object { + "range": Array [ + 147, + 172, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 11, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 8, + }, + "x": Object { + "$ref": 9, + }, + }, + "variableScope": Object { + "$ref": 10, + }, + "variables": Array [ + Object { + "$id": 8, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 10, + }, + }, + Object { + "$id": 9, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 148, + 157, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 147, + 172, + ], + "type": "FunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 148, + 157, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 10, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 11, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 12, + 174, + ], + "type": "ObjectExpression", + }, + }, + ], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 1, + "$ref": 12, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 11, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 6, + 174, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 175, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + ], + "name": "foo", + "references": Array [ + Object { + "$ref": 1, + }, + ], + "scope": Object { + "$ref": 11, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -19003,524 +22062,603 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 12, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/keyword-variables.src 1`] = ` +exports[`typescript fixtures/basics/optional-chain.src 1`] = ` Object { - "$id": 20, + "$id": 10, "block": Object { "range": Array [ 0, - 190, + 135, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 19, + "$id": 9, "block": Object { "range": Array [ 0, - 190, + 135, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 18, + "$id": 8, "block": Object { "range": Array [ 0, - 110, + 134, ], - "type": "BlockStatement", + "type": "FunctionDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, "references": Array [ Object { - "$id": 12, + "$id": 3, "from": Object { - "$ref": 18, + "$ref": 8, }, "identifier": Object { - "name": "get", + "name": "one", "range": Array [ - 10, - 13, + 40, + 43, ], "type": "Identifier", }, - "kind": "w", + "kind": "r", "resolved": Object { - "$ref": 6, - }, - "writeExpr": Object { - "range": Array [ - 16, - 17, - ], - "type": "Literal", + "$ref": 2, }, + "writeExpr": undefined, }, Object { - "$id": 13, + "$id": 4, "from": Object { - "$ref": 18, + "$ref": 8, }, "identifier": Object { - "name": "set", + "name": "one", "range": Array [ - 27, - 30, + 52, + 55, ], "type": "Identifier", }, - "kind": "w", + "kind": "r", "resolved": Object { - "$ref": 7, - }, - "writeExpr": Object { - "range": Array [ - 33, - 34, - ], - "type": "Literal", + "$ref": 2, }, + "writeExpr": undefined, }, Object { - "$id": 14, + "$id": 5, "from": Object { - "$ref": 18, - }, - "identifier": Object { - "name": "module", - "range": Array [ - 44, - 50, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { "$ref": 8, }, - "writeExpr": Object { - "range": Array [ - 53, - 54, - ], - "type": "Literal", - }, - }, - Object { - "$id": 15, - "from": Object { - "$ref": 18, - }, "identifier": Object { - "name": "type", + "name": "one", "range": Array [ - 64, - 68, + 70, + 73, ], "type": "Identifier", }, - "kind": "w", + "kind": "r", "resolved": Object { - "$ref": 9, - }, - "writeExpr": Object { - "range": Array [ - 71, - 72, - ], - "type": "Literal", + "$ref": 2, }, + "writeExpr": undefined, }, Object { - "$id": 16, + "$id": 6, "from": Object { - "$ref": 18, + "$ref": 8, }, "identifier": Object { - "name": "async", + "name": "one", "range": Array [ - 82, - 87, + 88, + 91, ], "type": "Identifier", }, - "kind": "w", + "kind": "r", "resolved": Object { - "$ref": 10, - }, - "writeExpr": Object { - "range": Array [ - 90, - 91, - ], - "type": "Literal", + "$ref": 2, }, + "writeExpr": undefined, }, Object { - "$id": 17, + "$id": 7, "from": Object { - "$ref": 18, + "$ref": 8, }, "identifier": Object { - "name": "is", + "name": "one", "range": Array [ - 101, - 103, + 111, + 114, ], "type": "Identifier", }, - "kind": "w", + "kind": "r", "resolved": Object { - "$ref": 11, - }, - "writeExpr": Object { - "range": Array [ - 106, - 107, - ], - "type": "Literal", + "$ref": 2, }, + "writeExpr": undefined, }, ], "throughReferences": Array [], - "type": "block", + "type": "function", "upperScope": Object { - "$ref": 19, + "$ref": 9, }, "variableMap": Object { - "async": Object { - "$ref": 10, - }, - "get": Object { - "$ref": 6, - }, - "is": Object { - "$ref": 11, - }, - "module": Object { - "$ref": 8, - }, - "set": Object { - "$ref": 7, + "arguments": Object { + "$ref": 1, }, - "type": Object { - "$ref": 9, + "one": Object { + "$ref": 2, }, }, "variableScope": Object { - "$ref": 19, + "$ref": 8, }, "variables": Array [ Object { - "$id": 6, + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 8, + }, + }, + Object { + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "get", + "name": "one", "range": Array [ - 10, - 13, + 25, + 34, ], "type": "Identifier", }, "node": Object { "range": Array [ - 10, - 17, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 4, - 18, + 0, + 134, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "Parameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "get", + "name": "one", "range": Array [ - 10, - 13, + 25, + 34, ], "type": "Identifier", }, ], - "name": "get", + "name": "one", "references": Array [ Object { - "$ref": 12, + "$ref": 3, }, - ], - "scope": Object { - "$ref": 18, - }, - }, - Object { - "$id": 7, - "defs": Array [ Object { - "name": Object { - "name": "set", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 27, - 34, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 21, - 35, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", + "$ref": 4, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "set", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", + "$ref": 5, }, - ], - "name": "set", - "references": Array [ Object { - "$ref": 13, + "$ref": 6, + }, + Object { + "$ref": 7, }, ], "scope": Object { - "$ref": 18, + "$ref": 8, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 10, + }, + "variableMap": Object { + "processOptional": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "processOptional", + "range": Array [ + 9, + 24, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 134, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "processOptional", + "range": Array [ + 9, + 24, + ], + "type": "Identifier", + }, + ], + "name": "processOptional", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 10, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/optional-chain-call.src 1`] = ` +Object { + "$id": 14, + "block": Object { + "range": Array [ + 0, + 194, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 13, + "block": Object { + "range": Array [ + 0, + 194, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 12, + "block": Object { + "range": Array [ + 0, + 193, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 44, + 47, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 57, + 60, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 74, + 77, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 91, + 94, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 114, + 117, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, }, + "writeExpr": undefined, }, Object { "$id": 8, - "defs": Array [ - Object { - "name": Object { - "name": "module", - "range": Array [ - 44, - 50, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 44, - 54, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 38, - 55, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "module", - "range": Array [ - 44, - 50, - ], - "type": "Identifier", - }, - ], - "name": "module", - "references": Array [ - Object { - "$ref": 14, - }, - ], - "scope": Object { - "$ref": 18, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 139, + 142, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, }, + "writeExpr": undefined, }, Object { "$id": 9, - "defs": Array [ - Object { - "name": Object { - "name": "type", - "range": Array [ - 64, - 68, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 64, - 72, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 58, - 73, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "type", - "range": Array [ - 64, - 68, - ], - "type": "Identifier", - }, - ], - "name": "type", - "references": Array [ - Object { - "$ref": 15, - }, - ], - "scope": Object { - "$ref": 18, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 150, + 153, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, }, + "writeExpr": undefined, }, Object { "$id": 10, - "defs": Array [ - Object { - "name": Object { - "name": "async", - "range": Array [ - 82, - 87, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 82, - 91, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 76, - 92, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", - }, - ], + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 163, + 166, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 179, + 182, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "one": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "async", - "range": Array [ - 82, - 87, - ], - "type": "Identifier", - }, - ], - "name": "async", - "references": Array [ - Object { - "$ref": 16, - }, - ], + "identifiers": Array [], + "name": "arguments", + "references": Array [], "scope": Object { - "$ref": 18, + "$ref": 12, }, }, Object { - "$id": 11, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "is", + "name": "one", "range": Array [ - 101, - 103, + 29, + 38, ], "type": "Identifier", }, "node": Object { "range": Array [ - 101, - 107, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 95, - 108, + 0, + 193, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "Parameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "is", + "name": "one", "range": Array [ - 101, - 103, + 29, + 38, ], "type": "Identifier", }, ], - "name": "is", + "name": "one", "references": Array [ Object { - "$ref": 17, + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, }, ], "scope": Object { - "$ref": 18, + "$ref": 12, }, }, ], @@ -19532,30 +22670,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 20, + "$ref": 14, }, "variableMap": Object { - "async": Object { - "$ref": 4, - }, - "get": Object { + "processOptionalCall": Object { "$ref": 0, }, - "is": Object { - "$ref": 5, - }, - "module": Object { - "$ref": 2, - }, - "set": Object { - "$ref": 1, - }, - "type": Object { - "$ref": 3, - }, }, "variableScope": Object { - "$ref": 19, + "$ref": 13, }, "variables": Array [ Object { @@ -19563,275 +22686,418 @@ Object { "defs": Array [ Object { "name": Object { - "name": "get", + "name": "processOptionalCall", "range": Array [ - 123, - 126, + 9, + 28, ], "type": "Identifier", }, "node": Object { "range": Array [ - 123, - 126, - ], - "type": "ImportSpecifier", - }, - "parent": Object { - "range": Array [ - 112, - 189, + 0, + 193, ], - "type": "ImportDeclaration", + "type": "FunctionDeclaration", }, - "type": "ImportBinding", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "get", + "name": "processOptionalCall", "range": Array [ - 123, - 126, + 9, + 28, ], "type": "Identifier", }, ], - "name": "get", + "name": "processOptionalCall", "references": Array [], "scope": Object { - "$ref": 19, + "$ref": 13, }, }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 14, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/optional-chain-call-with-parens.src 1`] = ` +Object { + "$id": 14, + "block": Object { + "range": Array [ + 0, + 218, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 13, + "block": Object { + "range": Array [ + 0, + 218, + ], + "type": "Program", + }, + "childScopes": Array [ Object { - "$id": 1, - "defs": Array [ + "$id": 12, + "block": Object { + "range": Array [ + 0, + 217, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { - "name": "set", - "range": Array [ - 130, - 133, - ], - "type": "Identifier", + "$id": 3, + "from": Object { + "$ref": 12, }, - "node": Object { + "identifier": Object { + "name": "one", "range": Array [ - 130, - 133, + 51, + 54, ], - "type": "ImportSpecifier", + "type": "Identifier", }, - "parent": Object { - "range": Array [ - 112, - 189, - ], - "type": "ImportDeclaration", + "kind": "r", + "resolved": Object { + "$ref": 2, }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "set", - "range": Array [ - 130, - 133, - ], - "type": "Identifier", + "writeExpr": undefined, }, - ], - "name": "set", - "references": Array [], - "scope": Object { - "$ref": 19, - }, - }, - Object { - "$id": 2, - "defs": Array [ Object { - "name": Object { - "name": "module", - "range": Array [ - 137, - 143, - ], - "type": "Identifier", + "$id": 4, + "from": Object { + "$ref": 12, }, - "node": Object { + "identifier": Object { + "name": "one", "range": Array [ - 137, - 143, + 66, + 69, ], - "type": "ImportSpecifier", + "type": "Identifier", }, - "parent": Object { - "range": Array [ - 112, - 189, - ], - "type": "ImportDeclaration", + "kind": "r", + "resolved": Object { + "$ref": 2, }, - "type": "ImportBinding", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "module", - "range": Array [ - 137, - 143, - ], - "type": "Identifier", + "writeExpr": undefined, }, - ], - "name": "module", - "references": Array [], - "scope": Object { - "$ref": 19, - }, - }, - Object { - "$id": 3, - "defs": Array [ Object { - "name": Object { - "name": "type", - "range": Array [ - 147, - 151, + "$id": 5, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 85, + 88, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", "range": Array [ - 147, - 151, + 104, + 107, ], - "type": "ImportSpecifier", + "type": "Identifier", }, - "parent": Object { + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", "range": Array [ - 112, - 189, + 129, + 132, ], - "type": "ImportDeclaration", + "type": "Identifier", }, - "type": "ImportBinding", + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "type", - "range": Array [ - 147, - 151, - ], - "type": "Identifier", + "$id": 8, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 156, + 159, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, }, - ], - "name": "type", - "references": Array [], - "scope": Object { - "$ref": 19, - }, - }, - Object { - "$id": 4, - "defs": Array [ Object { - "name": Object { - "name": "async", + "$id": 9, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", "range": Array [ - 155, - 160, + 169, + 172, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 10, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", "range": Array [ - 155, - 160, + 184, + 187, ], - "type": "ImportSpecifier", + "type": "Identifier", }, - "parent": Object { + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 11, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "one", "range": Array [ - 112, - 189, + 202, + 205, ], - "type": "ImportDeclaration", + "type": "Identifier", }, - "type": "ImportBinding", + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 13, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "one": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 12, + }, + "variables": Array [ Object { - "name": "async", - "range": Array [ - 155, - 160, + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 12, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "one", + "range": Array [ + 35, + 44, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 217, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, ], - "type": "Identifier", + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "one", + "range": Array [ + 35, + 44, + ], + "type": "Identifier", + }, + ], + "name": "one", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + Object { + "$ref": 10, + }, + Object { + "$ref": 11, + }, + ], + "scope": Object { + "$ref": 12, + }, }, ], - "name": "async", - "references": Array [], - "scope": Object { - "$ref": 19, - }, }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 14, + }, + "variableMap": Object { + "processOptionalCallParens": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 13, + }, + "variables": Array [ Object { - "$id": 5, + "$id": 0, "defs": Array [ Object { "name": Object { - "name": "is", - "range": Array [ - 164, - 166, - ], - "type": "Identifier", - }, - "node": Object { + "name": "processOptionalCallParens", "range": Array [ - 164, - 166, + 9, + 34, ], - "type": "ImportSpecifier", + "type": "Identifier", }, - "parent": Object { + "node": Object { "range": Array [ - 112, - 189, + 0, + 217, ], - "type": "ImportDeclaration", + "type": "FunctionDeclaration", }, - "type": "ImportBinding", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "is", + "name": "processOptionalCallParens", "range": Array [ - 164, - 166, + 9, + 34, ], "type": "Identifier", }, ], - "name": "is", + "name": "processOptionalCallParens", "references": Array [], "scope": Object { - "$ref": 19, + "$ref": 13, }, }, ], @@ -19845,171 +23111,266 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 20, + "$ref": 14, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/nested-type-arguments.src 1`] = ` +exports[`typescript fixtures/basics/optional-chain-element-access.src 1`] = ` Object { - "$id": 2, + "$id": 11, "block": Object { "range": Array [ 0, - 44, + 142, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 1, + "$id": 10, "block": Object { "range": Array [ 0, - 44, + 142, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 2, - }, - "variableMap": Object { - "nestedArray": Object { - "$ref": 0, - }, - }, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [ + "childScopes": Array [ Object { - "$id": 0, - "defs": Array [ + "$id": 9, + "block": Object { + "range": Array [ + 0, + 141, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { - "name": "nestedArray", + "$id": 3, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", "range": Array [ - 4, - 44, + 47, + 50, ], "type": "Identifier", }, - "node": Object { + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", "range": Array [ - 4, - 44, + 59, + 62, ], - "type": "VariableDeclarator", + "type": "Identifier", }, - "parent": Object { + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 5, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", "range": Array [ - 0, - 44, + 74, + 77, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 89, + 92, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 104, + 107, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 122, + 125, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, }, ], - "eslintUsed": undefined, - "identifiers": Array [ + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 10, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "one": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 9, + }, + "variables": Array [ Object { - "name": "nestedArray", - "range": Array [ - 4, - 44, + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 9, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "one", + "range": Array [ + 32, + 41, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 141, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, ], - "type": "Identifier", + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "one", + "range": Array [ + 32, + 41, + ], + "type": "Identifier", + }, + ], + "name": "one", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + ], + "scope": Object { + "$ref": 9, + }, }, ], - "name": "nestedArray", - "references": Array [], - "scope": Object { - "$ref": 1, - }, }, ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/never-type-param.src 1`] = ` -Object { - "$id": 3, - "block": Object { - "range": Array [ - 0, - 46, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 0, - 46, - ], - "type": "Program", - }, - "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "Observable", - "range": Array [ - 19, - 29, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 11, }, "variableMap": Object { - "x": Object { + "processOptionalElement": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 10, }, "variables": Array [ Object { @@ -20017,45 +23378,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "x", + "name": "processOptionalElement", "range": Array [ - 6, - 17, + 9, + 31, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 6, - 17, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 18, + 141, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "processOptionalElement", "range": Array [ - 6, - 17, + 9, + 31, ], "type": "Identifier", }, ], - "name": "x", + "name": "processOptionalElement", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 10, }, }, ], @@ -20064,48 +23419,44 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 1, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 11, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/non-null-assertion-operator.src 1`] = ` +exports[`typescript fixtures/basics/optional-chain-element-access-with-parens.src 1`] = ` Object { - "$id": 10, + "$id": 11, "block": Object { "range": Array [ 0, - 82, + 168, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 9, + "$id": 10, "block": Object { "range": Array [ 0, - 82, + 168, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 8, + "$id": 9, "block": Object { "range": Array [ 0, - 82, + 167, ], "type": "FunctionDeclaration", }, @@ -20114,32 +23465,34 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 4, + "$id": 3, "from": Object { - "$ref": 8, + "$ref": 9, }, "identifier": Object { - "name": "validateEntity", + "name": "one", "range": Array [ - 41, - 55, + 54, + 57, ], "type": "Identifier", }, "kind": "r", - "resolved": null, + "resolved": Object { + "$ref": 2, + }, "writeExpr": undefined, }, Object { - "$id": 5, + "$id": 4, "from": Object { - "$ref": 8, + "$ref": 9, }, "identifier": Object { - "name": "e", + "name": "one", "range": Array [ - 56, - 57, + 68, + 71, ], "type": "Identifier", }, @@ -20150,40 +23503,53 @@ Object { "writeExpr": undefined, }, Object { - "$id": 6, + "$id": 5, "from": Object { - "$ref": 8, + "$ref": 9, }, "identifier": Object { - "name": "s", + "name": "one", "range": Array [ - 68, - 69, + 85, + 88, ], "type": "Identifier", }, - "kind": "w", + "kind": "r", "resolved": Object { - "$ref": 3, + "$ref": 2, }, - "writeExpr": Object { + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", "range": Array [ - 72, - 79, + 102, + 105, ], - "type": "MemberExpression", + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, }, + "writeExpr": undefined, }, Object { "$id": 7, "from": Object { - "$ref": 8, + "$ref": 9, }, "identifier": Object { - "name": "e", + "name": "one", "range": Array [ - 72, - 73, + 122, + 125, ], "type": "Identifier", }, @@ -20193,29 +23559,41 @@ Object { }, "writeExpr": undefined, }, - ], - "throughReferences": Array [ Object { - "$ref": 4, + "$id": 8, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 144, + 147, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, }, ], + "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 9, + "$ref": 10, }, "variableMap": Object { "arguments": Object { "$ref": 1, }, - "e": Object { + "one": Object { "$ref": 2, }, - "s": Object { - "$ref": 3, - }, }, "variableScope": Object { - "$ref": 8, + "$ref": 9, }, "variables": Array [ Object { @@ -20226,7 +23604,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 8, + "$ref": 9, }, }, Object { @@ -20234,17 +23612,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "e", + "name": "one", "range": Array [ - 23, - 33, + 38, + 47, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 82, + 167, ], "type": "FunctionDeclaration", }, @@ -20255,75 +23633,37 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "e", + "name": "one", "range": Array [ - 23, - 33, + 38, + 47, ], "type": "Identifier", }, ], - "name": "e", + "name": "one", "references": Array [ Object { - "$ref": 5, + "$ref": 3, }, Object { - "$ref": 7, + "$ref": 4, }, - ], - "scope": Object { - "$ref": 8, - }, - }, - Object { - "$id": 3, - "defs": Array [ Object { - "name": Object { - "name": "s", - "range": Array [ - 68, - 69, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 68, - 79, - ], - "type": "VariableDeclarator", - }, - "parent": Object { - "range": Array [ - 64, - 80, - ], - "type": "VariableDeclaration", - }, - "type": "Variable", + "$ref": 5, + }, + Object { + "$ref": 6, }, - ], - "eslintUsed": undefined, - "identifiers": Array [ Object { - "name": "s", - "range": Array [ - 68, - 69, - ], - "type": "Identifier", + "$ref": 7, }, - ], - "name": "s", - "references": Array [ Object { - "$ref": 6, + "$ref": 8, }, ], "scope": Object { - "$ref": 8, + "$ref": 9, }, }, ], @@ -20332,22 +23672,18 @@ Object { "functionExpressionScope": false, "isStrict": true, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 10, + "$ref": 11, }, "variableMap": Object { - "processEntity": Object { + "processOptionalElementParens": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 9, + "$ref": 10, }, "variables": Array [ Object { @@ -20355,17 +23691,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "processEntity", + "name": "processOptionalElementParens", "range": Array [ 9, - 22, + 37, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 82, + 167, ], "type": "FunctionDeclaration", }, @@ -20376,18 +23712,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "processEntity", + "name": "processOptionalElementParens", "range": Array [ 9, - 22, + 37, ], "type": "Identifier", }, ], - "name": "processEntity", + "name": "processOptionalElementParens", "references": Array [], "scope": Object { - "$ref": 9, + "$ref": 10, }, }, ], @@ -20396,217 +23732,181 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 4, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 10, + "$ref": 11, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/null-and-undefined-type-annotations.src 1`] = ` +exports[`typescript fixtures/basics/optional-chain-with-parens.src 1`] = ` Object { - "$id": 3, + "$id": 11, "block": Object { "range": Array [ 0, - 30, + 182, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 10, "block": Object { "range": Array [ 0, - 30, + 182, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 3, - }, - "variableMap": Object { - "x": Object { - "$ref": 0, - }, - "y": Object { - "$ref": 1, - }, - }, - "variableScope": Object { - "$ref": 2, - }, - "variables": Array [ + "childScopes": Array [ Object { - "$id": 0, - "defs": Array [ + "$id": 9, + "block": Object { + "range": Array [ + 0, + 181, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ Object { - "name": Object { - "name": "x", + "$id": 3, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", "range": Array [ - 4, - 11, + 47, + 50, ], "type": "Identifier", }, - "node": Object { - "range": Array [ - 4, - 11, - ], - "type": "VariableDeclarator", + "kind": "r", + "resolved": Object { + "$ref": 2, }, - "parent": Object { + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", "range": Array [ - 0, - 12, + 61, + 64, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "x", - "range": Array [ - 4, - 11, - ], - "type": "Identifier", + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, }, - ], - "name": "x", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - Object { - "$id": 1, - "defs": Array [ Object { - "name": Object { - "name": "y", + "$id": 5, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", "range": Array [ - 17, - 29, + 81, + 84, ], "type": "Identifier", }, - "node": Object { - "range": Array [ - 17, - 29, - ], - "type": "VariableDeclarator", + "kind": "r", + "resolved": Object { + "$ref": 2, }, - "parent": Object { + "writeExpr": undefined, + }, + Object { + "$id": 6, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", "range": Array [ - 13, - 30, + 101, + 104, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", - }, - ], - "eslintUsed": undefined, - "identifiers": Array [ - Object { - "name": "y", - "range": Array [ - 17, - 29, - ], - "type": "Identifier", - }, - ], - "name": "y", - "references": Array [], - "scope": Object { - "$ref": 2, - }, - }, - ], - }, - ], - "functionExpressionScope": false, - "isStrict": false, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/object-with-escaped-properties.src 1`] = ` -Object { - "$id": 6, - "block": Object { - "range": Array [ - 0, - 82, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 5, - "block": Object { - "range": Array [ - 0, - 82, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 2, - "block": Object { - "range": Array [ - 26, - 31, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 7, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 126, + 129, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + Object { + "$id": 8, + "from": Object { + "$ref": 9, + }, + "identifier": Object { + "name": "one", + "range": Array [ + 152, + 155, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, + }, + ], "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 5, + "$ref": 10, }, "variableMap": Object { "arguments": Object { "$ref": 1, }, + "one": Object { + "$ref": 2, + }, }, "variableScope": Object { - "$ref": 2, + "$ref": 9, }, "variables": Array [ Object { @@ -20617,76 +23917,66 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 9, }, }, - ], - }, - Object { - "$id": 4, - "block": Object { - "range": Array [ - 58, - 81, - ], - "type": "ClassDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "class", - "upperScope": Object { - "$ref": 5, - }, - "variableMap": Object { - "X": Object { - "$ref": 3, - }, - }, - "variableScope": Object { - "$ref": 5, - }, - "variables": Array [ Object { - "$id": 3, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "X", + "name": "one", "range": Array [ - 64, - 65, + 31, + 40, ], "type": "Identifier", }, "node": Object { "range": Array [ - 58, - 81, + 0, + 181, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, - "parent": undefined, - "type": "ClassName", + "parent": null, + "type": "Parameter", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "X", + "name": "one", "range": Array [ - 64, - 65, + 31, + 40, ], "type": "Identifier", }, ], - "name": "X", - "references": Array [], + "name": "one", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + Object { + "$ref": 5, + }, + Object { + "$ref": 6, + }, + Object { + "$ref": 7, + }, + Object { + "$ref": 8, + }, + ], "scope": Object { - "$ref": 4, + "$ref": 9, }, }, ], @@ -20698,15 +23988,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 11, }, "variableMap": Object { - "X": Object { + "processOptionalParens": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 10, }, "variables": Array [ Object { @@ -20714,39 +24004,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "X", + "name": "processOptionalParens", "range": Array [ - 64, - 65, + 9, + 30, ], "type": "Identifier", }, "node": Object { "range": Array [ - 58, - 81, + 0, + 181, ], - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, "parent": null, - "type": "ClassName", + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "X", + "name": "processOptionalParens", "range": Array [ - 64, - 65, + 9, + 30, ], "type": "Identifier", }, ], - "name": "X", + "name": "processOptionalParens", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 10, }, }, ], @@ -20760,19 +24050,69 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 11, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/object-with-typed-methods.src 1`] = ` +exports[`typescript fixtures/basics/parenthesized-use-strict.src 1`] = ` +Object { + "$id": 1, + "block": Object { + "range": Array [ + 45, + 60, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 0, + "block": Object { + "range": Array [ + 45, + 60, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 1, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 0, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/readonly-arrays.src 1`] = ` Object { "$id": 12, "block": Object { "range": Array [ 0, - 176, + 211, ], "type": "Program", }, @@ -20782,64 +24122,63 @@ Object { "block": Object { "range": Array [ 0, - 176, + 211, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ - 29, - 61, + 0, + 106, ], - "type": "FunctionExpression", + "type": "FunctionDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 2, + "references": Array [ + Object { + "$id": 3, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "arr", + "range": Array [ + 45, + 48, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, + }, + "writeExpr": undefined, }, - }, - "variableScope": Object { - "$ref": 3, - }, - "variables": Array [ Object { - "$id": 2, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 3, + "$id": 4, + "from": Object { + "$ref": 5, + }, + "identifier": Object { + "name": "arr", + "range": Array [ + 75, + 78, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 2, }, + "writeExpr": undefined, }, ], - }, - Object { - "$id": 5, - "block": Object { - "range": Array [ - 68, - 100, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], "throughReferences": Array [], "type": "function", "upperScope": Object { @@ -20847,7 +24186,10 @@ Object { }, "variableMap": Object { "arguments": Object { - "$ref": 4, + "$ref": 1, + }, + "arr": Object { + "$ref": 2, }, }, "variableScope": Object { @@ -20855,7 +24197,7 @@ Object { }, "variables": Array [ Object { - "$id": 4, + "$id": 1, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], @@ -20865,44 +24207,51 @@ Object { "$ref": 5, }, }, - ], - }, - Object { - "$id": 7, - "block": Object { - "range": Array [ - 109, - 138, - ], - "type": "FunctionExpression", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "function", - "upperScope": Object { - "$ref": 11, - }, - "variableMap": Object { - "arguments": Object { - "$ref": 6, - }, - }, - "variableScope": Object { - "$ref": 7, - }, - "variables": Array [ Object { - "$id": 6, - "defs": Array [], + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "arr", + "range": Array [ + 13, + 39, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 106, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], + "identifiers": Array [ + Object { + "name": "arr", + "range": Array [ + 13, + 39, + ], + "type": "Identifier", + }, + ], + "name": "arr", + "references": Array [ + Object { + "$ref": 3, + }, + Object { + "$ref": 4, + }, + ], "scope": Object { - "$ref": 7, + "$ref": 5, }, }, ], @@ -20911,15 +24260,54 @@ Object { "$id": 10, "block": Object { "range": Array [ - 147, - 172, + 108, + 210, ], - "type": "FunctionExpression", + "type": "FunctionDeclaration", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 8, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "arr", + "range": Array [ + 149, + 152, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 7, + }, + "writeExpr": undefined, + }, + Object { + "$id": 9, + "from": Object { + "$ref": 10, + }, + "identifier": Object { + "name": "arr", + "range": Array [ + 179, + 182, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": Object { + "$ref": 7, + }, + "writeExpr": undefined, + }, + ], "throughReferences": Array [], "type": "function", "upperScope": Object { @@ -20927,10 +24315,10 @@ Object { }, "variableMap": Object { "arguments": Object { - "$ref": 8, + "$ref": 6, }, - "x": Object { - "$ref": 9, + "arr": Object { + "$ref": 7, }, }, "variableScope": Object { @@ -20938,7 +24326,7 @@ Object { }, "variables": Array [ Object { - "$id": 8, + "$id": 6, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], @@ -20949,23 +24337,23 @@ Object { }, }, Object { - "$id": 9, + "$id": 7, "defs": Array [ Object { "name": Object { - "name": "x", + "name": "arr", "range": Array [ - 148, - 157, + 121, + 143, ], "type": "Identifier", }, "node": Object { "range": Array [ - 147, - 172, + 108, + 210, ], - "type": "FunctionExpression", + "type": "FunctionDeclaration", }, "parent": null, "type": "Parameter", @@ -20974,16 +24362,23 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "x", + "name": "arr", "range": Array [ - 148, - 157, + 121, + 143, ], "type": "Identifier", }, ], - "name": "x", - "references": Array [], + "name": "arr", + "references": Array [ + Object { + "$ref": 8, + }, + Object { + "$ref": 9, + }, + ], "scope": Object { "$ref": 10, }, @@ -20993,33 +24388,7 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 11, - }, - "identifier": Object { - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 12, - 174, - ], - "type": "ObjectExpression", - }, - }, - ], + "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { @@ -21041,26 +24410,39 @@ Object { "name": Object { "name": "foo", "range": Array [ - 6, 9, + 12, ], "type": "Identifier", }, "node": Object { "range": Array [ - 6, - 174, + 0, + 106, ], - "type": "VariableDeclarator", + "type": "FunctionDeclaration", }, - "parent": Object { + "parent": null, + "type": "FunctionName", + }, + Object { + "name": Object { + "name": "foo", "range": Array [ - 0, - 175, + 117, + 120, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - "type": "Variable", + "node": Object { + "range": Array [ + 108, + 210, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, @@ -21068,18 +24450,22 @@ Object { Object { "name": "foo", "range": Array [ - 6, 9, + 12, ], "type": "Identifier", }, - ], - "name": "foo", - "references": Array [ Object { - "$ref": 1, + "name": "foo", + "range": Array [ + 117, + 120, + ], + "type": "Identifier", }, ], + "name": "foo", + "references": Array [], "scope": Object { "$ref": 11, }, @@ -21101,83 +24487,33 @@ Object { } `; -exports[`typescript fixtures/basics/parenthesized-use-strict.src 1`] = ` -Object { - "$id": 1, - "block": Object { - "range": Array [ - 45, - 60, - ], - "type": "Program", - }, - "childScopes": Array [ - Object { - "$id": 0, - "block": Object { - "range": Array [ - 45, - 60, - ], - "type": "Program", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "module", - "upperScope": Object { - "$ref": 1, - }, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 0, - }, - "variables": Array [], - }, - ], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [], - "throughReferences": Array [], - "type": "global", - "upperScope": null, - "variableMap": Object {}, - "variableScope": Object { - "$ref": 1, - }, - "variables": Array [], -} -`; - -exports[`typescript fixtures/basics/readonly-arrays.src 1`] = ` +exports[`typescript fixtures/basics/readonly-tuples.src 1`] = ` Object { - "$id": 12, + "$id": 8, "block": Object { "range": Array [ 0, - 211, + 119, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 11, + "$id": 7, "block": Object { "range": Array [ 0, - 211, + 119, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 6, "block": Object { "range": Array [ 0, - 106, + 118, ], "type": "FunctionDeclaration", }, @@ -21188,13 +24524,30 @@ Object { Object { "$id": 3, "from": Object { - "$ref": 5, + "$ref": 6, }, "identifier": Object { - "name": "arr", + "name": "console", "range": Array [ - 45, - 48, + 50, + 57, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 4, + "from": Object { + "$ref": 6, + }, + "identifier": Object { + "name": "pair", + "range": Array [ + 62, + 66, ], "type": "Identifier", }, @@ -21205,15 +24558,15 @@ Object { "writeExpr": undefined, }, Object { - "$id": 4, + "$id": 5, "from": Object { - "$ref": 5, + "$ref": 6, }, "identifier": Object { - "name": "arr", + "name": "pair", "range": Array [ - 75, - 78, + 84, + 88, ], "type": "Identifier", }, @@ -21224,21 +24577,25 @@ Object { "writeExpr": undefined, }, ], - "throughReferences": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], "type": "function", "upperScope": Object { - "$ref": 11, + "$ref": 7, }, "variableMap": Object { "arguments": Object { "$ref": 1, }, - "arr": Object { + "pair": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -21249,7 +24606,7 @@ Object { "name": "arguments", "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, Object { @@ -21257,17 +24614,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "arr", + "name": "pair", "range": Array [ 13, - 39, + 44, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 106, + 118, ], "type": "FunctionDeclaration", }, @@ -21278,125 +24635,190 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "arr", + "name": "pair", "range": Array [ 13, - 39, + 44, ], "type": "Identifier", }, ], - "name": "arr", + "name": "pair", "references": Array [ Object { - "$ref": 3, + "$ref": 4, }, Object { - "$ref": 4, + "$ref": 5, }, ], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [ Object { - "$id": 10, - "block": Object { - "range": Array [ - 108, - 210, - ], - "type": "FunctionDeclaration", - }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "$ref": 3, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 8, + }, + "variableMap": Object { + "foo": Object { + "$ref": 0, + }, + }, + "variableScope": Object { + "$ref": 7, + }, + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ Object { - "$id": 8, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "arr", + "name": Object { + "name": "foo", "range": Array [ - 149, - 152, + 9, + 12, ], "type": "Identifier", }, - "kind": "r", - "resolved": Object { - "$ref": 7, - }, - "writeExpr": undefined, - }, - Object { - "$id": 9, - "from": Object { - "$ref": 10, - }, - "identifier": Object { - "name": "arr", + "node": Object { "range": Array [ - 179, - 182, + 0, + 118, ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 7, + "type": "FunctionDeclaration", }, - "writeExpr": undefined, + "parent": null, + "type": "FunctionName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", }, ], + "name": "foo", + "references": Array [], + "scope": Object { + "$ref": 7, + }, + }, + ], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 3, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 8, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/symbol-type-param.src 1`] = ` +Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 42, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 4, + "block": Object { + "range": Array [ + 0, + 42, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 42, + ], + "type": "FunctionDeclaration", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 11, + "$ref": 4, }, "variableMap": Object { - "arguments": Object { - "$ref": 6, + "abc": Object { + "$ref": 2, }, - "arr": Object { - "$ref": 7, + "arguments": Object { + "$ref": 1, }, }, "variableScope": Object { - "$ref": 10, + "$ref": 3, }, "variables": Array [ Object { - "$id": 6, + "$id": 1, "defs": Array [], "eslintUsed": undefined, "identifiers": Array [], "name": "arguments", "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 3, }, }, Object { - "$id": 7, + "$id": 2, "defs": Array [ Object { "name": Object { - "name": "arr", + "name": "abc", "range": Array [ - 121, - 143, + 14, + 38, ], "type": "Identifier", }, "node": Object { "range": Array [ - 108, - 210, + 0, + 42, ], "type": "FunctionDeclaration", }, @@ -21407,25 +24829,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "arr", + "name": "abc", "range": Array [ - 121, - 143, + 14, + 38, ], "type": "Identifier", }, ], - "name": "arr", - "references": Array [ - Object { - "$ref": 8, - }, - Object { - "$ref": 9, - }, - ], + "name": "abc", + "references": Array [], "scope": Object { - "$ref": 10, + "$ref": 3, }, }, ], @@ -21437,15 +24852,15 @@ Object { "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 12, + "$ref": 5, }, "variableMap": Object { - "foo": Object { + "test": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 11, + "$ref": 4, }, "variables": Array [ Object { @@ -21453,36 +24868,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "test", "range": Array [ 9, - 12, + 13, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 106, - ], - "type": "FunctionDeclaration", - }, - "parent": null, - "type": "FunctionName", - }, - Object { - "name": Object { - "name": "foo", - "range": Array [ - 117, - 120, - ], - "type": "Identifier", - }, - "node": Object { - "range": Array [ - 108, - 210, + 42, ], "type": "FunctionDeclaration", }, @@ -21493,26 +24889,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "test", "range": Array [ 9, - 12, - ], - "type": "Identifier", - }, - Object { - "name": "foo", - "range": Array [ - 117, - 120, + 13, ], "type": "Identifier", }, ], - "name": "foo", + "name": "test", "references": Array [], "scope": Object { - "$ref": 11, + "$ref": 4, }, }, ], @@ -21526,152 +24914,228 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 12, + "$ref": 5, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/type-alias-declaration.src 1`] = ` +Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 37, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 0, + "block": Object { + "range": Array [ + 0, + 37, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 1, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 0, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/type-alias-declaration-with-constrained-type-parameter.src 1`] = ` +Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 48, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 0, + "block": Object { + "range": Array [ + 0, + 48, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 1, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 0, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/type-alias-object-without-annotation.src 1`] = ` +Object { + "$id": 1, + "block": Object { + "range": Array [ + 0, + 31, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 0, + "block": Object { + "range": Array [ + 0, + 31, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 1, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 0, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/readonly-tuples.src 1`] = ` +exports[`typescript fixtures/basics/type-assertion-in-arrow-function.src 1`] = ` Object { - "$id": 8, + "$id": 5, "block": Object { "range": Array [ 0, - 119, + 59, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 7, + "$id": 4, "block": Object { "range": Array [ 0, - 119, + 59, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 6, + "$id": 3, "block": Object { "range": Array [ - 0, - 118, + 21, + 58, ], - "type": "FunctionDeclaration", + "type": "ArrowFunctionExpression", }, "childScopes": Array [], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 3, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "console", - "range": Array [ - 50, - 57, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": null, - "writeExpr": undefined, - }, - Object { - "$id": 4, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "pair", - "range": Array [ - 62, - 66, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - Object { - "$id": 5, - "from": Object { - "$ref": 6, - }, - "identifier": Object { - "name": "pair", - "range": Array [ - 84, - 88, - ], - "type": "Identifier", - }, - "kind": "r", - "resolved": Object { - "$ref": 2, - }, - "writeExpr": undefined, - }, - ], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], + "references": Array [], + "throughReferences": Array [], "type": "function", "upperScope": Object { - "$ref": 7, + "$ref": 4, }, "variableMap": Object { - "arguments": Object { - "$ref": 1, - }, - "pair": Object { + "x": Object { "$ref": 2, }, }, "variableScope": Object { - "$ref": 6, + "$ref": 3, }, "variables": Array [ - Object { - "$id": 1, - "defs": Array [], - "eslintUsed": undefined, - "identifiers": Array [], - "name": "arguments", - "references": Array [], - "scope": Object { - "$ref": 6, - }, - }, Object { "$id": 2, "defs": Array [ Object { "name": Object { - "name": "pair", + "name": "x", "range": Array [ - 13, - 44, + 22, + 28, ], "type": "Identifier", }, "node": Object { "range": Array [ - 0, - 118, + 21, + 58, ], - "type": "FunctionDeclaration", + "type": "ArrowFunctionExpression", }, "parent": null, "type": "Parameter", @@ -21680,25 +25144,18 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "pair", + "name": "x", "range": Array [ - 13, - 44, + 22, + 28, ], "type": "Identifier", }, ], - "name": "pair", - "references": Array [ - Object { - "$ref": 4, - }, - Object { - "$ref": 5, - }, - ], + "name": "x", + "references": Array [], "scope": Object { - "$ref": 6, + "$ref": 3, }, }, ], @@ -21706,23 +25163,45 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], - "throughReferences": Array [ + "references": Array [ Object { - "$ref": 3, + "$id": 1, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "assertString", + "range": Array [ + 6, + 18, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 21, + 58, + ], + "type": "ArrowFunctionExpression", + }, }, ], + "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 8, + "$ref": 5, }, "variableMap": Object { - "foo": Object { + "assertString": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 7, + "$ref": 4, }, "variables": Array [ Object { @@ -21730,39 +25209,49 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "assertString", "range": Array [ - 9, - 12, + 6, + 18, ], "type": "Identifier", }, "node": Object { + "range": Array [ + 6, + 58, + ], + "type": "VariableDeclarator", + }, + "parent": Object { "range": Array [ 0, - 118, + 58, ], - "type": "FunctionDeclaration", + "type": "VariableDeclaration", }, - "parent": null, - "type": "FunctionName", + "type": "Variable", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "assertString", "range": Array [ - 9, - 12, + 6, + 18, ], "type": "Identifier", }, ], - "name": "foo", - "references": Array [], + "name": "assertString", + "references": Array [ + Object { + "$ref": 1, + }, + ], "scope": Object { - "$ref": 7, + "$ref": 4, }, }, ], @@ -21771,28 +25260,24 @@ Object { "functionExpressionScope": false, "isStrict": false, "references": Array [], - "throughReferences": Array [ - Object { - "$ref": 3, - }, - ], + "throughReferences": Array [], "type": "global", "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 8, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/symbol-type-param.src 1`] = ` +exports[`typescript fixtures/basics/type-assertion-in-function.src 1`] = ` Object { "$id": 5, "block": Object { "range": Array [ 0, - 42, + 57, ], "type": "Program", }, @@ -21802,7 +25287,7 @@ Object { "block": Object { "range": Array [ 0, - 42, + 57, ], "type": "Program", }, @@ -21812,7 +25297,7 @@ Object { "block": Object { "range": Array [ 0, - 42, + 56, ], "type": "FunctionDeclaration", }, @@ -21826,12 +25311,12 @@ Object { "$ref": 4, }, "variableMap": Object { - "abc": Object { - "$ref": 2, - }, "arguments": Object { "$ref": 1, }, + "x": Object { + "$ref": 2, + }, }, "variableScope": Object { "$ref": 3, @@ -21853,17 +25338,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "abc", + "name": "x", "range": Array [ - 14, - 38, + 23, + 29, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 42, + 56, ], "type": "FunctionDeclaration", }, @@ -21874,15 +25359,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "abc", + "name": "x", "range": Array [ - 14, - 38, + 23, + 29, ], "type": "Identifier", }, ], - "name": "abc", + "name": "x", "references": Array [], "scope": Object { "$ref": 3, @@ -21900,7 +25385,7 @@ Object { "$ref": 5, }, "variableMap": Object { - "test": Object { + "assertsString": Object { "$ref": 0, }, }, @@ -21913,17 +25398,17 @@ Object { "defs": Array [ Object { "name": Object { - "name": "test", + "name": "assertsString", "range": Array [ 9, - 13, + 22, ], "type": "Identifier", }, "node": Object { "range": Array [ 0, - 42, + 56, ], "type": "FunctionDeclaration", }, @@ -21934,15 +25419,15 @@ Object { "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "test", + "name": "assertsString", "range": Array [ 9, - 13, + 22, ], "type": "Identifier", }, ], - "name": "test", + "name": "assertsString", "references": Array [], "scope": Object { "$ref": 4, @@ -21965,13 +25450,13 @@ Object { } `; -exports[`typescript fixtures/basics/type-alias-declaration.src 1`] = ` +exports[`typescript fixtures/basics/type-assertion-in-interface.src 1`] = ` Object { "$id": 1, "block": Object { "range": Array [ 0, - 37, + 61, ], "type": "Program", }, @@ -21981,7 +25466,7 @@ Object { "block": Object { "range": Array [ 0, - 37, + 61, ], "type": "Program", }, @@ -22015,40 +25500,220 @@ Object { } `; -exports[`typescript fixtures/basics/type-alias-declaration-with-constrained-type-parameter.src 1`] = ` +exports[`typescript fixtures/basics/type-assertion-in-method.src 1`] = ` Object { - "$id": 1, + "$id": 7, "block": Object { "range": Array [ 0, - 48, + 111, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 6, "block": Object { "range": Array [ 0, - 48, + 111, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 5, + "block": Object { + "range": Array [ + 0, + 110, + ], + "type": "ClassDeclaration", + }, + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 26, + 60, + ], + "type": "FunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + Object { + "$id": 4, + "block": Object { + "range": Array [ + 71, + 108, + ], + "type": "ArrowFunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "class", + "upperScope": Object { + "$ref": 6, + }, + "variableMap": Object { + "AssertsFoo": Object { + "$ref": 1, + }, + }, + "variableScope": Object { + "$ref": 6, + }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [ + Object { + "name": Object { + "name": "AssertsFoo", + "range": Array [ + 6, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 110, + ], + "type": "ClassDeclaration", + }, + "parent": undefined, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "AssertsFoo", + "range": Array [ + 6, + 16, + ], + "type": "Identifier", + }, + ], + "name": "AssertsFoo", + "references": Array [], + "scope": Object { + "$ref": 5, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 1, + "$ref": 7, + }, + "variableMap": Object { + "AssertsFoo": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 6, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "AssertsFoo", + "range": Array [ + 6, + 16, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 110, + ], + "type": "ClassDeclaration", + }, + "parent": null, + "type": "ClassName", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "AssertsFoo", + "range": Array [ + 6, + 16, + ], + "type": "Identifier", + }, + ], + "name": "AssertsFoo", + "references": Array [], + "scope": Object { + "$ref": 6, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -22059,46 +25724,197 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 7, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/type-alias-object-without-annotation.src 1`] = ` +exports[`typescript fixtures/basics/type-assertion-with-guard-in-arrow-function.src 1`] = ` Object { - "$id": 1, + "$id": 5, "block": Object { "range": Array [ 0, - 31, + 69, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 0, + "$id": 4, "block": Object { "range": Array [ 0, - 31, + 69, ], "type": "Program", }, - "childScopes": Array [], + "childScopes": Array [ + Object { + "$id": 3, + "block": Object { + "range": Array [ + 21, + 68, + ], + "type": "ArrowFunctionExpression", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 4, + }, + "variableMap": Object { + "x": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 22, + 28, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 21, + 68, + ], + "type": "ArrowFunctionExpression", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 22, + 28, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + ], "functionExpressionScope": false, "isStrict": true, - "references": Array [], + "references": Array [ + Object { + "$id": 1, + "from": Object { + "$ref": 4, + }, + "identifier": Object { + "name": "assertString", + "range": Array [ + 6, + 18, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 0, + }, + "writeExpr": Object { + "range": Array [ + 21, + 68, + ], + "type": "ArrowFunctionExpression", + }, + }, + ], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 1, + "$ref": 5, + }, + "variableMap": Object { + "assertString": Object { + "$ref": 0, + }, }, - "variableMap": Object {}, "variableScope": Object { - "$ref": 0, + "$ref": 4, }, - "variables": Array [], + "variables": Array [ + Object { + "$id": 0, + "defs": Array [ + Object { + "name": Object { + "name": "assertString", + "range": Array [ + 6, + 18, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 6, + 68, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 0, + 68, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "assertString", + "range": Array [ + 6, + 18, + ], + "type": "Identifier", + }, + ], + "name": "assertString", + "references": Array [ + Object { + "$ref": 1, + }, + ], + "scope": Object { + "$ref": 4, + }, + }, + ], }, ], "functionExpressionScope": false, @@ -22109,74 +25925,132 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 1, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/type-assertion.src 1`] = ` +exports[`typescript fixtures/basics/type-assertion-with-guard-in-function.src 1`] = ` Object { - "$id": 3, + "$id": 5, "block": Object { "range": Array [ 0, - 29, + 72, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 2, + "$id": 4, "block": Object { "range": Array [ 0, - 29, + 72, ], "type": "Program", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { - "$id": 1, - "from": Object { - "$ref": 2, - }, - "identifier": Object { - "name": "foo", + "$id": 3, + "block": Object { "range": Array [ - 6, - 9, + 0, + 71, ], - "type": "Identifier", + "type": "FunctionDeclaration", }, - "kind": "w", - "resolved": Object { - "$ref": 0, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 4, }, - "writeExpr": Object { - "range": Array [ - 12, - 27, - ], - "type": "TSTypeAssertion", + "variableMap": Object { + "arguments": Object { + "$ref": 1, + }, + "x": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 3, }, + "variables": Array [ + Object { + "$id": 1, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + Object { + "$id": 2, + "defs": Array [ + Object { + "name": Object { + "name": "x", + "range": Array [ + 28, + 34, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 0, + 71, + ], + "type": "FunctionDeclaration", + }, + "parent": null, + "type": "Parameter", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "x", + "range": Array [ + 28, + 34, + ], + "type": "Identifier", + }, + ], + "name": "x", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], }, ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 3, + "$ref": 5, }, "variableMap": Object { - "foo": Object { + "assertsStringGuard": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 2, + "$ref": 4, }, "variables": Array [ Object { @@ -22184,49 +26058,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "foo", + "name": "assertsStringGuard", "range": Array [ - 6, 9, + 27, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 6, - 27, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 28, + 71, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, - "type": "Variable", + "parent": null, + "type": "FunctionName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "foo", + "name": "assertsStringGuard", "range": Array [ - 6, 9, + 27, ], "type": "Identifier", }, ], - "name": "foo", - "references": Array [ - Object { - "$ref": 1, - }, - ], + "name": "assertsStringGuard", + "references": Array [], "scope": Object { - "$ref": 2, + "$ref": 4, }, }, ], @@ -22240,122 +26104,213 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 3, + "$ref": 5, }, "variables": Array [], } `; -exports[`typescript fixtures/basics/type-assertion-arrow-function.src 1`] = ` +exports[`typescript fixtures/basics/type-assertion-with-guard-in-interface.src 1`] = ` Object { - "$id": 6, + "$id": 1, "block": Object { "range": Array [ 0, - 45, + 71, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 5, + "$id": 0, "block": Object { "range": Array [ 0, - 45, + 71, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "module", + "upperScope": Object { + "$ref": 1, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 0, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 1, + }, + "variables": Array [], +} +`; + +exports[`typescript fixtures/basics/type-assertion-with-guard-in-method.src 1`] = ` +Object { + "$id": 7, + "block": Object { + "range": Array [ + 0, + 131, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 6, + "block": Object { + "range": Array [ + 0, + 131, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 4, + "$id": 5, "block": Object { "range": Array [ - 22, - 42, + 0, + 130, ], - "type": "ArrowFunctionExpression", + "type": "ClassDeclaration", }, - "childScopes": Array [], - "functionExpressionScope": false, - "isStrict": true, - "references": Array [ + "childScopes": Array [ Object { "$id": 3, - "from": Object { - "$ref": 4, + "block": Object { + "range": Array [ + 26, + 70, + ], + "type": "FunctionExpression", }, - "identifier": Object { - "name": "n", + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, + }, + "variableMap": Object { + "arguments": Object { + "$ref": 2, + }, + }, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [ + Object { + "$id": 2, + "defs": Array [], + "eslintUsed": undefined, + "identifiers": Array [], + "name": "arguments", + "references": Array [], + "scope": Object { + "$ref": 3, + }, + }, + ], + }, + Object { + "$id": 4, + "block": Object { "range": Array [ - 38, - 39, + 81, + 128, ], - "type": "Identifier", + "type": "ArrowFunctionExpression", }, - "kind": "r", - "resolved": Object { - "$ref": 2, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], + "throughReferences": Array [], + "type": "function", + "upperScope": Object { + "$ref": 5, }, - "writeExpr": undefined, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 4, + }, + "variables": Array [], }, ], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [], "throughReferences": Array [], - "type": "function", + "type": "class", "upperScope": Object { - "$ref": 5, + "$ref": 6, }, "variableMap": Object { - "n": Object { - "$ref": 2, + "AssertsFoo": Object { + "$ref": 1, }, }, "variableScope": Object { - "$ref": 4, + "$ref": 6, }, "variables": Array [ Object { - "$id": 2, + "$id": 1, "defs": Array [ Object { "name": Object { - "name": "n", + "name": "AssertsFoo", "range": Array [ - 23, - 24, + 6, + 16, ], "type": "Identifier", }, "node": Object { "range": Array [ - 22, - 42, + 0, + 130, ], - "type": "ArrowFunctionExpression", + "type": "ClassDeclaration", }, - "parent": null, - "type": "Parameter", + "parent": undefined, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "n", + "name": "AssertsFoo", "range": Array [ - 23, - 24, + 6, + 16, ], "type": "Identifier", }, ], - "name": "n", - "references": Array [ - Object { - "$ref": 3, - }, - ], + "name": "AssertsFoo", + "references": Array [], "scope": Object { - "$ref": 4, + "$ref": 5, }, }, ], @@ -22363,45 +26318,19 @@ Object { ], "functionExpressionScope": false, "isStrict": true, - "references": Array [ - Object { - "$id": 1, - "from": Object { - "$ref": 5, - }, - "identifier": Object { - "name": "asserted2", - "range": Array [ - 4, - 13, - ], - "type": "Identifier", - }, - "kind": "w", - "resolved": Object { - "$ref": 0, - }, - "writeExpr": Object { - "range": Array [ - 16, - 43, - ], - "type": "TSTypeAssertion", - }, - }, - ], + "references": Array [], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 6, + "$ref": 7, }, "variableMap": Object { - "asserted2": Object { + "AssertsFoo": Object { "$ref": 0, }, }, "variableScope": Object { - "$ref": 5, + "$ref": 6, }, "variables": Array [ Object { @@ -22409,49 +26338,39 @@ Object { "defs": Array [ Object { "name": Object { - "name": "asserted2", + "name": "AssertsFoo", "range": Array [ - 4, - 13, + 6, + 16, ], "type": "Identifier", }, "node": Object { - "range": Array [ - 4, - 43, - ], - "type": "VariableDeclarator", - }, - "parent": Object { "range": Array [ 0, - 44, + 130, ], - "type": "VariableDeclaration", + "type": "ClassDeclaration", }, - "type": "Variable", + "parent": null, + "type": "ClassName", }, ], "eslintUsed": undefined, "identifiers": Array [ Object { - "name": "asserted2", + "name": "AssertsFoo", "range": Array [ - 4, - 13, + 6, + 16, ], "type": "Identifier", }, ], - "name": "asserted2", - "references": Array [ - Object { - "$ref": 1, - }, - ], + "name": "AssertsFoo", + "references": Array [], "scope": Object { - "$ref": 5, + "$ref": 6, }, }, ], @@ -22465,7 +26384,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 6, + "$ref": 7, }, "variables": Array [], } diff --git a/packages/parser/tests/lib/jsx.ts b/packages/parser/tests/lib/jsx.ts index 530b26c444b5..7055ca98d199 100644 --- a/packages/parser/tests/lib/jsx.ts +++ b/packages/parser/tests/lib/jsx.ts @@ -1,6 +1,6 @@ +import filesWithKnownIssues from '@typescript-eslint/shared-fixtures/dist/jsx-known-issues'; import fs from 'fs'; import glob from 'glob'; -import filesWithKnownIssues from '../../../shared-fixtures/jsx-known-issues'; import { createScopeSnapshotTestBlock, formatSnapshotName, diff --git a/packages/parser/tsconfig.build.json b/packages/parser/tsconfig.build.json index a94802fb081a..2f7c5d796091 100644 --- a/packages/parser/tsconfig.build.json +++ b/packages/parser/tsconfig.build.json @@ -1,8 +1,15 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "outDir": "./dist" + "composite": true, + "outDir": "./dist", + "rootDir": "./src", + "resolveJsonModule": true }, - "include": ["src"] + "include": ["src"], + "references": [ + { "path": "../experimental-utils/tsconfig.build.json" }, + { "path": "../typescript-estree/tsconfig.build.json" }, + { "path": "../shared-fixtures/tsconfig.build.json" } + ] } diff --git a/packages/parser/tsconfig.json b/packages/parser/tsconfig.json index 6f763b588b53..a987c8b550de 100644 --- a/packages/parser/tsconfig.json +++ b/packages/parser/tsconfig.json @@ -1,5 +1,9 @@ { "extends": "./tsconfig.build.json", + "compilerOptions": { + "composite": false, + "rootDir": "." + }, "include": ["src", "tests", "tools"], "exclude": ["tests/fixtures"] } diff --git a/packages/shared-fixtures/CHANGELOG.md b/packages/shared-fixtures/CHANGELOG.md index 938f88a906bc..aa253e3d46ee 100644 --- a/packages/shared-fixtures/CHANGELOG.md +++ b/packages/shared-fixtures/CHANGELOG.md @@ -3,6 +3,65 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.1...v2.7.0) (2019-11-11) + +**Note:** Version bump only for package @typescript-eslint/shared-fixtures + + + + + +## [2.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.0...v2.6.1) (2019-11-04) + +**Note:** Version bump only for package @typescript-eslint/shared-fixtures + + + + + +# [2.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.5.0...v2.6.0) (2019-10-28) + + +### Bug Fixes + +* **typescript-estree:** correct parenthesized optional chain AST ([#1141](https://github.com/typescript-eslint/typescript-eslint/issues/1141)) ([5ae286e](https://github.com/typescript-eslint/typescript-eslint/commit/5ae286e)) + + +### Features + +* **typescript-estree:** add support for declare class properties ([#1136](https://github.com/typescript-eslint/typescript-eslint/issues/1136)) ([1508670](https://github.com/typescript-eslint/typescript-eslint/commit/1508670)) + + + + + +# [2.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.4.0...v2.5.0) (2019-10-21) + +**Note:** Version bump only for package @typescript-eslint/shared-fixtures + + + + + +# [2.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.3...v2.4.0) (2019-10-14) + + +### Features + +* **typescript-estree:** support for parsing 3.7 features ([#1045](https://github.com/typescript-eslint/typescript-eslint/issues/1045)) ([623febf](https://github.com/typescript-eslint/typescript-eslint/commit/623febf)) + + + + + +## [2.3.3](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.2...v2.3.3) (2019-10-07) + +**Note:** Version bump only for package @typescript-eslint/shared-fixtures + + + + + ## [2.3.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.1...v2.3.2) (2019-09-30) diff --git a/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-declare-properties.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-declare-properties.src.ts new file mode 100644 index 000000000000..307d36a66163 --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-declare-properties.src.ts @@ -0,0 +1,7 @@ +abstract class AbstractDeclProps { + declare prop1: string; + declare abstract prop2: string; + declare public abstract prop3: string; + declare readonly abstract prop4: string; + declare public readonly abstract prop5: string; +} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-arrow-function.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/angle-bracket-type-assertion-arrow-function.src.ts similarity index 100% rename from packages/shared-fixtures/fixtures/typescript/basics/type-assertion-arrow-function.src.ts rename to packages/shared-fixtures/fixtures/typescript/basics/angle-bracket-type-assertion-arrow-function.src.ts diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/angle-bracket-type-assertion.src.ts similarity index 100% rename from packages/shared-fixtures/fixtures/typescript/basics/type-assertion.src.ts rename to packages/shared-fixtures/fixtures/typescript/basics/angle-bracket-type-assertion.src.ts diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-declare-properties.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-declare-properties.src.ts new file mode 100644 index 000000000000..3b37e42e4b19 --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/basics/class-with-declare-properties.src.ts @@ -0,0 +1,9 @@ +class DeclProps { + declare prop1: string; + declare public prop2: string; + declare static prop3: string; + declare readonly prop3: string; + declare public readonly prop4: string; + declare public static prop5: string; + declare public static readonly prop6: string; +} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/nullish-coalescing.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/nullish-coalescing.src.ts new file mode 100644 index 000000000000..6ecd2db00aaa --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/basics/nullish-coalescing.src.ts @@ -0,0 +1,3 @@ +function processNullishCoalesce(s?: string) { + let len = (s ?? ''); +} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-call-with-parens.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-call-with-parens.src.ts new file mode 100644 index 000000000000..4024fffa9d58 --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-call-with-parens.src.ts @@ -0,0 +1,13 @@ +function processOptionalCallParens(one?: any) { + (one?.fn()); + (one?.two).fn(); + (one.two?.fn()); + (one.two?.three).fn(); + (one.two?.three?.fn()); + + (one?.()); + (one?.())(); + (one?.())?.(); + + (one?.()).two; +} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-call.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-call.src.ts new file mode 100644 index 000000000000..c411490d129b --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-call.src.ts @@ -0,0 +1,13 @@ +function processOptionalCall(one?: any) { + one?.fn(); + one?.two.fn(); + one.two?.fn(); + one.two?.three.fn(); + one.two?.three?.fn(); + + one?.(); + one?.()(); + one?.()?.(); + + one?.().two; +} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-element-access-with-parens.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-element-access-with-parens.src.ts new file mode 100644 index 000000000000..a4a30b2d5df6 --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-element-access-with-parens.src.ts @@ -0,0 +1,8 @@ +function processOptionalElementParens(one?: any) { + (one?.[2]); + (one?.[2])[3]; + (one[2]?.[3]); + (one[2]?.[3])[4]; + (one[2]?.[3]?.[4]); + (one[2]?.[3]?.[4])[5]; +} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-element-access.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-element-access.src.ts new file mode 100644 index 000000000000..6a3ba4500d17 --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-element-access.src.ts @@ -0,0 +1,8 @@ +function processOptionalElement(one?: any) { + one?.[2]; + one?.[2][3]; + one[2]?.[3]; + one[2]?.[3]; + one[2]?.[3][4]; + one[2]?.[3]?.[4]; +} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-with-parens.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-with-parens.src.ts new file mode 100644 index 000000000000..69c9e8efee51 --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-with-parens.src.ts @@ -0,0 +1,8 @@ +function processOptionalParens(one?: any) { + (one?.two); + (one?.two).three; + (one.two?.three); + (one.two?.three).four; + (one.two?.three?.four); + (one.two?.three?.four).five; +} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/optional-chain.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/optional-chain.src.ts new file mode 100644 index 000000000000..6fbf4219de01 --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/basics/optional-chain.src.ts @@ -0,0 +1,7 @@ +function processOptional(one?: any) { + one?.two; + one?.two.three; + one.two?.three; + one.two?.three.four; + one.two?.three?.four; +} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-arrow-function.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-arrow-function.src.ts new file mode 100644 index 000000000000..584155016de8 --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-arrow-function.src.ts @@ -0,0 +1,3 @@ +const assertString = (x: any): asserts x => { + return +} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-function.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-function.src.ts new file mode 100644 index 000000000000..28727047a6d5 --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-function.src.ts @@ -0,0 +1,3 @@ +function assertsString(x: any): asserts x { + return +} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-interface.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-interface.src.ts new file mode 100644 index 000000000000..22b280ec535d --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-interface.src.ts @@ -0,0 +1,3 @@ +interface AssertFoo { + isString(node: any): asserts node; +} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-method.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-method.src.ts new file mode 100644 index 000000000000..5d2ab8745a1b --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-method.src.ts @@ -0,0 +1,8 @@ +class AssertsFoo { + isBar(): asserts this { + return; + } + isBaz = (): asserts this => { + return; + } +} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-arrow-function.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-arrow-function.src.ts new file mode 100644 index 000000000000..586fda06dfda --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-arrow-function.src.ts @@ -0,0 +1,3 @@ +const assertString = (x: any): asserts x is string => { + return +} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-function.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-function.src.ts new file mode 100644 index 000000000000..027a4c1197dd --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-function.src.ts @@ -0,0 +1,3 @@ +function assertsStringGuard(x: any): asserts x is string { + return +} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-interface.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-interface.src.ts new file mode 100644 index 000000000000..fe226cfc388a --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-interface.src.ts @@ -0,0 +1,3 @@ +interface AssertFoo { + isString(node: any): asserts node is string; +} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-method.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-method.src.ts new file mode 100644 index 000000000000..146b4ce1484b --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-method.src.ts @@ -0,0 +1,8 @@ +class AssertsFoo { + isBar(): asserts this is string { + return; + } + isBaz = (): asserts this is string => { + return; + } +} diff --git a/packages/shared-fixtures/package.json b/packages/shared-fixtures/package.json index fc7944ea50d3..c457e83d4dd3 100644 --- a/packages/shared-fixtures/package.json +++ b/packages/shared-fixtures/package.json @@ -1,5 +1,10 @@ { "name": "@typescript-eslint/shared-fixtures", - "version": "2.3.2", - "private": true + "version": "2.7.0", + "private": true, + "scripts": { + "build": "tsc -b tsconfig.build.json", + "clean": "tsc -b tsconfig.build.json --clean", + "typecheck": "tsc -p tsconfig.json --noEmit" + } } diff --git a/packages/shared-fixtures/tsconfig.build.json b/packages/shared-fixtures/tsconfig.build.json new file mode 100644 index 000000000000..a4799817b0e5 --- /dev/null +++ b/packages/shared-fixtures/tsconfig.build.json @@ -0,0 +1,12 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "composite": true, + "outDir": "./dist", + "rootDir": ".", + "resolveJsonModule": true + }, + "files": [ + "jsx-known-issues.ts" + ] +} diff --git a/packages/shared-fixtures/tsconfig.json b/packages/shared-fixtures/tsconfig.json new file mode 100644 index 000000000000..75086e9799bd --- /dev/null +++ b/packages/shared-fixtures/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.build.json", + "compilerOptions": { + "composite": false, + "rootDir": "." + }, + "files": [ + "jsx-known-issues.ts" + ] +} diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index ae3e39147edb..28d91bddc6b1 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -3,6 +3,94 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.1...v2.7.0) (2019-11-11) + + +### Bug Fixes + +* **typescript-estree:** hash code to reduce update frequency ([#1179](https://github.com/typescript-eslint/typescript-eslint/issues/1179)) ([96d1cc3](https://github.com/typescript-eslint/typescript-eslint/commit/96d1cc3)) +* **typescript-estree:** reduce bundle footprint of tsutils ([#1177](https://github.com/typescript-eslint/typescript-eslint/issues/1177)) ([c8fe515](https://github.com/typescript-eslint/typescript-eslint/commit/c8fe515)) + + + + + +## [2.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.0...v2.6.1) (2019-11-04) + + +### Bug Fixes + +* **typescript-estree:** don't use typescript's synthetic default ([#1156](https://github.com/typescript-eslint/typescript-eslint/issues/1156)) ([17c956e](https://github.com/typescript-eslint/typescript-eslint/commit/17c956e)), closes [#1153](https://github.com/typescript-eslint/typescript-eslint/issues/1153) +* **typescript-estree:** fix filename handling for vue JSX + markdown ([#1127](https://github.com/typescript-eslint/typescript-eslint/issues/1127)) ([366518f](https://github.com/typescript-eslint/typescript-eslint/commit/366518f)) +* **typescript-estree:** improve comment parsing code ([#1120](https://github.com/typescript-eslint/typescript-eslint/issues/1120)) ([e54998d](https://github.com/typescript-eslint/typescript-eslint/commit/e54998d)) + + + + + +# [2.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.5.0...v2.6.0) (2019-10-28) + + +### Bug Fixes + +* **parser:** adds TTY check before logging the version mismatch warning ([#1121](https://github.com/typescript-eslint/typescript-eslint/issues/1121)) ([768ef63](https://github.com/typescript-eslint/typescript-eslint/commit/768ef63)) +* **typescript-estree:** better handle canonical paths ([#1111](https://github.com/typescript-eslint/typescript-eslint/issues/1111)) ([8dcbf4c](https://github.com/typescript-eslint/typescript-eslint/commit/8dcbf4c)) +* **typescript-estree:** correct parenthesized optional chain AST ([#1141](https://github.com/typescript-eslint/typescript-eslint/issues/1141)) ([5ae286e](https://github.com/typescript-eslint/typescript-eslint/commit/5ae286e)) +* **typescript-estree:** ensure parent pointers are set ([#1129](https://github.com/typescript-eslint/typescript-eslint/issues/1129)) ([d4703e1](https://github.com/typescript-eslint/typescript-eslint/commit/d4703e1)) +* **typescript-estree:** normalize paths to fix cache miss on windows ([#1128](https://github.com/typescript-eslint/typescript-eslint/issues/1128)) ([6d0f2ce](https://github.com/typescript-eslint/typescript-eslint/commit/6d0f2ce)) + + +### Features + +* **typescript-estree:** add support for declare class properties ([#1136](https://github.com/typescript-eslint/typescript-eslint/issues/1136)) ([1508670](https://github.com/typescript-eslint/typescript-eslint/commit/1508670)) + + + + + +# [2.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.4.0...v2.5.0) (2019-10-21) + + +### Bug Fixes + +* **typescript-estree:** correct semver check range ([#1109](https://github.com/typescript-eslint/typescript-eslint/issues/1109)) ([2fc9bd2](https://github.com/typescript-eslint/typescript-eslint/commit/2fc9bd2)) +* **typescript-estree:** handle running out of fs watchers ([#1088](https://github.com/typescript-eslint/typescript-eslint/issues/1088)) ([ec62747](https://github.com/typescript-eslint/typescript-eslint/commit/ec62747)) +* **typescript-estree:** parsing error for vue sfc ([#1083](https://github.com/typescript-eslint/typescript-eslint/issues/1083)) ([7a8cce6](https://github.com/typescript-eslint/typescript-eslint/commit/7a8cce6)) +* **typescript-estree:** remove now unneeded dep on chokidar ([088a691](https://github.com/typescript-eslint/typescript-eslint/commit/088a691)) + + +### Features + +* **typescript-estree:** support long running lint without watch ([#1106](https://github.com/typescript-eslint/typescript-eslint/issues/1106)) ([ed5564d](https://github.com/typescript-eslint/typescript-eslint/commit/ed5564d)) + + + + + +# [2.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.3...v2.4.0) (2019-10-14) + + +### Bug Fixes + +* support long running "watch" lint sessions ([#973](https://github.com/typescript-eslint/typescript-eslint/issues/973)) ([854620e](https://github.com/typescript-eslint/typescript-eslint/commit/854620e)) + + +### Features + +* **typescript-estree:** support for parsing 3.7 features ([#1045](https://github.com/typescript-eslint/typescript-eslint/issues/1045)) ([623febf](https://github.com/typescript-eslint/typescript-eslint/commit/623febf)) + + + + + +## [2.3.3](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.2...v2.3.3) (2019-10-07) + +**Note:** Version bump only for package @typescript-eslint/typescript-estree + + + + + ## [2.3.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.1...v2.3.2) (2019-09-30) diff --git a/packages/typescript-estree/README.md b/packages/typescript-estree/README.md index 55cf645d88ec..aca6f215dcb1 100644 --- a/packages/typescript-estree/README.md +++ b/packages/typescript-estree/README.md @@ -47,7 +47,17 @@ Parses the given string of code with the options provided and returns an ESTree- // create a top-level comments array containing all comments comment: false, - // enable parsing JSX. For more details, see https://www.typescriptlang.org/docs/handbook/jsx.html + /* + * enable parsing JSX. For more details, see https://www.typescriptlang.org/docs/handbook/jsx.html + * + * NOTE: this setting does not effect known file types (.js, .jsx, .ts, .tsx, .json) because the + * typescript compiler has its own internal handling for known file extensions. + * + * Exact behaviour: + * - .js, .jsx, .tsx files are parsed as if this is true + * - .ts files are parsed as if this is false + * - unknown extensions (.md, .vue) will respect this setting + */ jsx: false, /* @@ -144,6 +154,11 @@ I work closely with the TypeScript Team and we are gradually aliging the AST of - `npm run unit-tests` - run only unit tests - `npm run ast-alignment-tests` - run only Babylon AST alignment tests +## Debugging + +If you encounter a bug with the parser that you want to investigate, you can turn on the debug logging via setting the environment variable: `DEBUG=typescript-eslint:*`. +I.e. in this repo you can run: `DEBUG=typescript-eslint:* yarn lint`. + ## License TypeScript ESTree inherits from the the original TypeScript ESLint Parser license, as the majority of the work began there. It is licensed under a permissive BSD 2-clause license. diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 906c23639a36..45386970cfa2 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "2.3.2", + "version": "2.7.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "main": "dist/parser.js", "types": "dist/parser.d.ts", @@ -31,35 +31,44 @@ "syntax" ], "scripts": { - "ast-alignment-tests": "jest spec.ts", - "build": "tsc -p tsconfig.build.json", - "clean": "rimraf dist/", + "build": "tsc -b tsconfig.build.json", + "clean": "tsc -b tsconfig.build.json --clean", "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", - "prebuild": "npm run clean", + "lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'", "test": "jest --coverage", - "typecheck": "tsc --noEmit", - "unit-tests": "jest \"./tests/lib/.*\"" + "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { + "debug": "^4.1.1", + "eslint-visitor-keys": "^1.1.0", "glob": "^7.1.4", "is-glob": "^4.0.1", "lodash.unescape": "4.0.1", - "semver": "^6.3.0" + "semver": "^6.3.0", + "tsutils": "^3.17.1" }, "devDependencies": { "@babel/code-frame": "7.5.5", "@babel/parser": "7.5.5", "@babel/types": "^7.3.2", "@types/babel-code-frame": "^6.20.1", + "@types/debug": "^4.1.5", "@types/glob": "^7.1.1", "@types/is-glob": "^4.0.1", "@types/lodash.isplainobject": "^4.0.4", "@types/lodash.unescape": "^4.0.4", "@types/semver": "^6.0.1", - "@typescript-eslint/shared-fixtures": "2.3.2", + "@types/tmp": "^0.1.0", + "@typescript-eslint/shared-fixtures": "2.7.0", "babel-code-frame": "^6.26.0", "glob": "^7.1.4", "lodash.isplainobject": "4.0.6", + "tmp": "^0.1.0", "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } } diff --git a/packages/typescript-estree/src/ast-converter.ts b/packages/typescript-estree/src/ast-converter.ts index fffb9ea15cfd..270d50dde3f7 100644 --- a/packages/typescript-estree/src/ast-converter.ts +++ b/packages/typescript-estree/src/ast-converter.ts @@ -4,6 +4,7 @@ import { convertComments } from './convert-comments'; import { convertTokens } from './node-utils'; import { Extra } from './parser-options'; import { TSESTree } from './ts-estree'; +import { simpleTraverse } from './simple-traverse'; export function astConverter( ast: SourceFile, @@ -32,6 +33,22 @@ export function astConverter( const estree = instance.convertProgram(); + /** + * Optionally remove range and loc if specified + */ + if (extra.range || extra.loc) { + simpleTraverse(estree, { + enter: node => { + if (!extra.range) { + delete node.range; + } + if (!extra.loc) { + delete node.loc; + } + }, + }); + } + /** * Optionally convert and include all tokens in the AST */ diff --git a/packages/typescript-estree/src/convert-comments.ts b/packages/typescript-estree/src/convert-comments.ts index d3738774cd90..a82d9941dbd3 100644 --- a/packages/typescript-estree/src/convert-comments.ts +++ b/packages/typescript-estree/src/convert-comments.ts @@ -1,82 +1,8 @@ import * as ts from 'typescript'; // leave this as * as ts so people using util package don't need syntheticDefaultImports -import { getLocFor, getNodeContainer } from './node-utils'; +import { forEachComment } from 'tsutils/util/util'; +import { getLocFor } from './node-utils'; import { TSESTree } from './ts-estree'; -/** - * Converts a TypeScript comment to an Esprima comment. - * @param block True if it's a block comment, false if not. - * @param text The text of the comment. - * @param start The index at which the comment starts. - * @param end The index at which the comment ends. - * @param startLoc The location at which the comment starts. - * @param endLoc The location at which the comment ends. - * @returns The comment object. - * @internal - */ -function convertTypeScriptCommentToEsprimaComment( - block: boolean, - text: string, - start: number, - end: number, - startLoc: TSESTree.LineAndColumnData, - endLoc: TSESTree.LineAndColumnData, -): TSESTree.Comment { - const comment: TSESTree.OptionalRangeAndLoc = { - type: block ? 'Block' : 'Line', - value: text, - }; - - if (typeof start === 'number') { - comment.range = [start, end]; - } - - if (typeof startLoc === 'object') { - comment.loc = { - start: startLoc, - end: endLoc, - }; - } - - return comment as TSESTree.Comment; -} - -/** - * Convert comment from TypeScript Triva Scanner. - * @param triviaScanner TS Scanner - * @param ast the AST object - * @param code TypeScript code - * @returns the converted Comment - * @private - */ -function getCommentFromTriviaScanner( - triviaScanner: ts.Scanner, - ast: ts.SourceFile, - code: string, -): TSESTree.Comment { - const kind = triviaScanner.getToken(); - const isBlock = kind === ts.SyntaxKind.MultiLineCommentTrivia; - const range = { - pos: triviaScanner.getTokenPos(), - end: triviaScanner.getTextPos(), - kind: triviaScanner.getToken(), - }; - - const comment = code.substring(range.pos, range.end); - const text = isBlock - ? comment.replace(/^\/\*/, '').replace(/\*\/$/, '') - : comment.replace(/^\/\//, ''); - const loc = getLocFor(range.pos, range.end, ast); - - return convertTypeScriptCommentToEsprimaComment( - isBlock, - text, - range.pos, - range.end, - loc.start, - loc.end, - ); -} - /** * Convert all comments for the given AST. * @param ast the AST object @@ -90,93 +16,33 @@ export function convertComments( ): TSESTree.Comment[] { const comments: TSESTree.Comment[] = []; - /** - * Create a TypeScript Scanner, with skipTrivia set to false so that - * we can parse the comments - */ - const triviaScanner = ts.createScanner( - ast.languageVersion, - false, - ast.languageVariant, - code, + forEachComment( + ast, + (_, comment) => { + const type = + comment.kind == ts.SyntaxKind.SingleLineCommentTrivia + ? 'Line' + : 'Block'; + const range: TSESTree.Range = [comment.pos, comment.end]; + const loc = getLocFor(range[0], range[1], ast); + + // both comments start with 2 characters - /* or // + const textStart = range[0] + 2; + const textEnd = + comment.kind === ts.SyntaxKind.SingleLineCommentTrivia + ? // single line comments end at the end + range[1] - textStart + : // multiline comments end 2 characters early + range[1] - textStart - 2; + comments.push({ + type, + value: code.substr(textStart, textEnd), + range, + loc, + }); + }, + ast, ); - let kind = triviaScanner.scan(); - while (kind !== ts.SyntaxKind.EndOfFileToken) { - const start = triviaScanner.getTokenPos(); - const end = triviaScanner.getTextPos(); - - let container: ts.Node | null = null; - switch (kind) { - case ts.SyntaxKind.SingleLineCommentTrivia: - case ts.SyntaxKind.MultiLineCommentTrivia: { - const comment = getCommentFromTriviaScanner(triviaScanner, ast, code); - - comments.push(comment); - break; - } - case ts.SyntaxKind.GreaterThanToken: - container = getNodeContainer(ast, start, end); - if ( - (container.parent && - container.parent.parent && - // Rescan after an opening element or fragment - (container.parent.kind === ts.SyntaxKind.JsxOpeningElement && - // Make sure this is the end of a tag like `>` - container.parent.end === end)) || - container.parent.kind === ts.SyntaxKind.JsxOpeningFragment || - // Rescan after a self-closing element if it's inside another JSX element - (container.parent.kind === ts.SyntaxKind.JsxSelfClosingElement && - (container.parent.parent.kind === ts.SyntaxKind.JsxElement || - container.parent.parent.kind === ts.SyntaxKind.JsxFragment)) || - // Rescan after a closing element if it's inside another JSX element - ((container.parent.kind === ts.SyntaxKind.JsxClosingElement || - container.parent.kind === ts.SyntaxKind.JsxClosingFragment) && - container.parent.parent.parent && - (container.parent.parent.parent.kind === ts.SyntaxKind.JsxElement || - container.parent.parent.parent.kind === - ts.SyntaxKind.JsxFragment)) - ) { - kind = triviaScanner.reScanJsxToken(); - continue; - } - break; - case ts.SyntaxKind.CloseBraceToken: - container = getNodeContainer(ast, start, end); - - // Rescan after a JSX expression - if ( - container.parent && - container.parent.kind === ts.SyntaxKind.JsxExpression && - container.parent.parent && - container.parent.parent.kind === ts.SyntaxKind.JsxElement - ) { - kind = triviaScanner.reScanJsxToken(); - continue; - } - - if ( - container.kind === ts.SyntaxKind.TemplateMiddle || - container.kind === ts.SyntaxKind.TemplateTail - ) { - kind = triviaScanner.reScanTemplateToken(); - continue; - } - break; - case ts.SyntaxKind.SlashToken: - case ts.SyntaxKind.SlashEqualsToken: - container = getNodeContainer(ast, start, end); - - if (container.kind === ts.SyntaxKind.RegularExpressionLiteral) { - kind = triviaScanner.reScanSlashToken(); - continue; - } - break; - default: - break; - } - kind = triviaScanner.scan(); - } - return comments; } diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 203fbe2b4947..67ca0be79b89 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -926,6 +926,7 @@ export class Converter { computed: isComputedProperty(node.name), static: hasModifier(SyntaxKind.StaticKeyword, node), readonly: hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, + declare: hasModifier(SyntaxKind.DeclareKeyword, node), }); if (node.type) { @@ -1676,7 +1677,7 @@ export class Converter { | TSESTree.LogicalExpression | TSESTree.BinaryExpression >(node, { - type: type, + type, operator: getTextForTokenKind(node.operatorToken.kind)!, left: this.converter( node.left, @@ -1689,36 +1690,99 @@ export class Converter { } } - case SyntaxKind.PropertyAccessExpression: - return this.createNode(node, { - type: AST_NODE_TYPES.MemberExpression, - object: this.convertChild(node.expression), - property: this.convertChild(node.name), - computed: false, - }); + case SyntaxKind.PropertyAccessExpression: { + const object = this.convertChild(node.expression); + const property = this.convertChild(node.name); + const computed = false; - case SyntaxKind.ElementAccessExpression: - return this.createNode(node, { - type: AST_NODE_TYPES.MemberExpression, - object: this.convertChild(node.expression), - property: this.convertChild(node.argumentExpression), - computed: true, - }); + const isLocallyOptional = node.questionDotToken !== undefined; + // the optional expression should propogate up the member expression tree + const isChildOptional = + (object.type === AST_NODE_TYPES.OptionalMemberExpression || + object.type === AST_NODE_TYPES.OptionalCallExpression) && + // (x?.y).z is semantically different, and as such .z is no longer optional + node.expression.kind !== ts.SyntaxKind.ParenthesizedExpression; - case SyntaxKind.ConditionalExpression: - return this.createNode(node, { - type: AST_NODE_TYPES.ConditionalExpression, - test: this.convertChild(node.condition), - consequent: this.convertChild(node.whenTrue), - alternate: this.convertChild(node.whenFalse), - }); + if (isLocallyOptional || isChildOptional) { + return this.createNode(node, { + type: AST_NODE_TYPES.OptionalMemberExpression, + object, + property, + computed, + optional: isLocallyOptional, + }); + } else { + return this.createNode(node, { + type: AST_NODE_TYPES.MemberExpression, + object, + property, + computed, + optional: false, + }); + } + } + + case SyntaxKind.ElementAccessExpression: { + const object = this.convertChild(node.expression); + const property = this.convertChild(node.argumentExpression); + const computed = true; + + const isLocallyOptional = node.questionDotToken !== undefined; + // the optional expression should propogate up the member expression tree + const isChildOptional = + (object.type === AST_NODE_TYPES.OptionalMemberExpression || + object.type === AST_NODE_TYPES.OptionalCallExpression) && + // (x?.y).z is semantically different, and as such .z is no longer optional + node.expression.kind !== ts.SyntaxKind.ParenthesizedExpression; + + if (isLocallyOptional || isChildOptional) { + return this.createNode(node, { + type: AST_NODE_TYPES.OptionalMemberExpression, + object, + property, + computed, + optional: isLocallyOptional, + }); + } else { + return this.createNode(node, { + type: AST_NODE_TYPES.MemberExpression, + object, + property, + computed, + optional: false, + }); + } + } case SyntaxKind.CallExpression: { - const result = this.createNode(node, { - type: AST_NODE_TYPES.CallExpression, - callee: this.convertChild(node.expression), - arguments: node.arguments.map(el => this.convertChild(el)), - }); + const callee = this.convertChild(node.expression); + const args = node.arguments.map(el => this.convertChild(el)); + let result; + + const isLocallyOptional = node.questionDotToken !== undefined; + // the optional expression should propogate up the member expression tree + const isChildOptional = + (callee.type === AST_NODE_TYPES.OptionalMemberExpression || + callee.type === AST_NODE_TYPES.OptionalCallExpression) && + // (x?.y).z() is semantically different, and as such .z() is no longer optional + node.expression.kind !== ts.SyntaxKind.ParenthesizedExpression; + + if (isLocallyOptional || isChildOptional) { + result = this.createNode(node, { + type: AST_NODE_TYPES.OptionalCallExpression, + callee, + arguments: args, + optional: isLocallyOptional, + }); + } else { + result = this.createNode(node, { + type: AST_NODE_TYPES.CallExpression, + callee, + arguments: args, + optional: false, + }); + } + if (node.typeArguments) { result.typeParameters = this.convertTypeArgumentsToTypeParameters( node.typeArguments, @@ -1728,6 +1792,7 @@ export class Converter { } case SyntaxKind.NewExpression: { + // NOTE - NewExpression cannot have an optional chain in it const result = this.createNode(node, { type: AST_NODE_TYPES.NewExpression, callee: this.convertChild(node.expression), @@ -1743,6 +1808,14 @@ export class Converter { return result; } + case SyntaxKind.ConditionalExpression: + return this.createNode(node, { + type: AST_NODE_TYPES.ConditionalExpression, + test: this.convertChild(node.condition), + consequent: this.convertChild(node.whenTrue), + alternate: this.convertChild(node.whenFalse), + }); + case SyntaxKind.MetaProperty: { return this.createNode(node, { type: AST_NODE_TYPES.MetaProperty, @@ -2367,15 +2440,19 @@ export class Converter { case SyntaxKind.TypePredicate: { const result = this.createNode(node, { type: AST_NODE_TYPES.TSTypePredicate, + asserts: node.assertsModifier !== undefined, parameterName: this.convertChild(node.parameterName), - typeAnnotation: this.convertTypeAnnotation(node.type, node), + typeAnnotation: null, }); /** * Specific fix for type-guard location data */ - result.typeAnnotation.loc = result.typeAnnotation.typeAnnotation.loc; - result.typeAnnotation.range = - result.typeAnnotation.typeAnnotation.range; + if (node.type) { + result.typeAnnotation = this.convertTypeAnnotation(node.type, node); + result.typeAnnotation.loc = result.typeAnnotation.typeAnnotation.loc; + result.typeAnnotation.range = + result.typeAnnotation.typeAnnotation.range; + } return result; } diff --git a/packages/typescript-estree/src/WatchCompilerHostOfConfigFile.ts b/packages/typescript-estree/src/create-program/WatchCompilerHostOfConfigFile.ts similarity index 100% rename from packages/typescript-estree/src/WatchCompilerHostOfConfigFile.ts rename to packages/typescript-estree/src/create-program/WatchCompilerHostOfConfigFile.ts diff --git a/packages/typescript-estree/src/create-program/createDefaultProgram.ts b/packages/typescript-estree/src/create-program/createDefaultProgram.ts new file mode 100644 index 000000000000..383d10bd43d3 --- /dev/null +++ b/packages/typescript-estree/src/create-program/createDefaultProgram.ts @@ -0,0 +1,59 @@ +import debug from 'debug'; +import path from 'path'; +import * as ts from 'typescript'; // leave this as * as ts so people using util package don't need syntheticDefaultImports +import { Extra } from '../parser-options'; +import { + getTsconfigPath, + DEFAULT_COMPILER_OPTIONS, + ASTAndProgram, +} from './shared'; + +const log = debug('typescript-eslint:typescript-estree:createDefaultProgram'); + +/** + * @param code The code of the file being linted + * @param options The config object + * @param extra.tsconfigRootDir The root directory for relative tsconfig paths + * @param extra.projects Provided tsconfig paths + * @returns If found, returns the source file corresponding to the code and the containing program + */ +function createDefaultProgram( + code: string, + extra: Extra, +): ASTAndProgram | undefined { + log('Getting default program for: %s', extra.filePath || 'unnamed file'); + + if (!extra.projects || extra.projects.length !== 1) { + return undefined; + } + + const tsconfigPath = getTsconfigPath(extra.projects[0], extra); + + const commandLine = ts.getParsedCommandLineOfConfigFile( + tsconfigPath, + DEFAULT_COMPILER_OPTIONS, + { ...ts.sys, onUnRecoverableConfigFileDiagnostic: () => {} }, + ); + + if (!commandLine) { + return undefined; + } + + const compilerHost = ts.createCompilerHost(commandLine.options, true); + const oldReadFile = compilerHost.readFile; + compilerHost.readFile = (fileName: string): string | undefined => + path.normalize(fileName) === path.normalize(extra.filePath) + ? code + : oldReadFile(fileName); + + const program = ts.createProgram( + [extra.filePath], + commandLine.options, + compilerHost, + ); + const ast = program.getSourceFile(extra.filePath); + + return ast && { ast, program }; +} + +export { createDefaultProgram }; diff --git a/packages/typescript-estree/src/create-program/createIsolatedProgram.ts b/packages/typescript-estree/src/create-program/createIsolatedProgram.ts new file mode 100644 index 000000000000..296aee2e5ba0 --- /dev/null +++ b/packages/typescript-estree/src/create-program/createIsolatedProgram.ts @@ -0,0 +1,85 @@ +import debug from 'debug'; +import * as ts from 'typescript'; // leave this as * as ts so people using util package don't need syntheticDefaultImports +import { Extra } from '../parser-options'; +import { + ASTAndProgram, + DEFAULT_COMPILER_OPTIONS, + getScriptKind, +} from './shared'; + +const log = debug('typescript-eslint:typescript-estree:createIsolatedProgram'); + +/** + * @param code The code of the file being linted + * @returns Returns a new source file and program corresponding to the linted code + */ +function createIsolatedProgram(code: string, extra: Extra): ASTAndProgram { + log( + 'Getting isolated program in %s mode for: %s', + extra.jsx ? 'TSX' : 'TS', + extra.filePath, + ); + + const compilerHost: ts.CompilerHost = { + fileExists() { + return true; + }, + getCanonicalFileName() { + return extra.filePath; + }, + getCurrentDirectory() { + return ''; + }, + getDirectories() { + return []; + }, + getDefaultLibFileName() { + return 'lib.d.ts'; + }, + + // TODO: Support Windows CRLF + getNewLine() { + return '\n'; + }, + getSourceFile(filename: string) { + return ts.createSourceFile( + filename, + code, + ts.ScriptTarget.Latest, + true, + getScriptKind(extra, filename), + ); + }, + readFile() { + return undefined; + }, + useCaseSensitiveFileNames() { + return true; + }, + writeFile() { + return null; + }, + }; + + const program = ts.createProgram( + [extra.filePath], + { + noResolve: true, + target: ts.ScriptTarget.Latest, + jsx: extra.jsx ? ts.JsxEmit.Preserve : undefined, + ...DEFAULT_COMPILER_OPTIONS, + }, + compilerHost, + ); + + const ast = program.getSourceFile(extra.filePath); + if (!ast) { + throw new Error( + 'Expected an ast to be returned for the single-file isolated program.', + ); + } + + return { ast, program }; +} + +export { createIsolatedProgram }; diff --git a/packages/typescript-estree/src/create-program/createProjectProgram.ts b/packages/typescript-estree/src/create-program/createProjectProgram.ts new file mode 100644 index 000000000000..9864c20cea01 --- /dev/null +++ b/packages/typescript-estree/src/create-program/createProjectProgram.ts @@ -0,0 +1,72 @@ +import debug from 'debug'; +import path from 'path'; +import { getProgramsForProjects } from './createWatchProgram'; +import { firstDefined } from '../node-utils'; +import { Extra } from '../parser-options'; +import { ASTAndProgram } from './shared'; + +const log = debug('typescript-eslint:typescript-estree:createProjectProgram'); + +/** + * @param code The code of the file being linted + * @param options The config object + * @returns If found, returns the source file corresponding to the code and the containing program + */ +function createProjectProgram( + code: string, + createDefaultProgram: boolean, + extra: Extra, +): ASTAndProgram | undefined { + log('Creating project program for: %s', extra.filePath); + + const astAndProgram = firstDefined( + getProgramsForProjects(code, extra.filePath, extra), + currentProgram => { + const ast = currentProgram.getSourceFile(extra.filePath); + return ast && { ast, program: currentProgram }; + }, + ); + + if (!astAndProgram && !createDefaultProgram) { + // the file was either not matched within the tsconfig, or the extension wasn't expected + const errorLines = [ + '"parserOptions.project" has been set for @typescript-eslint/parser.', + `The file does not match your project config: ${path.relative( + process.cwd(), + extra.filePath, + )}.`, + ]; + let hasMatchedAnError = false; + + const fileExtension = path.extname(extra.filePath); + if (!['.ts', '.tsx', '.js', '.jsx'].includes(fileExtension)) { + const nonStandardExt = `The extension for the file (${fileExtension}) is non-standard`; + if (extra.extraFileExtensions && extra.extraFileExtensions.length > 0) { + if (!extra.extraFileExtensions.includes(fileExtension)) { + errorLines.push( + `${nonStandardExt}. It should be added to your existing "parserOptions.extraFileExtensions".`, + ); + hasMatchedAnError = true; + } + } else { + errorLines.push( + `${nonStandardExt}. You should add "parserOptions.extraFileExtensions" to your config.`, + ); + hasMatchedAnError = true; + } + } + + if (!hasMatchedAnError) { + errorLines.push( + 'The file must be included in at least one of the projects provided.', + ); + hasMatchedAnError = true; + } + + throw new Error(errorLines.join('\n')); + } + + return astAndProgram; +} + +export { createProjectProgram }; diff --git a/packages/typescript-estree/src/create-program/createSourceFile.ts b/packages/typescript-estree/src/create-program/createSourceFile.ts new file mode 100644 index 000000000000..d1ab5f98d21a --- /dev/null +++ b/packages/typescript-estree/src/create-program/createSourceFile.ts @@ -0,0 +1,24 @@ +import debug from 'debug'; +import * as ts from 'typescript'; // leave this as * as ts so people using util package don't need syntheticDefaultImports +import { Extra } from '../parser-options'; +import { getScriptKind } from './shared'; + +const log = debug('typescript-eslint:typescript-estree:createSourceFile'); + +function createSourceFile(code: string, extra: Extra): ts.SourceFile { + log( + 'Getting AST without type information in %s mode for: %s', + extra.jsx ? 'TSX' : 'TS', + extra.filePath, + ); + + return ts.createSourceFile( + extra.filePath, + code, + ts.ScriptTarget.Latest, + /* setParentNodes */ true, + getScriptKind(extra), + ); +} + +export { createSourceFile }; diff --git a/packages/typescript-estree/src/create-program/createWatchProgram.ts b/packages/typescript-estree/src/create-program/createWatchProgram.ts new file mode 100644 index 000000000000..9223107986af --- /dev/null +++ b/packages/typescript-estree/src/create-program/createWatchProgram.ts @@ -0,0 +1,477 @@ +import debug from 'debug'; +import fs from 'fs'; +import path from 'path'; +import * as ts from 'typescript'; // leave this as * as ts so people using util package don't need syntheticDefaultImports +import { Extra } from '../parser-options'; +import { WatchCompilerHostOfConfigFile } from './WatchCompilerHostOfConfigFile'; +import { + canonicalDirname, + CanonicalPath, + getTsconfigPath, + DEFAULT_COMPILER_OPTIONS, + getCanonicalFileName, +} from './shared'; + +const log = debug('typescript-eslint:typescript-estree:createWatchProgram'); + +/** + * Maps tsconfig paths to their corresponding file contents and resulting watches + */ +const knownWatchProgramMap = new Map< + CanonicalPath, + ts.WatchOfConfigFile +>(); + +/** + * Maps file/folder paths to their set of corresponding watch callbacks + * There may be more than one per file/folder if a file/folder is shared between projects + */ +const fileWatchCallbackTrackingMap = new Map< + CanonicalPath, + Set +>(); +const folderWatchCallbackTrackingMap = new Map< + CanonicalPath, + Set +>(); + +/** + * Stores the list of known files for each program + */ +const programFileListCache = new Map>(); + +/** + * Caches the last modified time of the tsconfig files + */ +const tsconfigLastModifiedTimestampCache = new Map(); + +const parsedFilesSeenHash = new Map(); + +/** + * Clear all of the parser caches. + * This should only be used in testing to ensure the parser is clean between tests. + */ +function clearCaches(): void { + knownWatchProgramMap.clear(); + fileWatchCallbackTrackingMap.clear(); + folderWatchCallbackTrackingMap.clear(); + parsedFilesSeenHash.clear(); + programFileListCache.clear(); + tsconfigLastModifiedTimestampCache.clear(); +} + +function saveWatchCallback( + trackingMap: Map>, +) { + return ( + fileName: string, + callback: ts.FileWatcherCallback, + ): ts.FileWatcher => { + const normalizedFileName = getCanonicalFileName(path.normalize(fileName)); + const watchers = ((): Set => { + let watchers = trackingMap.get(normalizedFileName); + if (!watchers) { + watchers = new Set(); + trackingMap.set(normalizedFileName, watchers); + } + return watchers; + })(); + watchers.add(callback); + + return { + close: (): void => { + watchers.delete(callback); + }, + }; + }; +} + +/** + * Holds information about the file currently being linted + */ +const currentLintOperationState: { code: string; filePath: CanonicalPath } = { + code: '', + filePath: '' as CanonicalPath, +}; + +/** + * Appropriately report issues found when reading a config file + * @param diagnostic The diagnostic raised when creating a program + */ +function diagnosticReporter(diagnostic: ts.Diagnostic): void { + throw new Error( + ts.flattenDiagnosticMessageText(diagnostic.messageText, ts.sys.newLine), + ); +} + +/** + * Hash content for compare content. + * @param content hashed contend + * @returns hashed result + */ +function createHash(content: string): string { + // No ts.sys in browser environments. + if (ts.sys && ts.sys.createHash) { + return ts.sys.createHash(content); + } + return content; +} + +/** + * Calculate project environments using options provided by consumer and paths from config + * @param code The code being linted + * @param filePathIn The path of the file being parsed + * @param extra.tsconfigRootDir The root directory for relative tsconfig paths + * @param extra.projects Provided tsconfig paths + * @returns The programs corresponding to the supplied tsconfig paths + */ +function getProgramsForProjects( + code: string, + filePathIn: string, + extra: Extra, +): ts.Program[] { + const filePath = getCanonicalFileName(filePathIn); + const results = []; + + // preserve reference to code and file being linted + currentLintOperationState.code = code; + currentLintOperationState.filePath = filePath; + + // Update file version if necessary + const fileWatchCallbacks = fileWatchCallbackTrackingMap.get(filePath); + const codeHash = createHash(code); + if ( + parsedFilesSeenHash.get(filePath) !== codeHash && + fileWatchCallbacks && + fileWatchCallbacks.size > 0 + ) { + fileWatchCallbacks.forEach(cb => + cb(filePath, ts.FileWatcherEventKind.Changed), + ); + } + + /* + * before we go into the process of attempting to find and update every program + * see if we know of a program that contains this file + */ + for (const rawTsconfigPath of extra.projects) { + const tsconfigPath = getTsconfigPath(rawTsconfigPath, extra); + const existingWatch = knownWatchProgramMap.get(tsconfigPath); + if (!existingWatch) { + continue; + } + + let fileList = programFileListCache.get(tsconfigPath); + let updatedProgram: ts.Program | null = null; + if (!fileList) { + updatedProgram = existingWatch.getProgram().getProgram(); + fileList = new Set( + updatedProgram.getRootFileNames().map(f => getCanonicalFileName(f)), + ); + programFileListCache.set(tsconfigPath, fileList); + } + + if (fileList.has(filePath)) { + log('Found existing program for file. %s', filePath); + + updatedProgram = + updatedProgram || existingWatch.getProgram().getProgram(); + // sets parent pointers in source files + updatedProgram.getTypeChecker(); + + return [updatedProgram]; + } + } + log( + 'File did not belong to any existing programs, moving to create/update. %s', + filePath, + ); + + /* + * We don't know of a program that contains the file, this means that either: + * - the required program hasn't been created yet, or + * - the file is new/renamed, and the program hasn't been updated. + */ + for (const rawTsconfigPath of extra.projects) { + const tsconfigPath = getTsconfigPath(rawTsconfigPath, extra); + + const existingWatch = knownWatchProgramMap.get(tsconfigPath); + + if (existingWatch) { + const updatedProgram = maybeInvalidateProgram( + existingWatch, + filePath, + tsconfigPath, + ); + if (!updatedProgram) { + continue; + } + + // sets parent pointers in source files + updatedProgram.getTypeChecker(); + results.push(updatedProgram); + + continue; + } + + const programWatch = createWatchProgram(tsconfigPath, extra); + const program = programWatch.getProgram().getProgram(); + + // cache watch program and return current program + knownWatchProgramMap.set(tsconfigPath, programWatch); + results.push(program); + } + + return results; +} + +function createWatchProgram( + tsconfigPath: string, + extra: Extra, +): ts.WatchOfConfigFile { + log('Creating watch program for %s.', tsconfigPath); + + // create compiler host + const watchCompilerHost = ts.createWatchCompilerHost( + tsconfigPath, + DEFAULT_COMPILER_OPTIONS, + ts.sys, + ts.createSemanticDiagnosticsBuilderProgram, + diagnosticReporter, + /*reportWatchStatus*/ () => {}, + ) as WatchCompilerHostOfConfigFile; + + // ensure readFile reads the code being linted instead of the copy on disk + const oldReadFile = watchCompilerHost.readFile; + watchCompilerHost.readFile = (filePathIn, encoding): string | undefined => { + const filePath = getCanonicalFileName(filePathIn); + const fileContent = + path.normalize(filePath) === + path.normalize(currentLintOperationState.filePath) + ? currentLintOperationState.code + : oldReadFile(filePath, encoding); + if (fileContent) { + parsedFilesSeenHash.set(filePath, createHash(fileContent)); + } + return fileContent; + }; + + // ensure process reports error on failure instead of exiting process immediately + watchCompilerHost.onUnRecoverableConfigFileDiagnostic = diagnosticReporter; + + // ensure process doesn't emit programs + watchCompilerHost.afterProgramCreate = (program): void => { + // report error if there are any errors in the config file + const configFileDiagnostics = program + .getConfigFileParsingDiagnostics() + .filter( + diag => + diag.category === ts.DiagnosticCategory.Error && diag.code !== 18003, + ); + if (configFileDiagnostics.length > 0) { + diagnosticReporter(configFileDiagnostics[0]); + } + }; + + /* + * From the CLI, the file watchers won't matter, as the files will be parsed once and then forgotten. + * When running from an IDE, these watchers will let us tell typescript about changes. + * + * ESLint IDE plugins will send us unfinished file content as the user types (before it's saved to disk). + * We use the file watchers to tell typescript about this latest file content. + * + * When files are created (or renamed), we won't know about them because we have no filesystem watchers attached. + * We use the folder watchers to tell typescript it needs to go and find new files in the project folders. + */ + watchCompilerHost.watchFile = saveWatchCallback(fileWatchCallbackTrackingMap); + watchCompilerHost.watchDirectory = saveWatchCallback( + folderWatchCallbackTrackingMap, + ); + + // allow files with custom extensions to be included in program (uses internal ts api) + const oldOnDirectoryStructureHostCreate = + watchCompilerHost.onCachedDirectoryStructureHostCreate; + watchCompilerHost.onCachedDirectoryStructureHostCreate = (host): void => { + const oldReadDirectory = host.readDirectory; + host.readDirectory = ( + path, + extensions, + exclude, + include, + depth, + ): string[] => + oldReadDirectory( + path, + !extensions ? undefined : extensions.concat(extra.extraFileExtensions), + exclude, + include, + depth, + ); + oldOnDirectoryStructureHostCreate(host); + }; + + /* + * The watch change callbacks TS provides us all have a 250ms delay before firing + * https://github.com/microsoft/TypeScript/blob/b845800bdfcc81c8c72e2ac6fdc2c1df0cdab6f9/src/compiler/watch.ts#L1013 + * + * We live in a synchronous world, so we can't wait for that. + * This is a bit of a hack, but it lets us immediately force updates when we detect a tsconfig or directory change + */ + const oldSetTimeout = watchCompilerHost.setTimeout; + watchCompilerHost.setTimeout = (cb, ms, ...args): unknown => { + if (ms === 250) { + cb(); + return null; + } + + return oldSetTimeout && oldSetTimeout(cb, ms, ...args); + }; + + return ts.createWatchProgram(watchCompilerHost); +} + +function hasTSConfigChanged(tsconfigPath: CanonicalPath): boolean { + const stat = fs.statSync(tsconfigPath); + const lastModifiedAt = stat.mtimeMs; + const cachedLastModifiedAt = tsconfigLastModifiedTimestampCache.get( + tsconfigPath, + ); + + tsconfigLastModifiedTimestampCache.set(tsconfigPath, lastModifiedAt); + + if (cachedLastModifiedAt === undefined) { + return false; + } + + return Math.abs(cachedLastModifiedAt - lastModifiedAt) > Number.EPSILON; +} + +function maybeInvalidateProgram( + existingWatch: ts.WatchOfConfigFile, + filePath: CanonicalPath, + tsconfigPath: CanonicalPath, +): ts.Program | null { + /* + * By calling watchProgram.getProgram(), it will trigger a resync of the program based on + * whatever new file content we've given it from our input. + */ + let updatedProgram = existingWatch.getProgram().getProgram(); + + // In case this change causes problems in larger real world codebases + // Provide an escape hatch so people don't _have_ to revert to an older version + if (process.env.TSESTREE_NO_INVALIDATION === 'true') { + return updatedProgram; + } + + if (hasTSConfigChanged(tsconfigPath)) { + /* + * If the stat of the tsconfig has changed, that could mean the include/exclude/files lists has changed + * We need to make sure typescript knows this so it can update appropriately + */ + log('tsconfig has changed - triggering program update. %s', tsconfigPath); + fileWatchCallbackTrackingMap + .get(tsconfigPath)! + .forEach(cb => cb(tsconfigPath, ts.FileWatcherEventKind.Changed)); + + // tsconfig change means that the file list more than likely changed, so clear the cache + programFileListCache.delete(tsconfigPath); + } + + let sourceFile = updatedProgram.getSourceFile(filePath); + if (sourceFile) { + return updatedProgram; + } + /* + * Missing source file means our program's folder structure might be out of date. + * So we need to tell typescript it needs to update the correct folder. + */ + log('File was not found in program - triggering folder update. %s', filePath); + + // Find the correct directory callback by climbing the folder tree + const currentDir = canonicalDirname(filePath); + let current: CanonicalPath | null = null; + let next = currentDir; + let hasCallback = false; + while (current !== next) { + current = next; + const folderWatchCallbacks = folderWatchCallbackTrackingMap.get(current); + if (folderWatchCallbacks) { + folderWatchCallbacks.forEach(cb => + cb(currentDir, ts.FileWatcherEventKind.Changed), + ); + hasCallback = true; + break; + } + + next = canonicalDirname(current); + } + if (!hasCallback) { + /* + * No callback means the paths don't matchup - so no point returning any program + * this will signal to the caller to skip this program + */ + log('No callback found for file, not part of this program. %s', filePath); + return null; + } + + // directory update means that the file list more than likely changed, so clear the cache + programFileListCache.delete(tsconfigPath); + + // force the immediate resync + updatedProgram = existingWatch.getProgram().getProgram(); + sourceFile = updatedProgram.getSourceFile(filePath); + if (sourceFile) { + return updatedProgram; + } + + /* + * At this point we're in one of two states: + * - The file isn't supposed to be in this program due to exclusions + * - The file is new, and was renamed from an old, included filename + * + * For the latter case, we need to tell typescript that the old filename is now deleted + */ + log( + 'File was still not found in program after directory update - checking file deletions. %s', + filePath, + ); + + const rootFilenames = updatedProgram.getRootFileNames(); + // use find because we only need to "delete" one file to cause typescript to do a full resync + const deletedFile = rootFilenames.find(file => !fs.existsSync(file)); + if (!deletedFile) { + // There are no deleted files, so it must be the former case of the file not belonging to this program + return null; + } + + const fileWatchCallbacks = fileWatchCallbackTrackingMap.get( + getCanonicalFileName(deletedFile), + ); + if (!fileWatchCallbacks) { + // shouldn't happen, but just in case + log('Could not find watch callbacks for root file. %s', deletedFile); + return updatedProgram; + } + + log('Marking file as deleted. %s', deletedFile); + fileWatchCallbacks.forEach(cb => + cb(deletedFile, ts.FileWatcherEventKind.Deleted), + ); + + // deleted files means that the file list _has_ changed, so clear the cache + programFileListCache.delete(tsconfigPath); + + updatedProgram = existingWatch.getProgram().getProgram(); + sourceFile = updatedProgram.getSourceFile(filePath); + if (sourceFile) { + return updatedProgram; + } + + log( + 'File was still not found in program after deletion check, assuming it is not part of this program. %s', + filePath, + ); + return null; +} + +export { clearCaches, createWatchProgram, getProgramsForProjects }; diff --git a/packages/typescript-estree/src/create-program/shared.ts b/packages/typescript-estree/src/create-program/shared.ts new file mode 100644 index 000000000000..6509997094f9 --- /dev/null +++ b/packages/typescript-estree/src/create-program/shared.ts @@ -0,0 +1,81 @@ +import path from 'path'; +import * as ts from 'typescript'; // leave this as * as ts so people using util package don't need syntheticDefaultImports +import { Extra } from '../parser-options'; + +interface ASTAndProgram { + ast: ts.SourceFile; + program: ts.Program | undefined; +} + +/** + * Default compiler options for program generation from single root file + */ +const DEFAULT_COMPILER_OPTIONS: ts.CompilerOptions = { + allowNonTsExtensions: true, + allowJs: true, + checkJs: true, + noEmit: true, + // extendedDiagnostics: true, +}; + +// This narrows the type so we can be sure we're passing canonical names in the correct places +type CanonicalPath = string & { __brand: unknown }; +// typescript doesn't provide a ts.sys implementation for browser environments +const useCaseSensitiveFileNames = + ts.sys !== undefined ? ts.sys.useCaseSensitiveFileNames : true; +const getCanonicalFileName = useCaseSensitiveFileNames + ? (filePath: string): CanonicalPath => + path.normalize(filePath) as CanonicalPath + : (filePath: string): CanonicalPath => + path.normalize(filePath).toLowerCase() as CanonicalPath; + +function getTsconfigPath(tsconfigPath: string, extra: Extra): CanonicalPath { + return getCanonicalFileName( + path.isAbsolute(tsconfigPath) + ? tsconfigPath + : path.join(extra.tsconfigRootDir || process.cwd(), tsconfigPath), + ); +} + +function canonicalDirname(p: CanonicalPath): CanonicalPath { + return path.dirname(p) as CanonicalPath; +} + +function getScriptKind( + extra: Extra, + filePath: string = extra.filePath, +): ts.ScriptKind { + const extension = path.extname(filePath).toLowerCase(); + // note - we respect the user's extension when it is known we could override it and force it to match their + // jsx setting, but that could create weird situations where we throw parse errors when TSC doesn't + switch (extension) { + case '.ts': + return ts.ScriptKind.TS; + + case '.tsx': + return ts.ScriptKind.TSX; + + case '.js': + return ts.ScriptKind.JS; + + case '.jsx': + return ts.ScriptKind.JSX; + + case '.json': + return ts.ScriptKind.JSON; + + default: + // unknown extension, force typescript to ignore the file extension, and respect the user's setting + return extra.jsx ? ts.ScriptKind.TSX : ts.ScriptKind.TS; + } +} + +export { + ASTAndProgram, + canonicalDirname, + CanonicalPath, + DEFAULT_COMPILER_OPTIONS, + getCanonicalFileName, + getScriptKind, + getTsconfigPath, +}; diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index c23daf6e3173..da0034ee6ae0 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -20,9 +20,12 @@ const ASSIGNMENT_OPERATORS: ts.AssignmentOperator[] = [ SyntaxKind.CaretEqualsToken, ]; -const LOGICAL_OPERATORS: ts.LogicalOperator[] = [ +const LOGICAL_OPERATORS: ( + | ts.LogicalOperator + | ts.SyntaxKind.QuestionQuestionToken)[] = [ SyntaxKind.BarBarToken, SyntaxKind.AmpersandAmpersandToken, + SyntaxKind.QuestionQuestionToken, ]; const TOKEN_TO_TEXT: { readonly [P in ts.SyntaxKind]?: string } = { @@ -87,6 +90,8 @@ const TOKEN_TO_TEXT: { readonly [P in ts.SyntaxKind]?: string } = { [SyntaxKind.NewKeyword]: 'new', [SyntaxKind.ImportKeyword]: 'import', [SyntaxKind.ReadonlyKeyword]: 'readonly', + [SyntaxKind.QuestionQuestionToken]: '??', + [SyntaxKind.QuestionDotToken]: '?.', }; /** @@ -94,10 +99,10 @@ const TOKEN_TO_TEXT: { readonly [P in ts.SyntaxKind]?: string } = { * @param operator the operator token * @returns is assignment */ -export function isAssignmentOperator( - operator: ts.Token, +export function isAssignmentOperator( + operator: ts.Token, ): boolean { - return ASSIGNMENT_OPERATORS.includes(operator.kind); + return (ASSIGNMENT_OPERATORS as ts.SyntaxKind[]).includes(operator.kind); } /** @@ -105,10 +110,10 @@ export function isAssignmentOperator( * @param operator the operator token * @returns is a logical operator */ -export function isLogicalOperator( - operator: ts.Token, +export function isLogicalOperator( + operator: ts.Token, ): boolean { - return LOGICAL_OPERATORS.includes(operator.kind); + return (LOGICAL_OPERATORS as ts.SyntaxKind[]).includes(operator.kind); } /** @@ -195,10 +200,8 @@ export function isJSDocComment(node: ts.Node): boolean { * @param operator the operator token * @returns the binary expression type */ -export function getBinaryExpressionType( - // can be any operator - // eslint-disable-next-line @typescript-eslint/no-explicit-any - operator: ts.Token, +export function getBinaryExpressionType( + operator: ts.Token, ): | AST_NODE_TYPES.AssignmentExpression | AST_NODE_TYPES.LogicalExpression @@ -609,41 +612,6 @@ export function convertTokens(ast: ts.SourceFile): TSESTree.Token[] { return result; } -/** - * Get container token node between range - * @param ast the AST object - * @param start The index at which the comment starts. - * @param end The index at which the comment ends. - * @returns typescript container token - * @private - */ -export function getNodeContainer( - ast: ts.SourceFile, - start: number, - end: number, -): ts.Node { - let container: ts.Node | null = null; - - /** - * @param node the ts.Node - */ - function walk(node: ts.Node): void { - const nodeStart = node.pos; - const nodeEnd = node.end; - - if (start >= nodeStart && end <= nodeEnd) { - if (isToken(node)) { - container = node; - } else { - node.getChildren().forEach(walk); - } - } - } - walk(ast); - - return container!; -} - export interface TSError { index: number; lineNumber: number; diff --git a/packages/typescript-estree/src/parser-options.ts b/packages/typescript-estree/src/parser-options.ts index 77a649f6f309..63e14a2fffb1 100644 --- a/packages/typescript-estree/src/parser-options.ts +++ b/packages/typescript-estree/src/parser-options.ts @@ -2,41 +2,42 @@ import { Program } from 'typescript'; import { TSESTree, TSNode } from './ts-estree'; export interface Extra { - errorOnUnknownASTType: boolean; - errorOnTypeScriptSyntacticAndSemanticIssues: boolean; - useJSXTextNode: boolean; - tokens: null | TSESTree.Token[]; - comment: boolean; code: string; - range: boolean; - loc: boolean; + comment: boolean; comments: TSESTree.Comment[]; - strict: boolean; + createDefaultProgram: boolean; + errorOnTypeScriptSyntacticAndSemanticIssues: boolean; + errorOnUnknownASTType: boolean; + extraFileExtensions: string[]; + filePath: string; jsx: boolean; + loc: boolean; log: Function; + preserveNodeMaps?: boolean; projects: string[]; + range: boolean; + strict: boolean; + tokens: null | TSESTree.Token[]; tsconfigRootDir: string; - extraFileExtensions: string[]; - preserveNodeMaps?: boolean; - createDefaultProgram: boolean; + useJSXTextNode: boolean; } export interface TSESTreeOptions { - range?: boolean; - loc?: boolean; - tokens?: boolean; comment?: boolean; - jsx?: boolean; - errorOnUnknownASTType?: boolean; + createDefaultProgram?: boolean; errorOnTypeScriptSyntacticAndSemanticIssues?: boolean; - useJSXTextNode?: boolean; + errorOnUnknownASTType?: boolean; + extraFileExtensions?: string[]; + filePath?: string; + jsx?: boolean; + loc?: boolean; loggerFn?: Function | false; + preserveNodeMaps?: boolean; project?: string | string[]; - filePath?: string; + range?: boolean; + tokens?: boolean; tsconfigRootDir?: string; - extraFileExtensions?: string[]; - preserveNodeMaps?: boolean; - createDefaultProgram?: boolean; + useJSXTextNode?: boolean; } // This lets us use generics to type the return value, and removes the need to diff --git a/packages/typescript-estree/src/parser.ts b/packages/typescript-estree/src/parser.ts index 882a8bbff7e5..0ef765ed8b64 100644 --- a/packages/typescript-estree/src/parser.ts +++ b/packages/typescript-estree/src/parser.ts @@ -1,69 +1,47 @@ -import path from 'path'; import semver from 'semver'; import * as ts from 'typescript'; // leave this as * as ts so people using util package don't need syntheticDefaultImports import { sync as globSync } from 'glob'; import isGlob from 'is-glob'; import { astConverter } from './ast-converter'; import { convertError } from './convert'; -import { firstDefined } from './node-utils'; +import { createDefaultProgram } from './create-program/createDefaultProgram'; +import { createIsolatedProgram } from './create-program/createIsolatedProgram'; +import { createProjectProgram } from './create-program/createProjectProgram'; +import { createSourceFile } from './create-program/createSourceFile'; import { Extra, TSESTreeOptions, ParserServices } from './parser-options'; import { getFirstSemanticOrSyntacticError } from './semantic-or-syntactic-errors'; import { TSESTree } from './ts-estree'; -import { - calculateProjectParserOptions, - createProgram, - defaultCompilerOptions, -} from './tsconfig-parser'; /** * This needs to be kept in sync with the top-level README.md in the * typescript-eslint monorepo */ -const SUPPORTED_TYPESCRIPT_VERSIONS = '>=3.2.1 <3.7.0'; +const SUPPORTED_TYPESCRIPT_VERSIONS = '>=3.2.1 <3.8.0'; +/* + * The semver package will ignore prerelease ranges, and we don't want to explicitly document every one + * List them all separately here, so we can automatically create the full string + */ +const SUPPORTED_PRERELEASE_RANGES = ['>3.7.0-dev.0', '3.7.1-rc']; const ACTIVE_TYPESCRIPT_VERSION = ts.version; const isRunningSupportedTypeScriptVersion = semver.satisfies( ACTIVE_TYPESCRIPT_VERSION, - SUPPORTED_TYPESCRIPT_VERSIONS, + [SUPPORTED_TYPESCRIPT_VERSIONS] + .concat(SUPPORTED_PRERELEASE_RANGES) + .join(' || '), ); let extra: Extra; let warnedAboutTSVersion = false; -/** - * Compute the filename based on the parser options. - * - * Even if jsx option is set in typescript compiler, filename still has to - * contain .tsx file extension. - * - * @param options Parser options - */ -function getFileName({ jsx }: { jsx?: boolean }): string { - return jsx ? 'estree.tsx' : 'estree.ts'; -} +function enforceString(code: unknown): string { + /** + * Ensure the source code is a string + */ + if (typeof code !== 'string') { + return String(code); + } -/** - * Resets the extra config object - */ -function resetExtra(): void { - extra = { - tokens: null, - range: false, - loc: false, - comment: false, - comments: [], - strict: false, - jsx: false, - useJSXTextNode: false, - log: console.log, // eslint-disable-line no-console - projects: [], - errorOnUnknownASTType: false, - errorOnTypeScriptSyntacticAndSemanticIssues: false, - code: '', - tsconfigRootDir: process.cwd(), - extraFileExtensions: [], - preserveNodeMaps: undefined, - createDefaultProgram: false, - }; + return code; } interface ASTAndProgram { @@ -74,154 +52,60 @@ interface ASTAndProgram { /** * @param code The code of the file being linted * @param options The config object - * @returns If found, returns the source file corresponding to the code and the containing program + * @param shouldProvideParserServices True iff the program should be attempted to be calculated from provided tsconfig files + * @returns Returns a source file and program corresponding to the linted code */ -function getASTFromProject( +function getProgramAndAST( code: string, - options: TSESTreeOptions, - createDefaultProgram: boolean, + shouldProvideParserServices: boolean, + shouldCreateDefaultProgram: boolean, ): ASTAndProgram | undefined { - const filePath = options.filePath || getFileName(options); - const astAndProgram = firstDefined( - calculateProjectParserOptions(code, filePath, extra), - currentProgram => { - const ast = currentProgram.getSourceFile(filePath); - return ast && { ast, program: currentProgram }; - }, + return ( + (shouldProvideParserServices && + createProjectProgram(code, shouldCreateDefaultProgram, extra)) || + (shouldProvideParserServices && + shouldCreateDefaultProgram && + createDefaultProgram(code, extra)) || + createIsolatedProgram(code, extra) ); - - if (!astAndProgram && !createDefaultProgram) { - // the file was either not matched within the tsconfig, or the extension wasn't expected - const errorLines = [ - '"parserOptions.project" has been set for @typescript-eslint/parser.', - `The file does not match your project config: ${filePath}.`, - ]; - let hasMatchedAnError = false; - - const fileExtension = path.extname(filePath); - if (!['.ts', '.tsx', '.js', '.jsx'].includes(fileExtension)) { - const nonStandardExt = `The extension for the file (${fileExtension}) is non-standard`; - if (extra.extraFileExtensions && extra.extraFileExtensions.length > 0) { - if (!extra.extraFileExtensions.includes(fileExtension)) { - errorLines.push( - `${nonStandardExt}. It should be added to your existing "parserOptions.extraFileExtensions".`, - ); - hasMatchedAnError = true; - } - } else { - errorLines.push( - `${nonStandardExt}. You should add "parserOptions.extraFileExtensions" to your config.`, - ); - hasMatchedAnError = true; - } - } - - if (!hasMatchedAnError) { - errorLines.push( - 'The file must be included in at least one of the projects provided.', - ); - hasMatchedAnError = true; - } - - throw new Error(errorLines.join('\n')); - } - - return astAndProgram; } /** - * @param code The code of the file being linted - * @param options The config object - * @returns If found, returns the source file corresponding to the code and the containing program + * Compute the filename based on the parser options. + * + * Even if jsx option is set in typescript compiler, filename still has to + * contain .tsx file extension. + * + * @param options Parser options */ -function getASTAndDefaultProject( - code: string, - options: TSESTreeOptions, -): ASTAndProgram | undefined { - const fileName = options.filePath || getFileName(options); - const program = createProgram(code, fileName, extra); - const ast = program && program.getSourceFile(fileName); - return ast && { ast, program }; +function getFileName({ jsx }: { jsx?: boolean } = {}): string { + return jsx ? 'estree.tsx' : 'estree.ts'; } /** - * @param code The code of the file being linted - * @returns Returns a new source file and program corresponding to the linted code + * Resets the extra config object */ -function createNewProgram(code: string): ASTAndProgram { - const FILENAME = getFileName(extra); - - const compilerHost: ts.CompilerHost = { - fileExists() { - return true; - }, - getCanonicalFileName() { - return FILENAME; - }, - getCurrentDirectory() { - return ''; - }, - getDirectories() { - return []; - }, - getDefaultLibFileName() { - return 'lib.d.ts'; - }, - - // TODO: Support Windows CRLF - getNewLine() { - return '\n'; - }, - getSourceFile(filename: string) { - return ts.createSourceFile(filename, code, ts.ScriptTarget.Latest, true); - }, - readFile() { - return undefined; - }, - useCaseSensitiveFileNames() { - return true; - }, - writeFile() { - return null; - }, +function resetExtra(): void { + extra = { + code: '', + comment: false, + comments: [], + createDefaultProgram: false, + errorOnTypeScriptSyntacticAndSemanticIssues: false, + errorOnUnknownASTType: false, + extraFileExtensions: [], + filePath: getFileName(), + jsx: false, + loc: false, + log: console.log, // eslint-disable-line no-console + preserveNodeMaps: undefined, + projects: [], + range: false, + strict: false, + tokens: null, + tsconfigRootDir: process.cwd(), + useJSXTextNode: false, }; - - const program = ts.createProgram( - [FILENAME], - { - noResolve: true, - target: ts.ScriptTarget.Latest, - jsx: extra.jsx ? ts.JsxEmit.Preserve : undefined, - ...defaultCompilerOptions, - }, - compilerHost, - ); - - const ast = program.getSourceFile(FILENAME)!; - - return { ast, program }; -} - -/** - * @param code The code of the file being linted - * @param options The config object - * @param shouldProvideParserServices True iff the program should be attempted to be calculated from provided tsconfig files - * @returns Returns a source file and program corresponding to the linted code - */ -function getProgramAndAST( - code: string, - options: TSESTreeOptions, - shouldProvideParserServices: boolean, - createDefaultProgram: boolean, -): ASTAndProgram | undefined { - return ( - (shouldProvideParserServices && - getASTFromProject(code, options, createDefaultProgram)) || - (shouldProvideParserServices && - createDefaultProgram && - getASTAndDefaultProject(code, options)) || - createNewProgram(code) - ); } function applyParserOptionsToExtra(options: TSESTreeOptions): void { @@ -230,12 +114,14 @@ function applyParserOptionsToExtra(options: TSESTreeOptions): void { */ extra.range = typeof options.range === 'boolean' && options.range; extra.loc = typeof options.loc === 'boolean' && options.loc; + /** * Track tokens in the AST */ if (typeof options.tokens === 'boolean' && options.tokens) { extra.tokens = []; } + /** * Track comments in the AST */ @@ -243,12 +129,23 @@ function applyParserOptionsToExtra(options: TSESTreeOptions): void { extra.comment = true; extra.comments = []; } + /** * Enable JSX - note the applicable file extension is still required */ if (typeof options.jsx === 'boolean' && options.jsx) { extra.jsx = true; } + + /** + * Get the file extension + */ + if (typeof options.filePath === 'string' && options.filePath !== '') { + extra.filePath = options.filePath; + } else { + extra.filePath = getFileName(extra); + } + /** * The JSX AST changed the node type for string literals * inside a JSX Element from `Literal` to `JSXText`. @@ -259,6 +156,7 @@ function applyParserOptionsToExtra(options: TSESTreeOptions): void { if (typeof options.useJSXTextNode === 'boolean' && options.useJSXTextNode) { extra.useJSXTextNode = true; } + /** * Allow the user to cause the parser to error if it encounters an unknown AST Node Type * (used in testing) @@ -269,6 +167,7 @@ function applyParserOptionsToExtra(options: TSESTreeOptions): void { ) { extra.errorOnUnknownASTType = true; } + /** * Allow the user to override the function used for logging */ @@ -287,25 +186,32 @@ function applyParserOptionsToExtra(options: TSESTreeOptions): void { extra.projects = options.project; } + if (typeof options.tsconfigRootDir === 'string') { + extra.tsconfigRootDir = options.tsconfigRootDir; + } + // Transform glob patterns into paths if (extra.projects) { extra.projects = extra.projects.reduce( (projects, project) => - projects.concat(isGlob(project) ? globSync(project) : project), + projects.concat( + isGlob(project) + ? globSync(project, { + cwd: extra.tsconfigRootDir || process.cwd(), + }) + : project, + ), [], ); } - if (typeof options.tsconfigRootDir === 'string') { - extra.tsconfigRootDir = options.tsconfigRootDir; - } - if ( Array.isArray(options.extraFileExtensions) && options.extraFileExtensions.every(ext => typeof ext === 'string') ) { extra.extraFileExtensions = options.extraFileExtensions; } + /** * Allow the user to enable or disable the preservation of the AST node maps * during the conversion process. @@ -326,17 +232,20 @@ function applyParserOptionsToExtra(options: TSESTreeOptions): void { function warnAboutTSVersion(): void { if (!isRunningSupportedTypeScriptVersion && !warnedAboutTSVersion) { - const border = '============='; - const versionWarning = [ - border, - 'WARNING: You are currently running a version of TypeScript which is not officially supported by typescript-estree.', - 'You may find that it works just fine, or you may not.', - `SUPPORTED TYPESCRIPT VERSIONS: ${SUPPORTED_TYPESCRIPT_VERSIONS}`, - `YOUR TYPESCRIPT VERSION: ${ACTIVE_TYPESCRIPT_VERSION}`, - 'Please only submit bug reports when using the officially supported version.', - border, - ]; - extra.log(versionWarning.join('\n\n')); + const isTTY = typeof process === undefined ? false : process.stdout.isTTY; + if (isTTY) { + const border = '============='; + const versionWarning = [ + border, + 'WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.', + 'You may find that it works just fine, or you may not.', + `SUPPORTED TYPESCRIPT VERSIONS: ${SUPPORTED_TYPESCRIPT_VERSIONS}`, + `YOUR TYPESCRIPT VERSION: ${ACTIVE_TYPESCRIPT_VERSION}`, + 'Please only submit bug reports when using the officially supported version.', + border, + ]; + extra.log(versionWarning.join('\n\n')); + } warnedAboutTSVersion = true; } } @@ -345,12 +254,12 @@ function warnAboutTSVersion(): void { // Parser //------------------------------------------------------------------------------ -export type AST = TSESTree.Program & +type AST = TSESTree.Program & (T['range'] extends true ? { range: [number, number] } : {}) & (T['tokens'] extends true ? { tokens: TSESTree.Token[] } : {}) & (T['comment'] extends true ? { comments: TSESTree.Comment[] } : {}); -export interface ParseAndGenerateServicesResult { +interface ParseAndGenerateServicesResult { ast: AST; services: ParserServices; } @@ -359,9 +268,9 @@ export interface ParseAndGenerateServicesResult { // Public //------------------------------------------------------------------------------ -export const version: string = require('../package.json').version; +const version: string = require('../package.json').version; -export function parse( +function parse( code: string, options?: T, ): AST { @@ -369,6 +278,7 @@ export function parse( * Reset the parse configuration */ resetExtra(); + /** * Ensure users do not attempt to use parse() when they need parseAndGenerateServices() */ @@ -377,34 +287,31 @@ export function parse( `"errorOnTypeScriptSyntacticAndSemanticIssues" is only supported for parseAndGenerateServices()`, ); } + /** * Ensure the source code is a string, and store a reference to it */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - if (typeof code !== 'string' && !((code as any) instanceof String)) { - code = String(code); - } + code = enforceString(code); extra.code = code; + /** * Apply the given parser options */ if (typeof options !== 'undefined') { applyParserOptionsToExtra(options); } + /** * Warn if the user is using an unsupported version of TypeScript */ warnAboutTSVersion(); + /** * Create a ts.SourceFile directly, no ts.Program is needed for a simple * parse */ - const ast = ts.createSourceFile( - getFileName(extra), - code, - ts.ScriptTarget.Latest, - /* setParentNodes */ true, - ); + const ast = createSourceFile(code, extra); + /** * Convert the TypeScript AST to an ESTree-compatible one */ @@ -412,21 +319,21 @@ export function parse( return estree as AST; } -export function parseAndGenerateServices< - T extends TSESTreeOptions = TSESTreeOptions ->(code: string, options: T): ParseAndGenerateServicesResult { +function parseAndGenerateServices( + code: string, + options: T, +): ParseAndGenerateServicesResult { /** * Reset the parse configuration */ resetExtra(); + /** * Ensure the source code is a string, and store a reference to it */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - if (typeof code !== 'string' && !((code as any) instanceof String)) { - code = String(code); - } + code = enforceString(code); extra.code = code; + /** * Apply the given parser options */ @@ -440,10 +347,12 @@ export function parseAndGenerateServices< extra.errorOnTypeScriptSyntacticAndSemanticIssues = true; } } + /** * Warn if the user is using an unsupported version of TypeScript */ warnAboutTSVersion(); + /** * Generate a full ts.Program in order to be able to provide parser * services, such as type-checking @@ -452,10 +361,10 @@ export function parseAndGenerateServices< extra.projects && extra.projects.length > 0; const { ast, program } = getProgramAndAST( code, - options, shouldProvideParserServices, extra.createDefaultProgram, )!; + /** * Determine whether or not two-way maps of converted AST nodes should be preserved * during the conversion process @@ -464,11 +373,13 @@ export function parseAndGenerateServices< extra.preserveNodeMaps !== undefined ? extra.preserveNodeMaps : shouldProvideParserServices; + /** * Convert the TypeScript AST to an ESTree-compatible one, and optionally preserve * mappings between converted and original AST nodes */ const { estree, astMaps } = astConverter(ast, extra, shouldPreserveNodeMaps); + /** * Even if TypeScript parsed the source code ok, and we had no problems converting the AST, * there may be other syntactic or semantic issues in the code that we can optionally report on. @@ -479,6 +390,7 @@ export function parseAndGenerateServices< throw convertError(error); } } + /** * Return the converted AST and additional parser services */ @@ -498,5 +410,16 @@ export function parseAndGenerateServices< }; } -export { TSESTreeOptions, ParserServices }; +export { + AST, + parse, + parseAndGenerateServices, + ParseAndGenerateServicesResult, + ParserServices, + TSESTreeOptions, + version, +}; +export { simpleTraverse } from './simple-traverse'; +export { visitorKeys } from './visitor-keys'; export * from './ts-estree'; +export { clearCaches } from './create-program/createWatchProgram'; diff --git a/packages/parser/src/simple-traverse.ts b/packages/typescript-estree/src/simple-traverse.ts similarity index 95% rename from packages/parser/src/simple-traverse.ts rename to packages/typescript-estree/src/simple-traverse.ts index a616f239a7b4..e21d24d0de8b 100644 --- a/packages/parser/src/simple-traverse.ts +++ b/packages/typescript-estree/src/simple-traverse.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '@typescript-eslint/typescript-estree'; +import { TSESTree } from './ts-estree'; import { visitorKeys } from './visitor-keys'; // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/packages/typescript-estree/src/ts-estree/ast-node-types.ts b/packages/typescript-estree/src/ts-estree/ast-node-types.ts index 4ae1b5dcf866..13f2485819f0 100644 --- a/packages/typescript-estree/src/ts-estree/ast-node-types.ts +++ b/packages/typescript-estree/src/ts-estree/ast-node-types.ts @@ -47,7 +47,6 @@ export enum AST_NODE_TYPES { JSXFragment = 'JSXFragment', JSXIdentifier = 'JSXIdentifier', JSXMemberExpression = 'JSXMemberExpression', - JSXNamespacedName = 'JSXNamespacedName', // https://github.com/Microsoft/TypeScript/issues/7411 JSXOpeningElement = 'JSXOpeningElement', JSXOpeningFragment = 'JSXOpeningFragment', JSXSpreadAttribute = 'JSXSpreadAttribute', @@ -62,6 +61,8 @@ export enum AST_NODE_TYPES { NewExpression = 'NewExpression', ObjectExpression = 'ObjectExpression', ObjectPattern = 'ObjectPattern', + OptionalCallExpression = 'OptionalCallExpression', + OptionalMemberExpression = 'OptionalMemberExpression', Program = 'Program', Property = 'Property', RestElement = 'RestElement', @@ -135,7 +136,6 @@ export enum AST_NODE_TYPES { TSProtectedKeyword = 'TSProtectedKeyword', TSPublicKeyword = 'TSPublicKeyword', TSQualifiedName = 'TSQualifiedName', - TSQuestionToken = 'TSQuestionToken', TSReadonlyKeyword = 'TSReadonlyKeyword', TSRestType = 'TSRestType', TSStaticKeyword = 'TSStaticKeyword', diff --git a/packages/typescript-estree/src/ts-estree/ts-estree.ts b/packages/typescript-estree/src/ts-estree/ts-estree.ts index d4361bf3d5c0..10cd0b7e0fb2 100644 --- a/packages/typescript-estree/src/ts-estree/ts-estree.ts +++ b/packages/typescript-estree/src/ts-estree/ts-estree.ts @@ -139,6 +139,8 @@ export type Node = | NewExpression | ObjectExpression | ObjectPattern + | OptionalCallExpression + | OptionalMemberExpression | Program | Property | RestElement @@ -323,6 +325,8 @@ export type LeftHandSideExpression = | FunctionExpression | LiteralExpression | MemberExpression + | OptionalCallExpression + | OptionalMemberExpression | PrimaryExpression | TaggedTemplateExpression | TSNonNullExpression @@ -426,8 +430,8 @@ export type TypeNode = | TSTupleType | TSTypeLiteral | TSTypeOperator - | TSTypeReference | TSTypePredicate + | TSTypeReference | TSTypeQuery | TSUndefinedKeyword | TSUnionType @@ -465,9 +469,10 @@ interface ClassDeclarationBase extends BaseNode { interface ClassPropertyBase extends BaseNode { key: PropertyName; - value: Expression; + value: Expression | null; computed: boolean; static: boolean; + declare: boolean; readonly?: boolean; decorators?: Decorator[]; accessibility?: Accessibility; @@ -591,11 +596,19 @@ export interface BreakStatement extends BaseNode { label: Identifier | null; } -export interface CallExpression extends BaseNode { - type: AST_NODE_TYPES.CallExpression; +interface CallExpressionBase extends BaseNode { callee: LeftHandSideExpression; arguments: Expression[]; typeParameters?: TSTypeParameterInstantiation; + optional: boolean; +} +export interface CallExpression extends CallExpressionBase { + type: AST_NODE_TYPES.CallExpression; + optional: false; +} +export interface OptionalCallExpression extends CallExpressionBase { + type: AST_NODE_TYPES.OptionalCallExpression; + optional: boolean; } export interface CatchClause extends BaseNode { @@ -843,11 +856,19 @@ export interface LogicalExpression extends BinaryExpressionBase { type: AST_NODE_TYPES.LogicalExpression; } -export interface MemberExpression extends BaseNode { - type: AST_NODE_TYPES.MemberExpression; +interface MemberExpressionBase extends BaseNode { object: LeftHandSideExpression; property: Expression | Identifier; - computed?: boolean; + computed: boolean; + optional: boolean; +} +export interface MemberExpression extends MemberExpressionBase { + type: AST_NODE_TYPES.MemberExpression; + optional: false; +} +export interface OptionalMemberExpression extends MemberExpressionBase { + type: AST_NODE_TYPES.OptionalMemberExpression; + optional: boolean; } export interface MetaProperty extends BaseNode { @@ -1346,8 +1367,9 @@ export interface TSTypeParameterInstantiation extends BaseNode { export interface TSTypePredicate extends BaseNode { type: AST_NODE_TYPES.TSTypePredicate; + asserts: boolean; parameterName: Identifier | TSThisType; - typeAnnotation: TSTypeAnnotation; + typeAnnotation: TSTypeAnnotation | null; } export interface TSTypeQuery extends BaseNode { diff --git a/packages/typescript-estree/src/tsconfig-parser.ts b/packages/typescript-estree/src/tsconfig-parser.ts deleted file mode 100644 index e6ef356b6f30..000000000000 --- a/packages/typescript-estree/src/tsconfig-parser.ts +++ /dev/null @@ -1,237 +0,0 @@ -import path from 'path'; -import * as ts from 'typescript'; // leave this as * as ts so people using util package don't need syntheticDefaultImports -import { Extra } from './parser-options'; -import { WatchCompilerHostOfConfigFile } from './WatchCompilerHostOfConfigFile'; - -//------------------------------------------------------------------------------ -// Environment calculation -//------------------------------------------------------------------------------ - -/** - * Default compiler options for program generation from single root file - */ -export const defaultCompilerOptions: ts.CompilerOptions = { - allowNonTsExtensions: true, - allowJs: true, - checkJs: true, - noEmit: true, - // extendedDiagnostics: true, -}; - -/** - * Maps tsconfig paths to their corresponding file contents and resulting watches - */ -const knownWatchProgramMap = new Map< - string, - ts.WatchOfConfigFile ->(); - -/** - * Maps file paths to their set of corresponding watch callbacks - * There may be more than one per file if a file is shared between projects - */ -const watchCallbackTrackingMap = new Map(); - -const parsedFilesSeen = new Set(); - -/** - * Clear tsconfig caches. - * Primarily used for testing. - */ -export function clearCaches(): void { - knownWatchProgramMap.clear(); - watchCallbackTrackingMap.clear(); - parsedFilesSeen.clear(); -} - -/** - * Holds information about the file currently being linted - */ -const currentLintOperationState = { - code: '', - filePath: '', -}; - -/** - * Appropriately report issues found when reading a config file - * @param diagnostic The diagnostic raised when creating a program - */ -function diagnosticReporter(diagnostic: ts.Diagnostic): void { - throw new Error( - ts.flattenDiagnosticMessageText(diagnostic.messageText, ts.sys.newLine), - ); -} - -const noopFileWatcher = { close: (): void => {} }; - -function getTsconfigPath(tsconfigPath: string, extra: Extra): string { - return path.isAbsolute(tsconfigPath) - ? tsconfigPath - : path.join(extra.tsconfigRootDir || process.cwd(), tsconfigPath); -} - -/** - * Calculate project environments using options provided by consumer and paths from config - * @param code The code being linted - * @param filePath The path of the file being parsed - * @param extra.tsconfigRootDir The root directory for relative tsconfig paths - * @param extra.projects Provided tsconfig paths - * @returns The programs corresponding to the supplied tsconfig paths - */ -export function calculateProjectParserOptions( - code: string, - filePath: string, - extra: Extra, -): ts.Program[] { - const results = []; - - // preserve reference to code and file being linted - currentLintOperationState.code = code; - currentLintOperationState.filePath = filePath; - - // Update file version if necessary - // TODO: only update when necessary, currently marks as changed on every lint - const watchCallback = watchCallbackTrackingMap.get(filePath); - if (parsedFilesSeen.has(filePath) && typeof watchCallback !== 'undefined') { - watchCallback(filePath, ts.FileWatcherEventKind.Changed); - } - - for (const rawTsconfigPath of extra.projects) { - const tsconfigPath = getTsconfigPath(rawTsconfigPath, extra); - - const existingWatch = knownWatchProgramMap.get(tsconfigPath); - - if (typeof existingWatch !== 'undefined') { - // get new program (updated if necessary) - const updatedProgram = existingWatch.getProgram().getProgram(); - updatedProgram.getTypeChecker(); // sets parent pointers in source files - results.push(updatedProgram); - - continue; - } - - // create compiler host - const watchCompilerHost = ts.createWatchCompilerHost( - tsconfigPath, - defaultCompilerOptions, - ts.sys, - ts.createSemanticDiagnosticsBuilderProgram, - diagnosticReporter, - /*reportWatchStatus*/ () => {}, - ) as WatchCompilerHostOfConfigFile; - - // ensure readFile reads the code being linted instead of the copy on disk - const oldReadFile = watchCompilerHost.readFile; - watchCompilerHost.readFile = (filePath, encoding): string | undefined => - path.normalize(filePath) === - path.normalize(currentLintOperationState.filePath) - ? currentLintOperationState.code - : oldReadFile(filePath, encoding); - - // ensure process reports error on failure instead of exiting process immediately - watchCompilerHost.onUnRecoverableConfigFileDiagnostic = diagnosticReporter; - - // ensure process doesn't emit programs - watchCompilerHost.afterProgramCreate = (program): void => { - // report error if there are any errors in the config file - const configFileDiagnostics = program - .getConfigFileParsingDiagnostics() - .filter( - diag => - diag.category === ts.DiagnosticCategory.Error && - diag.code !== 18003, - ); - if (configFileDiagnostics.length > 0) { - diagnosticReporter(configFileDiagnostics[0]); - } - }; - - // register callbacks to trigger program updates without using fileWatchers - watchCompilerHost.watchFile = (fileName, callback): ts.FileWatcher => { - const normalizedFileName = path.normalize(fileName); - watchCallbackTrackingMap.set(normalizedFileName, callback); - return { - close: (): void => { - watchCallbackTrackingMap.delete(normalizedFileName); - }, - }; - }; - - // ensure fileWatchers aren't created for directories - watchCompilerHost.watchDirectory = (): ts.FileWatcher => noopFileWatcher; - - // allow files with custom extensions to be included in program (uses internal ts api) - const oldOnDirectoryStructureHostCreate = - watchCompilerHost.onCachedDirectoryStructureHostCreate; - watchCompilerHost.onCachedDirectoryStructureHostCreate = (host): void => { - const oldReadDirectory = host.readDirectory; - host.readDirectory = ( - path, - extensions, - exclude, - include, - depth, - ): string[] => - oldReadDirectory( - path, - !extensions - ? undefined - : extensions.concat(extra.extraFileExtensions), - exclude, - include, - depth, - ); - oldOnDirectoryStructureHostCreate(host); - }; - - // create program - const programWatch = ts.createWatchProgram(watchCompilerHost); - const program = programWatch.getProgram().getProgram(); - - // cache watch program and return current program - knownWatchProgramMap.set(tsconfigPath, programWatch); - results.push(program); - } - - parsedFilesSeen.add(filePath); - return results; -} - -/** - * Create program from single root file. Requires a single tsconfig to be specified. - * @param code The code being linted - * @param filePath The file being linted - * @param extra.tsconfigRootDir The root directory for relative tsconfig paths - * @param extra.projects Provided tsconfig paths - * @returns The program containing just the file being linted and associated library files - */ -export function createProgram( - code: string, - filePath: string, - extra: Extra, -): ts.Program | undefined { - if (!extra.projects || extra.projects.length !== 1) { - return undefined; - } - - const tsconfigPath = getTsconfigPath(extra.projects[0], extra); - - const commandLine = ts.getParsedCommandLineOfConfigFile( - tsconfigPath, - defaultCompilerOptions, - { ...ts.sys, onUnRecoverableConfigFileDiagnostic: () => {} }, - ); - - if (!commandLine) { - return undefined; - } - - const compilerHost = ts.createCompilerHost(commandLine.options, true); - const oldReadFile = compilerHost.readFile; - compilerHost.readFile = (fileName: string): string | undefined => - path.normalize(fileName) === path.normalize(filePath) - ? code - : oldReadFile(fileName); - - return ts.createProgram([filePath], commandLine.options, compilerHost); -} diff --git a/packages/parser/src/visitor-keys.ts b/packages/typescript-estree/src/visitor-keys.ts similarity index 97% rename from packages/parser/src/visitor-keys.ts rename to packages/typescript-estree/src/visitor-keys.ts index 7cc4aa9d8935..e594fb240e05 100644 --- a/packages/parser/src/visitor-keys.ts +++ b/packages/typescript-estree/src/visitor-keys.ts @@ -43,6 +43,8 @@ export const visitorKeys = eslintVisitorKeys.unionWith({ BigIntLiteral: [], ClassProperty: ['decorators', 'key', 'typeAnnotation', 'value'], Decorator: ['expression'], + OptionalCallExpression: eslintVisitorKeys.KEYS.CallExpression, + OptionalMemberExpression: eslintVisitorKeys.KEYS.MemberExpression, TSAbstractClassProperty: ['decorators', 'key', 'typeAnnotation', 'value'], TSAbstractKeyword: [], TSAbstractMethodDefinition: ['key', 'value'], @@ -99,7 +101,6 @@ export const visitorKeys = eslintVisitorKeys.unionWith({ TSProtectedKeyword: [], TSPublicKeyword: [], TSQualifiedName: ['left', 'right'], - TSQuestionToken: [], TSReadonlyKeyword: [], TSRestType: ['typeAnnotation'], TSStaticKeyword: [], diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index dfa1b047f36b..557ac0c11ce5 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -1,8 +1,8 @@ +import jsxKnownIssues from '@typescript-eslint/shared-fixtures/dist/jsx-known-issues'; import fs from 'fs'; import glob from 'glob'; import path from 'path'; -import jsxKnownIssues from '../../../shared-fixtures/jsx-known-issues'; import { isJSXFileType } from '../../tools/test-utils'; interface Fixture { @@ -123,7 +123,18 @@ const jsxFilesWithKnownIssues = jsxKnownIssues.map(f => f.replace('jsx/', '')); */ jsxFilesWithKnownIssues.push('invalid-no-tag-name'); -tester.addFixturePatternConfig('javascript/basics'); +tester.addFixturePatternConfig('javascript/basics', { + ignore: [ + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'delete-expression', + 'new-with-member-expression', + 'update-expression', + ], +}); tester.addFixturePatternConfig('comments', { ignore: [ @@ -133,6 +144,18 @@ tester.addFixturePatternConfig('comments', { */ 'no-comment-template', // Purely AST diffs 'template-string-block', // Purely AST diffs + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'block-trailing-comment', + 'jsx-with-greather-than', + 'jsx-with-operators', + 'surrounding-call-comments', + 'switch-fallthrough-comment-in-function', + 'switch-fallthrough-comment', + 'switch-no-default-comment-in-nested-functions', ], }); @@ -140,13 +163,31 @@ tester.addFixturePatternConfig('javascript/templateStrings', { ignore: ['**/*'], }); -tester.addFixturePatternConfig('javascript/arrayLiteral'); +tester.addFixturePatternConfig('javascript/arrayLiteral', { + ignore: [ + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'array-literal-in-lhs', + ], +}); tester.addFixturePatternConfig('javascript/simple-literals'); tester.addFixturePatternConfig('javascript/directives'); -tester.addFixturePatternConfig('javascript/experimentalObjectRestSpread'); +tester.addFixturePatternConfig('javascript/experimentalObjectRestSpread', { + ignore: [ + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'property-spread', + ], +}); tester.addFixturePatternConfig('javascript/arrowFunctions', { ignore: [ @@ -177,6 +218,13 @@ tester.addFixturePatternConfig('javascript/arrowFunctions', { 'error-strict-param-names', 'error-strict-param-no-paren-arguments', 'error-strict-param-no-paren-eval', + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'as-param-with-params', + 'as-param', ], }); tester.addFixturePatternConfig('javascript/function', { @@ -193,7 +241,18 @@ tester.addFixturePatternConfig('javascript/bigIntLiterals'); tester.addFixturePatternConfig('javascript/binaryLiterals'); tester.addFixturePatternConfig('javascript/blockBindings'); -tester.addFixturePatternConfig('javascript/callExpression'); +tester.addFixturePatternConfig('javascript/callExpression', { + ignore: [ + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'call-expression-with-array', + 'call-expression-with-object', + 'mixed-expression', + ], +}); tester.addFixturePatternConfig('javascript/classes', { ignore: [ @@ -212,7 +271,18 @@ tester.addFixturePatternConfig('javascript/commaOperator'); tester.addFixturePatternConfig('javascript/defaultParams'); -tester.addFixturePatternConfig('javascript/destructuring'); +tester.addFixturePatternConfig('javascript/destructuring', { + ignore: [ + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'array-member', + 'call-expression-destruction-array', + 'call-expression-destruction-object', + ], +}); tester.addFixturePatternConfig('javascript/destructuring-and-arrowFunctions'); tester.addFixturePatternConfig('javascript/destructuring-and-blockBindings'); tester.addFixturePatternConfig('javascript/destructuring-and-defaultParams'); @@ -220,11 +290,29 @@ tester.addFixturePatternConfig('javascript/destructuring-and-forOf'); tester.addFixturePatternConfig('javascript/destructuring-and-spread'); tester.addFixturePatternConfig('javascript/experimentalAsyncIteration'); -tester.addFixturePatternConfig('javascript/experimentalDynamicImport'); +tester.addFixturePatternConfig('javascript/experimentalDynamicImport', { + ignore: [ + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'dynamic-import', + ], +}); tester.addFixturePatternConfig('javascript/exponentiationOperators'); tester.addFixturePatternConfig('javascript/experimentalOptionalCatchBinding'); -tester.addFixturePatternConfig('javascript/for'); +tester.addFixturePatternConfig('javascript/for', { + ignore: [ + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'for-with-function', + ], +}); tester.addFixturePatternConfig('javascript/forIn', { ignore: [ /** @@ -242,14 +330,54 @@ tester.addFixturePatternConfig('javascript/forIn', { * SyntaxError: Invalid left-hand side in for-loop */ 'for-in-with-bare-assigment', + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'for-in-with-const', + 'for-in-with-var', ], }); -tester.addFixturePatternConfig('javascript/forOf'); -tester.addFixturePatternConfig('javascript/generators'); +tester.addFixturePatternConfig('javascript/forOf', { + ignore: [ + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'for-of-array', + 'for-of-object', + 'for-of-with-var-and-braces', + 'for-of-with-var-and-no-braces', + 'invalid-for-of-with-const-and-no-braces', + 'invalid-for-of-with-let-and-no-braces', + ], +}); +tester.addFixturePatternConfig('javascript/generators', { + ignore: [ + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'async-generator-method', + 'yield-without-value-in-call', + ], +}); tester.addFixturePatternConfig('javascript/globalReturn'); tester.addFixturePatternConfig('javascript/hexLiterals'); -tester.addFixturePatternConfig('javascript/importMeta'); +tester.addFixturePatternConfig('javascript/importMeta', { + ignore: [ + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'simple-import-meta', + ], +}); tester.addFixturePatternConfig('javascript/labels'); tester.addFixturePatternConfig('javascript/modules', { @@ -266,10 +394,16 @@ tester.addFixturePatternConfig('javascript/modules', { 'export-named-specifier', 'export-named-specifiers-comma', 'export-named-specifiers', + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'error-strict', ], ignoreSourceType: [ 'error-function', - 'error-strict', + // 'error-strict', 'error-delete', 'invalid-await', ], @@ -277,7 +411,16 @@ tester.addFixturePatternConfig('javascript/modules', { tester.addFixturePatternConfig('javascript/newTarget'); -tester.addFixturePatternConfig('javascript/objectLiteral'); +tester.addFixturePatternConfig('javascript/objectLiteral', { + ignore: [ + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'object-literal-in-lhs', + ], +}); tester.addFixturePatternConfig('javascript/objectLiteralComputedProperties'); tester.addFixturePatternConfig('javascript/objectLiteralDuplicateProperties', { @@ -314,7 +457,18 @@ tester.addFixturePatternConfig('javascript/regex'); tester.addFixturePatternConfig('javascript/regexUFlag'); tester.addFixturePatternConfig('javascript/regexYFlag'); tester.addFixturePatternConfig('javascript/restParams'); -tester.addFixturePatternConfig('javascript/spread'); +tester.addFixturePatternConfig('javascript/spread', { + ignore: [ + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'multi-function-call', + 'not-final-param', + 'simple-function-call', + ], +}); tester.addFixturePatternConfig('javascript/unicodeCodePointEscapes'); /* ================================================== */ @@ -332,6 +486,14 @@ tester.addFixturePatternConfig('jsx-useJSXTextNode'); tester.addFixturePatternConfig('tsx', { fileType: 'tsx', + ignore: [ + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'react-typed-props', + ], }); /* ================================================== */ @@ -415,6 +577,51 @@ tester.addFixturePatternConfig('typescript/basics', { * SyntaxError: 'abstract' modifier can only appear on a class, method, or property declaration. */ 'abstract-class-with-abstract-constructor', + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'optional-chain', + 'optional-chain-with-parens', + 'optional-chain-call', + 'optional-chain-call-with-parens', + 'optional-chain-element-access', + 'optional-chain-element-access-with-parens', + 'async-function-expression', + 'class-with-accessibility-modifiers', + 'class-with-mixin', + 'global-this', + 'never-type-param', + 'non-null-assertion-operator', + 'type-parameters-comments', + // type assertion function + 'type-assertion-in-function', + 'type-assertion-in-arrow-function', + 'type-assertion-in-interface', + 'type-assertion-in-method', + 'type-guard-in-arrow-function', + 'type-guard-in-function', + 'type-guard-in-interface', + 'type-guard-in-method', + 'type-assertion-with-guard-in-arrow-function', + 'type-assertion-with-guard-in-function', + 'type-assertion-with-guard-in-interface', + 'type-assertion-with-guard-in-method', + // declare class properties + 'abstract-class-with-abstract-properties', + 'abstract-class-with-abstract-readonly-property', + 'abstract-class-with-declare-properties', + 'class-with-declare-properties', + 'class-with-definite-assignment', + 'class-with-optional-computed-property', + 'class-with-optional-properties', + 'class-with-optional-property-undefined', + 'class-with-property-function', + 'class-with-property-values', + 'class-with-readonly-property', + 'object-with-escaped-properties', + 'type-reference-comments', ], ignoreSourceType: [ /** @@ -429,12 +636,40 @@ tester.addFixturePatternConfig('typescript/basics', { tester.addFixturePatternConfig('typescript/decorators/accessor-decorators', { fileType: 'ts', + ignore: [ + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'accessor-decorator-factory-instance-member', + 'accessor-decorator-factory-static-member', + 'accessor-decorator-instance-member', + 'accessor-decorator-static-member', + ], }); tester.addFixturePatternConfig('typescript/decorators/class-decorators', { fileType: 'ts', + ignore: [ + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'class-decorator-factory', + ], }); tester.addFixturePatternConfig('typescript/decorators/method-decorators', { fileType: 'ts', + ignore: [ + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'method-decorator-factory-instance-member', + 'method-decorator-factory-static-member', + ], }); tester.addFixturePatternConfig('typescript/decorators/parameter-decorators', { fileType: 'ts', @@ -445,10 +680,31 @@ tester.addFixturePatternConfig('typescript/decorators/parameter-decorators', { */ 'parameter-array-pattern-decorator', 'parameter-rest-element-decorator', + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'parameter-decorator-constructor', + 'parameter-decorator-decorator-instance-member', + 'parameter-decorator-decorator-static-member', + 'parameter-object-pattern-decorator', ], }); tester.addFixturePatternConfig('typescript/decorators/property-decorators', { fileType: 'ts', + ignore: [ + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'property-decorator-factory-instance-member', + 'property-decorator-factory-static-member', + // declare class properties + 'property-decorator-instance-member', + 'property-decorator-static-member', + ], }); tester.addFixturePatternConfig('typescript/expressions', { @@ -458,6 +714,12 @@ tester.addFixturePatternConfig('typescript/expressions', { * there is difference in range between babel and ts-estree */ 'tagged-template-expression-type-arguments', + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'call-expression-type-arguments', ], }); @@ -497,6 +759,12 @@ tester.addFixturePatternConfig('typescript/types', { * Babel parse error: https://github.com/babel/babel/pull/9431 */ 'function-with-array-destruction', + /** + * TS 3.7 feature changes + * TODO: remove me when babel adds support + */ + // optional chaining + 'this-type-expanded', ], }); diff --git a/packages/typescript-estree/tests/ast-alignment/parse.ts b/packages/typescript-estree/tests/ast-alignment/parse.ts index 7fba488c78d8..b236e5a9861b 100644 --- a/packages/typescript-estree/tests/ast-alignment/parse.ts +++ b/packages/typescript-estree/tests/ast-alignment/parse.ts @@ -31,6 +31,8 @@ function parseWithBabelParser(text: string, jsx = true): any { 'estree', 'bigInt', 'importMeta', + 'optionalChaining', + 'nullishCoalescingOperator', ]; if (jsx) { plugins.push('jsx'); diff --git a/packages/typescript-estree/tests/fixtures/invalidFileErrors/tsconfig.json b/packages/typescript-estree/tests/fixtures/invalidFileErrors/tsconfig.json index de5d69d736c8..9f3d8cab0be7 100644 --- a/packages/typescript-estree/tests/fixtures/invalidFileErrors/tsconfig.json +++ b/packages/typescript-estree/tests/fixtures/invalidFileErrors/tsconfig.json @@ -1,4 +1,7 @@ { + "compilerOptions": { + "allowJs": true + }, "include": [ "ts/included.ts", "ts/included.tsx", diff --git a/packages/typescript-estree/tests/lib/__snapshots__/comments.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/comments.ts.snap index b90f5eb45487..5671b2447c12 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/comments.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/comments.ts.snap @@ -36,6 +36,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 6, 9, @@ -11708,6 +11709,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 24, 37, @@ -12589,6 +12591,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 24, 37, @@ -14189,6 +14192,7 @@ Object { "line": 3, }, }, + "optional": false, "range": Array [ 36, 41, @@ -15965,6 +15969,7 @@ Object { "line": 6, }, }, + "optional": false, "range": Array [ 82, 88, @@ -16485,6 +16490,7 @@ Object { "line": 7, }, }, + "optional": false, "range": Array [ 126, 132, @@ -18181,6 +18187,7 @@ Object { ], "type": "Identifier", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -18277,6 +18284,7 @@ Object { ], "type": "Identifier", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -18301,6 +18309,7 @@ Object { ], "type": "MemberExpression", }, + "optional": false, "property": Object { "left": Object { "computed": false, @@ -18344,6 +18353,7 @@ Object { ], "type": "Identifier", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -18368,6 +18378,7 @@ Object { ], "type": "MemberExpression", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -18463,6 +18474,7 @@ Object { "line": 6, }, }, + "optional": false, "range": Array [ 161, 218, @@ -18552,6 +18564,7 @@ Object { ], "type": "Identifier", }, + "optional": false, "property": Object { "loc": Object { "end": Object { diff --git a/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap index 5bf7a0b6adc3..a73f908a3623 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap @@ -66,12 +66,14 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 0, 6, ], "type": "CallExpression", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -628,6 +630,7 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 0, 13, @@ -946,6 +949,7 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 0, 17, @@ -11542,6 +11546,7 @@ Object { ], "type": "Identifier", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -13162,6 +13167,7 @@ Object { ], "type": "Identifier", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -15832,6 +15838,7 @@ Object { "line": 5, }, }, + "optional": false, "range": Array [ 35, 38, @@ -17972,6 +17979,7 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 0, 7, @@ -18177,6 +18185,7 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 0, 7, @@ -18453,6 +18462,7 @@ Object { ], "type": "ThisExpression", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -18487,6 +18497,7 @@ Object { "line": 3, }, }, + "optional": false, "range": Array [ 36, 53, @@ -18556,6 +18567,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 17, 62, @@ -18625,6 +18637,7 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 0, 70, @@ -22743,6 +22756,7 @@ Object { "line": 3, }, }, + "optional": false, "range": Array [ 27, 34, @@ -38075,6 +38089,7 @@ Object { ], "type": "Identifier", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -39051,6 +39066,7 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 0, 10, @@ -39291,6 +39307,7 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 0, 10, @@ -80454,12 +80471,14 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 0, 13, ], "type": "CallExpression", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -80494,6 +80513,7 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 0, 24, @@ -83775,6 +83795,7 @@ Object { ], "type": "Identifier", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -91233,6 +91254,7 @@ Object { ], "type": "Identifier", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -91267,6 +91289,7 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 16, 33, @@ -95213,6 +95236,7 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 25, 35, @@ -95964,6 +95988,7 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 22, 32, @@ -97229,6 +97254,7 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 20, 30, @@ -97615,6 +97641,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 22, 35, @@ -98891,6 +98918,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 22, 35, @@ -99296,6 +99324,7 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 53, 63, @@ -100454,6 +100483,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 25, 38, @@ -100875,6 +100905,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 23, 36, @@ -101243,6 +101274,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 25, 38, @@ -101611,6 +101643,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 23, 36, @@ -103778,6 +103811,7 @@ Object { "line": 3, }, }, + "optional": false, "range": Array [ 53, 56, @@ -106000,6 +106034,7 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 16, 25, @@ -107221,6 +107256,7 @@ Object { ], "type": "MetaProperty", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -108920,6 +108956,7 @@ Object { ], "type": "Identifier", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -108954,6 +108991,7 @@ Object { "line": 4, }, }, + "optional": false, "range": Array [ 44, 61, @@ -122445,12 +122483,14 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 0, 6, ], "type": "CallExpression", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -139914,6 +139954,7 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 0, 12, @@ -140190,6 +140231,7 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 0, 13, @@ -140448,6 +140490,7 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 0, 9, @@ -142772,6 +142815,7 @@ Object { ], "type": "Identifier", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -142806,6 +142850,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 18, 40, diff --git a/packages/typescript-estree/tests/lib/__snapshots__/parse.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/parse.ts.snap index bca89ec8d8c6..c09d5159cd4b 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/parse.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/parse.ts.snap @@ -1,5 +1,127 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`parse() general output should not contain loc 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "name": "bar", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "range": Array [ + 4, + 13, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "range": Array [ + 0, + 14, + ], + "type": "VariableDeclaration", + }, + ], + "range": Array [ + 0, + 14, + ], + "sourceType": "script", + "type": "Program", +} +`; + +exports[`parse() general output should not contain range 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "bar", + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "sourceType": "script", + "type": "Program", +} +`; + exports[`parse() general output tokens, comments, locs, and ranges when called with those options 1`] = ` Object { "body": Array [ @@ -225,6 +347,3819 @@ The file does not match your project config: tests/fixtures/invalidFileErrors/js The file must be included in at least one of the projects provided." `; +exports[`parse() isolated parsing should parse .js file - with JSX content - parserOptions.jsx = false 1`] = ` +Object { + "ast": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "div", + "range": Array [ + 11, + 14, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 10, + 17, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + "typeParameters": undefined, + }, + "range": Array [ + 10, + 17, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 17, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", + }, + "services": Object { + "esTreeNodeToTSNodeMap": undefined, + "program": undefined, + "tsNodeToESTreeNodeMap": undefined, + }, +} +`; + +exports[`parse() isolated parsing should parse .js file - with JSX content - parserOptions.jsx = true 1`] = ` +Object { + "ast": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "div", + "range": Array [ + 11, + 14, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 10, + 17, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + "typeParameters": undefined, + }, + "range": Array [ + 10, + 17, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 17, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", + }, + "services": Object { + "esTreeNodeToTSNodeMap": undefined, + "program": undefined, + "tsNodeToESTreeNodeMap": undefined, + }, +} +`; + +exports[`parse() isolated parsing should parse .js file - without JSX content - parserOptions.jsx = false 1`] = ` +Object { + "ast": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 11, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Numeric", + "value": "1", + }, + ], + "type": "Program", + }, + "services": Object { + "esTreeNodeToTSNodeMap": undefined, + "program": undefined, + "tsNodeToESTreeNodeMap": undefined, + }, +} +`; + +exports[`parse() isolated parsing should parse .js file - without JSX content - parserOptions.jsx = true 1`] = ` +Object { + "ast": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 11, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Numeric", + "value": "1", + }, + ], + "type": "Program", + }, + "services": Object { + "esTreeNodeToTSNodeMap": undefined, + "program": undefined, + "tsNodeToESTreeNodeMap": undefined, + }, +} +`; + +exports[`parse() isolated parsing should parse .jsx file - with JSX content - parserOptions.jsx = false 1`] = ` +Object { + "ast": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "div", + "range": Array [ + 11, + 14, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 10, + 17, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + "typeParameters": undefined, + }, + "range": Array [ + 10, + 17, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 17, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", + }, + "services": Object { + "esTreeNodeToTSNodeMap": undefined, + "program": undefined, + "tsNodeToESTreeNodeMap": undefined, + }, +} +`; + +exports[`parse() isolated parsing should parse .jsx file - with JSX content - parserOptions.jsx = true 1`] = ` +Object { + "ast": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "div", + "range": Array [ + 11, + 14, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 10, + 17, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + "typeParameters": undefined, + }, + "range": Array [ + 10, + 17, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 17, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", + }, + "services": Object { + "esTreeNodeToTSNodeMap": undefined, + "program": undefined, + "tsNodeToESTreeNodeMap": undefined, + }, +} +`; + +exports[`parse() isolated parsing should parse .jsx file - without JSX content - parserOptions.jsx = false 1`] = ` +Object { + "ast": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 11, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Numeric", + "value": "1", + }, + ], + "type": "Program", + }, + "services": Object { + "esTreeNodeToTSNodeMap": undefined, + "program": undefined, + "tsNodeToESTreeNodeMap": undefined, + }, +} +`; + +exports[`parse() isolated parsing should parse .jsx file - without JSX content - parserOptions.jsx = true 1`] = ` +Object { + "ast": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 11, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Numeric", + "value": "1", + }, + ], + "type": "Program", + }, + "services": Object { + "esTreeNodeToTSNodeMap": undefined, + "program": undefined, + "tsNodeToESTreeNodeMap": undefined, + }, +} +`; + +exports[`parse() isolated parsing should parse .ts file - without JSX content - parserOptions.jsx = false 1`] = ` +Object { + "ast": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 11, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Numeric", + "value": "1", + }, + ], + "type": "Program", + }, + "services": Object { + "esTreeNodeToTSNodeMap": undefined, + "program": undefined, + "tsNodeToESTreeNodeMap": undefined, + }, +} +`; + +exports[`parse() isolated parsing should parse .ts file - without JSX content - parserOptions.jsx = true 1`] = ` +Object { + "ast": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 11, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Numeric", + "value": "1", + }, + ], + "type": "Program", + }, + "services": Object { + "esTreeNodeToTSNodeMap": undefined, + "program": undefined, + "tsNodeToESTreeNodeMap": undefined, + }, +} +`; + +exports[`parse() isolated parsing should parse .tsx file - with JSX content - parserOptions.jsx = false 1`] = ` +Object { + "ast": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "div", + "range": Array [ + 11, + 14, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 10, + 17, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + "typeParameters": undefined, + }, + "range": Array [ + 10, + 17, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 17, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", + }, + "services": Object { + "esTreeNodeToTSNodeMap": undefined, + "program": undefined, + "tsNodeToESTreeNodeMap": undefined, + }, +} +`; + +exports[`parse() isolated parsing should parse .tsx file - with JSX content - parserOptions.jsx = true 1`] = ` +Object { + "ast": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "div", + "range": Array [ + 11, + 14, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 10, + 17, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + "typeParameters": undefined, + }, + "range": Array [ + 10, + 17, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 17, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", + }, + "services": Object { + "esTreeNodeToTSNodeMap": undefined, + "program": undefined, + "tsNodeToESTreeNodeMap": undefined, + }, +} +`; + +exports[`parse() isolated parsing should parse .tsx file - without JSX content - parserOptions.jsx = false 1`] = ` +Object { + "ast": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 11, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Numeric", + "value": "1", + }, + ], + "type": "Program", + }, + "services": Object { + "esTreeNodeToTSNodeMap": undefined, + "program": undefined, + "tsNodeToESTreeNodeMap": undefined, + }, +} +`; + +exports[`parse() isolated parsing should parse .tsx file - without JSX content - parserOptions.jsx = true 1`] = ` +Object { + "ast": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 11, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Numeric", + "value": "1", + }, + ], + "type": "Program", + }, + "services": Object { + "esTreeNodeToTSNodeMap": undefined, + "program": undefined, + "tsNodeToESTreeNodeMap": undefined, + }, +} +`; + +exports[`parse() isolated parsing should parse .vue file - with JSX content - parserOptions.jsx = true 1`] = ` +Object { + "ast": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "div", + "range": Array [ + 11, + 14, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 10, + 17, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + "typeParameters": undefined, + }, + "range": Array [ + 10, + 17, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 17, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", + }, + "services": Object { + "esTreeNodeToTSNodeMap": undefined, + "program": undefined, + "tsNodeToESTreeNodeMap": undefined, + }, +} +`; + +exports[`parse() isolated parsing should parse .vue file - without JSX content - parserOptions.jsx = false 1`] = ` +Object { + "ast": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 11, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Numeric", + "value": "1", + }, + ], + "type": "Program", + }, + "services": Object { + "esTreeNodeToTSNodeMap": undefined, + "program": undefined, + "tsNodeToESTreeNodeMap": undefined, + }, +} +`; + +exports[`parse() isolated parsing should parse .vue file - without JSX content - parserOptions.jsx = true 1`] = ` +Object { + "ast": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 11, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Numeric", + "value": "1", + }, + ], + "type": "Program", + }, + "services": Object { + "esTreeNodeToTSNodeMap": undefined, + "program": undefined, + "tsNodeToESTreeNodeMap": undefined, + }, +} +`; + exports[`parse() non string code should correctly convert code to a string for parse() 1`] = ` Object { "body": Array [ diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index 52d62f3fd906..7454835c3ae1 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -1650,6 +1650,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-abstract-readonly-property.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-declare-properties.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-optional-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-interface.src 1`] = ` @@ -1661,6 +1663,10 @@ Object { } `; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/angle-bracket-type-assertion.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/angle-bracket-type-assertion-arrow-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/arrow-function-with-optional-parameter.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/arrow-function-with-type-parameters.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -1704,6 +1710,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-constructor-and-type-parameters.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-declare-properties.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-definite-assignment.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-export-parameter-properties.src 1`] = ` @@ -1904,10 +1912,24 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/null-and-undefined-type-annotations.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/nullish-coalescing.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/object-with-escaped-properties.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/object-with-typed-methods.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/optional-chain.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/optional-chain-call.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/optional-chain-call-with-parens.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/optional-chain-element-access.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/optional-chain-element-access-with-parens.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/optional-chain-with-parens.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/parenthesized-use-strict.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/readonly-arrays.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -1922,9 +1944,21 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-alias-object-without-annotation.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-assertion.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-assertion-in-arrow-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-assertion-in-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-assertion-in-interface.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-assertion-in-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-assertion-with-guard-in-arrow-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-assertion-with-guard-in-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-assertion-with-guard-in-interface.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-assertion-arrow-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-assertion-with-guard-in-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-guard-in-arrow-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semanticInfo.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semanticInfo.ts.snap index f5722861dd24..f6b67ce5556a 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semanticInfo.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semanticInfo.ts.snap @@ -447,6 +447,7 @@ Object { ], "type": "Identifier", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -481,6 +482,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 37, 51, @@ -1252,6 +1254,7 @@ Object { "body": Array [ Object { "computed": true, + "declare": false, "key": Object { "loc": Object { "end": Object { diff --git a/packages/typescript-estree/tests/lib/__snapshots__/tsx.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/tsx.ts.snap index 76cb6fb260d5..c0240d2580e9 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/tsx.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/tsx.ts.snap @@ -1192,6 +1192,7 @@ Object { ], "type": "Identifier", }, + "optional": false, "property": Object { "loc": Object { "end": Object { diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index 5cbee776bf20..14b0a341b7a9 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -1607,6 +1607,7 @@ Object { "body": Array [ Object { "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -1645,6 +1646,7 @@ Object { }, Object { "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -2017,6 +2019,7 @@ Object { Object { "accessibility": "public", "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -2362,220 +2365,421 @@ Object { } `; -exports[`typescript fixtures/basics/abstract-class-with-optional-method.src 1`] = ` +exports[`typescript fixtures/basics/abstract-class-with-declare-properties.src 1`] = ` Object { "body": Array [ Object { - "declaration": Object { - "abstract": true, - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { + "abstract": true, + "body": Object { + "body": Array [ + Object { + "computed": false, + "declare": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "name": "prop1", + "range": Array [ + 45, + 50, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 37, + 59, + ], + "static": false, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 50, + 58, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 16, + "column": 23, "line": 2, }, "start": Object { - "column": 4, + "column": 17, "line": 2, }, }, - "name": "createSocket", - "optional": true, "range": Array [ - 43, - 55, + 52, + 58, ], - "type": "Identifier", + "type": "TSStringKeyword", }, - "kind": "method", + }, + "value": null, + }, + Object { + "computed": false, + "declare": true, + "key": Object { "loc": Object { "end": Object { - "column": 37, - "line": 2, + "column": 24, + "line": 3, }, "start": Object { - "column": 4, - "line": 2, + "column": 19, + "line": 3, }, }, + "name": "prop2", "range": Array [ - 43, - 76, + 79, + 84, ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": null, - "expression": false, - "generator": false, - "id": null, + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 62, + 93, + ], + "static": false, + "type": "TSAbstractClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "range": Array [ + 84, + 92, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 37, - "line": 2, + "column": 32, + "line": 3, }, "start": Object { - "column": 17, - "line": 2, + "column": 26, + "line": 3, }, }, - "params": Array [], "range": Array [ - 56, - 76, + 86, + 92, ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 2, - }, - "start": Object { - "column": 19, - "line": 2, - }, + "type": "TSStringKeyword", + }, + }, + "value": null, + }, + Object { + "accessibility": "public", + "computed": false, + "declare": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 26, + "line": 4, + }, + }, + "name": "prop3", + "range": Array [ + 120, + 125, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 40, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 96, + 134, + ], + "static": false, + "type": "TSAbstractClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 4, + }, + "start": Object { + "column": 31, + "line": 4, + }, + }, + "range": Array [ + 125, + 133, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 4, }, - "range": Array [ - 58, - 75, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 2, - }, - "start": Object { - "column": 21, - "line": 2, - }, - }, - "range": Array [ - 60, - 75, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 2, - }, - "start": Object { - "column": 21, - "line": 2, - }, - }, - "name": "Promise", - "range": Array [ - 60, - 67, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 2, - }, - "start": Object { - "column": 28, - "line": 2, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 2, - }, - "start": Object { - "column": 29, - "line": 2, - }, - }, - "range": Array [ - 68, - 74, - ], - "type": "TSStringKeyword", - }, - ], - "range": Array [ - 67, - 75, - ], - "type": "TSTypeParameterInstantiation", - }, + "start": Object { + "column": 33, + "line": 4, }, }, - "type": "FunctionExpression", + "range": Array [ + 127, + 133, + ], + "type": "TSStringKeyword", }, }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, + "value": null, + }, + Object { + "computed": false, + "declare": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 5, + }, + "start": Object { + "column": 28, + "line": 5, + }, + }, + "name": "prop4", + "range": Array [ + 163, + 168, + ], + "type": "Identifier", }, - "start": Object { - "column": 37, - "line": 1, + "loc": Object { + "end": Object { + "column": 42, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 137, + 177, + ], + "readonly": true, + "static": false, + "type": "TSAbstractClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 5, + }, + "start": Object { + "column": 33, + "line": 5, + }, + }, + "range": Array [ + 168, + 176, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 5, + }, + "start": Object { + "column": 35, + "line": 5, + }, + }, + "range": Array [ + 170, + 176, + ], + "type": "TSStringKeyword", + }, }, + "value": null, }, - "range": Array [ - 37, - 78, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, + Object { + "accessibility": "public", + "computed": false, + "declare": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 6, + }, + "start": Object { + "column": 35, + "line": 6, + }, + }, + "name": "prop5", + "range": Array [ + 213, + 218, + ], + "type": "Identifier", }, - "start": Object { - "column": 22, - "line": 1, + "loc": Object { + "end": Object { + "column": 49, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 180, + 227, + ], + "readonly": true, + "static": false, + "type": "TSAbstractClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 6, + }, + "start": Object { + "column": 40, + "line": 6, + }, + }, + "range": Array [ + 218, + 226, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 6, + }, + "start": Object { + "column": 42, + "line": 6, + }, + }, + "range": Array [ + 220, + 226, + ], + "type": "TSStringKeyword", + }, }, + "value": null, }, - "name": "AbstractSocket", - "range": Array [ - 22, - 36, - ], - "type": "Identifier", - }, + ], "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 7, }, "start": Object { - "column": 7, + "column": 33, "line": 1, }, }, "range": Array [ - 7, - 78, + 33, + 229, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "AbstractDeclProps", + "range": Array [ + 15, + 32, + ], + "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 7, }, "start": Object { "column": 0, @@ -2584,17 +2788,16 @@ Object { }, "range": Array [ 0, - 78, + 229, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 0, + "line": 8, }, "start": Object { "column": 0, @@ -2603,14 +2806,14 @@ Object { }, "range": Array [ 0, - 78, + 230, ], - "sourceType": "module", + "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 8, "line": 1, }, "start": Object { @@ -2620,25 +2823,7 @@ Object { }, "range": Array [ 0, - 6, - ], - "type": "Keyword", - "value": "export", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 15, + 8, ], "type": "Identifier", "value": "abstract", @@ -2646,17 +2831,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, + "column": 14, "line": 1, }, "start": Object { - "column": 16, + "column": 9, "line": 1, }, }, "range": Array [ - 16, - 21, + 9, + 14, ], "type": "Keyword", "value": "class", @@ -2664,35 +2849,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 36, + "column": 32, "line": 1, }, "start": Object { - "column": 22, + "column": 15, "line": 1, }, }, "range": Array [ - 22, - 36, + 15, + 32, ], "type": "Identifier", - "value": "AbstractSocket", + "value": "AbstractDeclProps", }, Object { "loc": Object { "end": Object { - "column": 38, + "column": 34, "line": 1, }, "start": Object { - "column": 37, + "column": 33, "line": 1, }, }, "range": Array [ - 37, - 38, + 33, + 34, ], "type": "Punctuator", "value": "{", @@ -2700,83 +2885,83 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 9, "line": 2, }, "start": Object { - "column": 4, + "column": 2, "line": 2, }, }, "range": Array [ - 43, - 55, + 37, + 44, ], "type": "Identifier", - "value": "createSocket", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 15, "line": 2, }, "start": Object { - "column": 16, + "column": 10, "line": 2, }, }, "range": Array [ - 55, - 56, + 45, + 50, ], - "type": "Punctuator", - "value": "?", + "type": "Identifier", + "value": "prop1", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 16, "line": 2, }, "start": Object { - "column": 17, + "column": 15, "line": 2, }, }, "range": Array [ - 56, - 57, + 50, + 51, ], "type": "Punctuator", - "value": "(", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 23, "line": 2, }, "start": Object { - "column": 18, + "column": 17, "line": 2, }, }, "range": Array [ - 57, + 52, 58, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 24, "line": 2, }, "start": Object { - "column": 19, + "column": 23, "line": 2, }, }, @@ -2785,246 +2970,166 @@ Object { 59, ], "type": "Punctuator", - "value": ":", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 2, + "column": 9, + "line": 3, }, "start": Object { - "column": 21, - "line": 2, + "column": 2, + "line": 3, }, }, "range": Array [ - 60, - 67, + 62, + 69, ], "type": "Identifier", - "value": "Promise", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 2, + "column": 18, + "line": 3, }, "start": Object { - "column": 28, - "line": 2, + "column": 10, + "line": 3, }, }, "range": Array [ - 67, - 68, + 70, + 78, ], - "type": "Punctuator", - "value": "<", + "type": "Identifier", + "value": "abstract", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 2, + "column": 24, + "line": 3, }, "start": Object { - "column": 29, - "line": 2, + "column": 19, + "line": 3, }, }, "range": Array [ - 68, - 74, + 79, + 84, ], "type": "Identifier", - "value": "string", + "value": "prop2", }, Object { "loc": Object { "end": Object { - "column": 36, - "line": 2, + "column": 25, + "line": 3, }, "start": Object { - "column": 35, - "line": 2, + "column": 24, + "line": 3, }, }, "range": Array [ - 74, - 75, + 84, + 85, ], "type": "Punctuator", - "value": ">", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 2, + "column": 32, + "line": 3, }, "start": Object { - "column": 36, - "line": 2, + "column": 26, + "line": 3, }, }, "range": Array [ - 75, - 76, + 86, + 92, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 1, + "column": 33, "line": 3, }, "start": Object { - "column": 0, + "column": 32, "line": 3, }, }, "range": Array [ - 77, - 78, + 92, + 93, ], "type": "Punctuator", - "value": "}", + "value": ";", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/abstract-interface.src 1`] = ` -Object { - "body": Array [ Object { - "declaration": Object { - "abstract": true, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 2, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 31, - ], - "type": "TSInterfaceBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "name": "I", - "range": Array [ - 26, - 27, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 2, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 31, - ], - "type": "TSInterfaceDeclaration", - }, "loc": Object { "end": Object { - "column": 1, - "line": 2, + "column": 9, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 2, + "line": 4, }, }, "range": Array [ - 0, - 31, + 96, + 103, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "declare", }, - }, - "range": Array [ - 0, - 31, - ], - "sourceType": "module", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 16, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 10, + "line": 4, }, }, "range": Array [ - 0, - 6, + 104, + 110, ], "type": "Keyword", - "value": "export", + "value": "public", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 25, + "line": 4, }, "start": Object { - "column": 7, - "line": 1, + "column": 17, + "line": 4, }, }, "range": Array [ - 7, - 15, + 111, + 119, ], "type": "Identifier", "value": "abstract", @@ -3032,501 +3137,401 @@ Object { Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 31, + "line": 4, }, "start": Object { - "column": 16, - "line": 1, + "column": 26, + "line": 4, }, }, "range": Array [ - 16, - 25, + 120, + 125, ], - "type": "Keyword", - "value": "interface", + "type": "Identifier", + "value": "prop3", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 32, + "line": 4, }, "start": Object { - "column": 26, - "line": 1, + "column": 31, + "line": 4, }, }, "range": Array [ - 26, - 27, + 125, + 126, ], - "type": "Identifier", - "value": "I", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 39, + "line": 4, }, "start": Object { - "column": 28, - "line": 1, + "column": 33, + "line": 4, }, }, "range": Array [ - 28, - 29, + 127, + 133, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 2, + "column": 40, + "line": 4, }, "start": Object { - "column": 0, - "line": 2, + "column": 39, + "line": 4, }, }, "range": Array [ - 30, - 31, + 133, + 134, ], "type": "Punctuator", - "value": "}", + "value": ";", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/arrow-function-with-optional-parameter.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "async": false, - "body": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "k", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "operator": "+", - "range": Array [ - 9, - 14, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 14, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "type": "BinaryExpression", - }, - "expression": true, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "name": "k", - "optional": true, - "range": Array [ - 2, - 4, - ], - "type": "Identifier", - }, - ], - "range": Array [ - 1, - 14, - ], - "type": "ArrowFunctionExpression", + "loc": Object { + "end": Object { + "column": 9, + "line": 5, }, - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, + "start": Object { + "column": 2, + "line": 5, }, - "range": Array [ - 0, - 17, - ], - "type": "CallExpression", }, + "range": Array [ + 137, + 144, + ], + "type": "Identifier", + "value": "declare", + }, + Object { "loc": Object { "end": Object { "column": 18, - "line": 1, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 10, + "line": 5, }, }, "range": Array [ - 0, - 18, + 145, + 153, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, + "type": "Identifier", + "value": "readonly", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 5, + }, + "start": Object { + "column": 19, + "line": 5, + }, + }, + "range": Array [ + 154, + 162, + ], + "type": "Identifier", + "value": "abstract", }, - }, - "range": Array [ - 0, - 19, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, - "line": 1, + "column": 33, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 28, + "line": 5, }, }, "range": Array [ - 0, - 1, + 163, + 168, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "prop4", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 1, + "column": 34, + "line": 5, }, "start": Object { - "column": 1, - "line": 1, + "column": 33, + "line": 5, }, }, "range": Array [ - 1, - 2, + 168, + 169, ], "type": "Punctuator", - "value": "(", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 1, + "column": 41, + "line": 5, }, "start": Object { - "column": 2, - "line": 1, + "column": 35, + "line": 5, }, }, "range": Array [ - 2, - 3, + 170, + 176, ], "type": "Identifier", - "value": "k", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 1, + "column": 42, + "line": 5, }, "start": Object { - "column": 3, - "line": 1, + "column": 41, + "line": 5, }, }, "range": Array [ - 3, - 4, + 176, + 177, ], "type": "Punctuator", - "value": "?", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 9, + "line": 6, }, "start": Object { - "column": 4, - "line": 1, + "column": 2, + "line": 6, }, }, "range": Array [ - 4, - 5, + 180, + 187, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 16, + "line": 6, }, "start": Object { - "column": 6, - "line": 1, + "column": 10, + "line": 6, }, }, "range": Array [ - 6, - 8, + 188, + 194, ], - "type": "Punctuator", - "value": "=>", + "type": "Keyword", + "value": "public", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 25, + "line": 6, }, "start": Object { - "column": 9, - "line": 1, + "column": 17, + "line": 6, }, }, "range": Array [ - 9, - 10, + 195, + 203, ], "type": "Identifier", - "value": "k", + "value": "readonly", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 34, + "line": 6, }, "start": Object { - "column": 11, - "line": 1, + "column": 26, + "line": 6, }, }, "range": Array [ - 11, - 12, + 204, + 212, ], - "type": "Punctuator", - "value": "+", + "type": "Identifier", + "value": "abstract", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 40, + "line": 6, }, "start": Object { - "column": 13, - "line": 1, + "column": 35, + "line": 6, }, }, "range": Array [ - 13, - 14, + 213, + 218, ], - "type": "Numeric", - "value": "1", + "type": "Identifier", + "value": "prop5", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 41, + "line": 6, }, "start": Object { - "column": 14, - "line": 1, + "column": 40, + "line": 6, }, }, "range": Array [ - 14, - 15, + 218, + 219, ], "type": "Punctuator", - "value": ")", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 48, + "line": 6, }, "start": Object { - "column": 15, - "line": 1, + "column": 42, + "line": 6, }, }, "range": Array [ - 15, - 16, + 220, + 226, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 49, + "line": 6, }, "start": Object { - "column": 16, - "line": 1, + "column": 48, + "line": 6, }, }, "range": Array [ - 16, - 17, + 226, + 227, ], "type": "Punctuator", - "value": ")", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 1, + "line": 7, }, "start": Object { - "column": 17, - "line": 1, + "column": 0, + "line": 7, }, }, "range": Array [ - 17, - 18, + 228, + 229, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/arrow-function-with-type-parameters.src 1`] = ` +exports[`typescript fixtures/basics/abstract-class-with-optional-method.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "async": false, + "declaration": Object { + "abstract": true, "body": Object { "body": Array [ Object { - "argument": Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 12, + "column": 16, "line": 2, }, "start": Object { - "column": 11, + "column": 4, "line": 2, }, }, - "name": "b", + "name": "createSocket", + "optional": true, "range": Array [ - 29, - 30, + 43, + 55, ], "type": "Identifier", }, + "kind": "method", "loc": Object { "end": Object { - "column": 13, + "column": 37, "line": 2, }, "start": Object { @@ -3535,224 +3540,174 @@ Object { }, }, "range": Array [ - 22, - 31, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 33, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 4, - 8, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 8, + 43, + 76, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": null, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 37, + "line": 2, }, "start": Object { - "column": 7, - "line": 1, + "column": 17, + "line": 2, }, }, + "params": Array [], "range": Array [ - 7, - 8, + 56, + 76, ], - "type": "TSTypeReference", - "typeName": Object { + "returnType": Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 36, + "line": 2, }, "start": Object { - "column": 7, - "line": 1, + "column": 19, + "line": 2, }, }, - "name": "X", "range": Array [ - 7, - 8, + 58, + 75, ], - "type": "Identifier", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 60, + 75, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "name": "Promise", + "range": Array [ + 60, + 67, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "range": Array [ + 68, + 74, + ], + "type": "TSStringKeyword", + }, + ], + "range": Array [ + 67, + 75, + ], + "type": "TSTypeParameterInstantiation", + }, + }, }, + "type": "FunctionExpression", }, }, - }, - ], - "range": Array [ - 0, - 33, - ], - "returnType": Object { + ], "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 9, + "column": 37, "line": 1, }, }, "range": Array [ - 9, - 12, + 37, + 78, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 12, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "X", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - }, + "type": "ClassBody", }, - "type": "ArrowFunctionExpression", - "typeParameters": Object { + "id": Object { "loc": Object { "end": Object { - "column": 3, + "column": 36, "line": 1, }, "start": Object { - "column": 0, + "column": 22, "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "name": "X", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - "range": Array [ - 1, - 2, - ], - "type": "TSTypeParameter", - }, - ], + "name": "AbstractSocket", "range": Array [ - 0, - 3, + 22, + 36, ], - "type": "TSTypeParameterDeclaration", + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 1, + }, }, + "range": Array [ + 7, + 78, + ], + "superClass": null, + "type": "ClassDeclaration", }, "loc": Object { "end": Object { @@ -3766,9 +3721,11 @@ Object { }, "range": Array [ 0, - 33, + 78, ], - "type": "ExpressionStatement", + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", }, ], "loc": Object { @@ -3783,14 +3740,14 @@ Object { }, "range": Array [ 0, - 33, + 78, ], - "sourceType": "script", + "sourceType": "module", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 6, "line": 1, }, "start": Object { @@ -3800,259 +3757,259 @@ Object { }, "range": Array [ 0, - 1, + 6, ], - "type": "Punctuator", - "value": "<", + "type": "Keyword", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 15, "line": 1, }, "start": Object { - "column": 1, + "column": 7, "line": 1, }, }, "range": Array [ - 1, - 2, + 7, + 15, ], "type": "Identifier", - "value": "X", + "value": "abstract", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 21, "line": 1, }, "start": Object { - "column": 2, + "column": 16, "line": 1, }, }, "range": Array [ - 2, - 3, + 16, + 21, ], - "type": "Punctuator", - "value": ">", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 36, "line": 1, }, "start": Object { - "column": 3, + "column": 22, "line": 1, }, }, "range": Array [ - 3, - 4, + 22, + 36, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "AbstractSocket", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 38, "line": 1, }, "start": Object { - "column": 4, + "column": 37, "line": 1, }, }, "range": Array [ - 4, - 5, + 37, + 38, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 5, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 5, - 6, + 43, + 55, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "createSocket", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 7, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 7, - 8, + 55, + 56, ], - "type": "Identifier", - "value": "X", + "type": "Punctuator", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 8, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 8, - 9, + 56, + 57, ], "type": "Punctuator", - "value": ")", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 19, + "line": 2, }, "start": Object { - "column": 9, - "line": 1, + "column": 18, + "line": 2, }, }, "range": Array [ - 9, - 10, + 57, + 58, ], "type": "Punctuator", - "value": ":", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 20, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 19, + "line": 2, }, }, "range": Array [ - 11, - 12, + 58, + 59, ], - "type": "Identifier", - "value": "X", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 28, + "line": 2, }, "start": Object { - "column": 13, - "line": 1, + "column": 21, + "line": 2, }, }, "range": Array [ - 13, - 15, + 60, + 67, ], - "type": "Punctuator", - "value": "=>", + "type": "Identifier", + "value": "Promise", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 29, + "line": 2, }, "start": Object { - "column": 16, - "line": 1, + "column": 28, + "line": 2, }, }, "range": Array [ - 16, - 17, + 67, + 68, ], "type": "Punctuator", - "value": "{", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 35, "line": 2, }, "start": Object { - "column": 4, + "column": 29, "line": 2, }, }, "range": Array [ - 22, - 28, + 68, + 74, ], - "type": "Keyword", - "value": "return", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 36, "line": 2, }, "start": Object { - "column": 11, + "column": 35, "line": 2, }, }, "range": Array [ - 29, - 30, + 74, + 75, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 37, "line": 2, }, "start": Object { - "column": 12, + "column": 36, "line": 2, }, }, "range": Array [ - 30, - 31, + 75, + 76, ], "type": "Punctuator", "value": ";", @@ -4069,8 +4026,8 @@ Object { }, }, "range": Array [ - 32, - 33, + 77, + 78, ], "type": "Punctuator", "value": "}", @@ -4080,88 +4037,67 @@ Object { } `; -exports[`typescript fixtures/basics/async-function-expression.src 1`] = ` +exports[`typescript fixtures/basics/abstract-interface.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "async": true, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 2, - }, - "start": Object { - "column": 23, - "line": 1, - }, + "declaration": Object { + "abstract": true, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 2, }, - "range": Array [ - 23, - 26, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, + "start": Object { + "column": 28, + "line": 1, }, - "name": "test", - "range": Array [ - 16, - 20, - ], - "type": "Identifier", }, + "range": Array [ + 28, + 31, + ], + "type": "TSInterfaceBody", + }, + "id": Object { "loc": Object { "end": Object { - "column": 1, - "line": 2, + "column": 27, + "line": 1, }, "start": Object { - "column": 1, + "column": 26, "line": 1, }, }, - "params": Array [], + "name": "I", "range": Array [ - 1, 26, + 27, ], - "type": "FunctionExpression", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 4, + "column": 1, "line": 2, }, "start": Object { - "column": 0, + "column": 7, "line": 1, }, }, "range": Array [ - 0, - 29, + 7, + 31, ], - "type": "CallExpression", + "type": "TSInterfaceDeclaration", }, "loc": Object { "end": Object { - "column": 5, + "column": 1, "line": 2, }, "start": Object { @@ -4171,14 +4107,16 @@ Object { }, "range": Array [ 0, - 30, + 31, ], - "type": "ExpressionStatement", + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", }, ], "loc": Object { "end": Object { - "column": 5, + "column": 1, "line": 2, }, "start": Object { @@ -4188,14 +4126,14 @@ Object { }, "range": Array [ 0, - 30, + 31, ], - "sourceType": "script", + "sourceType": "module", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 6, "line": 1, }, "start": Object { @@ -4205,28 +4143,10 @@ Object { }, "range": Array [ 0, - 1, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "range": Array [ - 1, 6, ], - "type": "Identifier", - "value": "async", + "type": "Keyword", + "value": "export", }, Object { "loc": Object { @@ -4243,13 +4163,13 @@ Object { 7, 15, ], - "type": "Keyword", - "value": "function", + "type": "Identifier", + "value": "abstract", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 25, "line": 1, }, "start": Object { @@ -4259,61 +4179,43 @@ Object { }, "range": Array [ 16, - 20, - ], - "type": "Identifier", - "value": "test", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, + 25, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 27, "line": 1, }, "start": Object { - "column": 21, + "column": 26, "line": 1, }, }, "range": Array [ - 21, - 22, + 26, + 27, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "I", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 29, "line": 1, }, "start": Object { - "column": 23, + "column": 28, "line": 1, }, }, "range": Array [ - 23, - 24, + 28, + 29, ], "type": "Punctuator", "value": "{", @@ -4330,377 +4232,133 @@ Object { }, }, "range": Array [ - 25, - 26, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 2, - }, - "start": Object { - "column": 1, - "line": 2, - }, - }, - "range": Array [ - 26, - 27, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 27, - 28, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 2, - }, - "start": Object { - "column": 3, - "line": 2, - }, - }, - "range": Array [ - 28, - 29, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 29, 30, + 31, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/async-function-with-var-declaration.src 1`] = ` +exports[`typescript fixtures/basics/angle-bracket-type-assertion.src 1`] = ` Object { "body": Array [ Object { - "async": true, - "body": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 32, - 35, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "range": Array [ - 38, - 43, - ], - "raw": "'foo'", - "type": "Literal", - "value": "foo", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "range": Array [ - 32, - 43, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 9, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 6, + "line": 1, }, }, + "name": "foo", "range": Array [ - 28, - 44, + 6, + 9, ], - "type": "VariableDeclaration", + "type": "Identifier", }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "name": "bar", - "range": Array [ - 53, - 56, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "range": Array [ - 59, - 64, - ], - "raw": "'bar'", - "type": "Literal", - "value": "bar", + "init": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, }, - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, + "start": Object { + "column": 26, + "line": 1, }, - "range": Array [ - 53, - 64, - ], - "type": "VariableDeclarator", }, - ], - "kind": "let", + "range": Array [ + 26, + 27, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, "loc": Object { "end": Object { - "column": 20, - "line": 3, + "column": 27, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 12, + "line": 1, }, }, "range": Array [ - 49, - 65, + 12, + 27, ], - "type": "VariableDeclaration", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 4, - }, - "start": Object { - "column": 10, - "line": 4, - }, - }, - "name": "fooBar", - "range": Array [ - 76, - 82, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 4, - }, - "start": Object { - "column": 19, - "line": 4, - }, - }, - "range": Array [ - 85, - 93, - ], - "raw": "'fooBar'", - "type": "Literal", - "value": "fooBar", + "type": "TSTypeAssertion", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, }, - "loc": Object { - "end": Object { - "column": 27, - "line": 4, - }, - "start": Object { - "column": 10, - "line": 4, - }, + "start": Object { + "column": 13, + "line": 1, }, - "range": Array [ - 76, - 93, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 28, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, }, + "range": Array [ + 13, + 16, + ], + "type": "TSAnyKeyword", }, - "range": Array [ - 70, - 94, - ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 5, }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 96, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, }, + "range": Array [ + 6, + 27, + ], + "type": "VariableDeclarator", }, - "name": "test", - "range": Array [ - 15, - 19, - ], - "type": "Identifier", - }, + ], + "kind": "const", "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 28, + "line": 1, }, "start": Object { "column": 0, "line": 1, }, }, - "params": Array [], "range": Array [ 0, - 96, + 28, ], - "type": "FunctionDeclaration", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 6, + "line": 2, }, "start": Object { "column": 0, @@ -4709,7 +4367,7 @@ Object { }, "range": Array [ 0, - 97, + 29, ], "sourceType": "script", "tokens": Array [ @@ -4728,13 +4386,13 @@ Object { 0, 5, ], - "type": "Identifier", - "value": "async", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 9, "line": 1, }, "start": Object { @@ -4744,621 +4402,316 @@ Object { }, "range": Array [ 6, - 14, - ], - "type": "Keyword", - "value": "function", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 19, + 9, ], "type": "Identifier", - "value": "test", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 11, "line": 1, }, "start": Object { - "column": 19, + "column": 10, "line": 1, }, }, "range": Array [ - 19, - 20, + 10, + 11, ], "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 13, "line": 1, }, "start": Object { - "column": 20, + "column": 12, "line": 1, }, }, "range": Array [ - 20, - 21, + 12, + 13, ], "type": "Punctuator", - "value": ")", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, + "column": 16, "line": 1, }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 28, - 31, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, "start": Object { - "column": 8, - "line": 2, - }, - }, - "range": Array [ - 32, - 35, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { "column": 13, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "range": Array [ - 36, - 37, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "range": Array [ - 38, - 43, - ], - "type": "String", - "value": "'foo'", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 19, - "line": 2, - }, - }, - "range": Array [ - 43, - 44, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 49, - 52, - ], - "type": "Keyword", - "value": "let", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, + "line": 1, }, }, "range": Array [ - 53, - 56, + 13, + 16, ], "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "range": Array [ - 57, - 58, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "range": Array [ - 59, - 64, - ], - "type": "String", - "value": "'bar'", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 3, - }, - "start": Object { - "column": 19, - "line": 3, - }, - }, - "range": Array [ - 64, - 65, - ], - "type": "Punctuator", - "value": ";", + "value": "any", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 4, + "column": 17, + "line": 1, }, "start": Object { - "column": 4, - "line": 4, - }, - }, - "range": Array [ - 70, - 75, - ], - "type": "Keyword", - "value": "const", - }, - Object { - "loc": Object { - "end": Object { "column": 16, - "line": 4, - }, - "start": Object { - "column": 10, - "line": 4, - }, - }, - "range": Array [ - 76, - 82, - ], - "type": "Identifier", - "value": "fooBar", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 4, - }, - "start": Object { - "column": 17, - "line": 4, + "line": 1, }, }, "range": Array [ - 83, - 84, + 16, + 17, ], "type": "Punctuator", - "value": "=", + "value": ">", }, Object { "loc": Object { "end": Object { "column": 27, - "line": 4, + "line": 1, }, "start": Object { - "column": 19, - "line": 4, + "column": 26, + "line": 1, }, }, "range": Array [ - 85, - 93, + 26, + 27, ], - "type": "String", - "value": "'fooBar'", + "type": "Numeric", + "value": "2", }, Object { "loc": Object { "end": Object { "column": 28, - "line": 4, + "line": 1, }, "start": Object { "column": 27, - "line": 4, + "line": 1, }, }, "range": Array [ - 93, - 94, + 27, + 28, ], "type": "Punctuator", "value": ";", }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, - }, - "range": Array [ - 95, - 96, - ], - "type": "Punctuator", - "value": "}", - }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/await-without-async-function.src 1`] = ` +exports[`typescript fixtures/basics/angle-bracket-type-assertion-arrow-function.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "name": "bar", - "range": Array [ - 25, - 28, - ], - "type": "Identifier", - }, - "init": Object { - "argument": Object { - "arguments": Array [], - "callee": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "asserted2", + "range": Array [ + 4, + 13, + ], + "type": "Identifier", + }, + "init": Object { + "expression": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 39, + "line": 1, }, "start": Object { - "column": 20, - "line": 2, + "column": 38, + "line": 1, }, }, - "name": "baz", + "name": "n", "range": Array [ - 37, - 40, + 38, + 39, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 40, + "line": 1, }, "start": Object { - "column": 20, - "line": 2, + "column": 31, + "line": 1, }, }, "range": Array [ - 37, - 42, + 31, + 40, ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 25, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, + "type": "ReturnStatement", }, - "range": Array [ - 31, - 42, - ], - "type": "AwaitExpression", - }, + ], "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 42, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 29, + "line": 1, }, }, "range": Array [ - 25, + 29, 42, ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 26, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, + "type": "BlockStatement", }, - }, - "range": Array [ - 19, - 43, - ], - "type": "VariableDeclaration", - }, - Object { - "argument": Object { - "computed": false, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 42, + "line": 1, }, "start": Object { - "column": 9, - "line": 3, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 9, - "line": 3, - }, + "column": 22, + "line": 1, }, - "name": "bar", - "range": Array [ - 53, - 56, - ], - "type": "Identifier", }, - "property": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 3, - }, - "start": Object { - "column": 13, - "line": 3, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, }, + "name": "n", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", }, - "name": "qux", - "range": Array [ - 57, - 60, - ], - "type": "Identifier", - }, + ], "range": Array [ - 53, - 60, + 22, + 42, ], - "type": "MemberExpression", + "type": "ArrowFunctionExpression", }, "loc": Object { "end": Object { - "column": 17, - "line": 3, + "column": 43, + "line": 1, }, "start": Object { - "column": 2, - "line": 3, + "column": 16, + "line": 1, }, }, "range": Array [ - 46, - 61, + 16, + 43, ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 63, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, + "type": "TSTypeAssertion", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 20, + ], + "type": "TSAnyKeyword", + }, }, - "start": Object { - "column": 9, - "line": 1, + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, + "range": Array [ + 4, + 43, + ], + "type": "VariableDeclarator", }, - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 44, + "line": 1, }, "start": Object { "column": 0, "line": 1, }, }, - "params": Array [], "range": Array [ 0, - 63, + 44, ], - "type": "FunctionDeclaration", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 5, + "line": 2, }, "start": Object { "column": 0, @@ -5367,14 +4720,14 @@ Object { }, "range": Array [ 0, - 64, + 45, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 3, "line": 1, }, "start": Object { @@ -5384,241 +4737,223 @@ Object { }, "range": Array [ 0, - 8, + 3, ], "type": "Keyword", - "value": "function", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 13, "line": 1, }, "start": Object { - "column": 9, + "column": 4, "line": 1, }, }, "range": Array [ - 9, - 12, + 4, + 13, ], "type": "Identifier", - "value": "foo", + "value": "asserted2", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 15, "line": 1, }, "start": Object { - "column": 12, + "column": 14, "line": 1, }, }, "range": Array [ - 12, - 13, + 14, + 15, ], "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 17, "line": 1, }, "start": Object { - "column": 13, + "column": 16, "line": 1, }, }, "range": Array [ - 13, - 14, + 16, + 17, ], "type": "Punctuator", - "value": ")", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 20, "line": 1, }, "start": Object { - "column": 15, + "column": 17, "line": 1, }, }, "range": Array [ - 15, - 16, + 17, + 20, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "any", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 20, + "line": 1, }, }, "range": Array [ - 19, - 24, + 20, + 21, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 22, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 21, + "line": 1, }, }, "range": Array [ - 25, - 28, + 21, + 22, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 12, - "line": 2, + "column": 22, + "line": 1, }, }, "range": Array [ - 29, - 30, + 22, + 23, ], "type": "Punctuator", - "value": "=", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 24, + "line": 1, }, "start": Object { - "column": 14, - "line": 2, + "column": 23, + "line": 1, }, }, "range": Array [ - 31, - 36, + 23, + 24, ], "type": "Identifier", - "value": "await", + "value": "n", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 25, + "line": 1, }, "start": Object { - "column": 20, - "line": 2, + "column": 24, + "line": 1, }, }, "range": Array [ - 37, - 40, - ], - "type": "Identifier", - "value": "baz", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 2, - }, - "start": Object { - "column": 23, - "line": 2, - }, - }, - "range": Array [ - 40, - 41, + 24, + 25, ], "type": "Punctuator", - "value": "(", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 28, + "line": 1, }, "start": Object { - "column": 24, - "line": 2, + "column": 26, + "line": 1, }, }, "range": Array [ - 41, - 42, + 26, + 28, ], "type": "Punctuator", - "value": ")", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 2, + "column": 30, + "line": 1, }, "start": Object { - "column": 25, - "line": 2, + "column": 29, + "line": 1, }, }, "range": Array [ - 42, - 43, + 29, + 30, ], "type": "Punctuator", - "value": ";", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 3, + "column": 37, + "line": 1, }, "start": Object { - "column": 2, - "line": 3, + "column": 31, + "line": 1, }, }, "range": Array [ - 46, - 52, + 31, + 37, ], "type": "Keyword", "value": "return", @@ -5626,370 +4961,239 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, - "line": 3, + "column": 39, + "line": 1, }, "start": Object { - "column": 9, - "line": 3, + "column": 38, + "line": 1, }, }, "range": Array [ - 53, - 56, + 38, + 39, ], "type": "Identifier", - "value": "bar", + "value": "n", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 3, + "column": 40, + "line": 1, }, "start": Object { - "column": 12, - "line": 3, + "column": 39, + "line": 1, }, }, "range": Array [ - 56, - 57, + 39, + 40, ], "type": "Punctuator", - "value": ".", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 42, + "line": 1, }, "start": Object { - "column": 13, - "line": 3, + "column": 41, + "line": 1, }, }, "range": Array [ - 57, - 60, + 41, + 42, ], - "type": "Identifier", - "value": "qux", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 3, + "column": 43, + "line": 1, }, "start": Object { - "column": 16, - "line": 3, + "column": 42, + "line": 1, }, }, "range": Array [ - 60, - 61, + 42, + 43, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 44, + "line": 1, }, "start": Object { - "column": 0, - "line": 4, + "column": 43, + "line": 1, }, }, "range": Array [ - 62, - 63, + 43, + 44, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/call-signatures.src 1`] = ` +exports[`typescript fixtures/basics/arrow-function-with-optional-parameter.src 1`] = ` Object { "body": Array [ Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 5, - 8, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 61, - ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "members": Array [ - Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "async": false, + "body": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "k", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 21, - "line": 2, + "column": 14, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 9, + "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 3, - "line": 2, - }, - }, - "name": "a", - "range": Array [ - 16, - 25, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 17, - 25, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 6, - "line": 2, - }, - }, - "range": Array [ - 19, - 25, - ], - "type": "TSStringKeyword", - }, - }, - }, - ], + "operator": "+", "range": Array [ - 15, - 34, + 9, + 14, ], - "returnType": Object { + "right": Object { "loc": Object { "end": Object { - "column": 21, - "line": 2, + "column": 14, + "line": 1, }, "start": Object { "column": 13, - "line": 2, + "line": 1, }, }, "range": Array [ - 26, - 34, + 13, + 14, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 15, - "line": 2, - }, - }, - "range": Array [ - 28, - 34, - ], - "type": "TSStringKeyword", - }, + "raw": "1", + "type": "Literal", + "value": 1, }, - "type": "TSCallSignatureDeclaration", + "type": "BinaryExpression", }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "name": "a", - "range": Array [ - 41, - 50, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 3, - }, - }, - "range": Array [ - 42, - 50, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "range": Array [ - 44, - 50, - ], - "type": "TSStringKeyword", - }, - }, - }, - ], - "range": Array [ - 37, - 59, - ], - "returnType": Object { + "start": Object { + "column": 1, + "line": 1, + }, + }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 24, - "line": 3, + "column": 4, + "line": 1, }, "start": Object { - "column": 16, - "line": 3, + "column": 2, + "line": 1, }, }, + "name": "k", + "optional": true, "range": Array [ - 51, - 59, + 2, + 4, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 3, - }, - "start": Object { - "column": 18, - "line": 3, - }, - }, - "range": Array [ - 53, - 59, - ], - "type": "TSStringKeyword", - }, + "type": "Identifier", }, - "type": "TSConstructSignatureDeclaration", + ], + "range": Array [ + 1, + 14, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, }, - ], + "start": Object { + "column": 0, + "line": 1, + }, + }, + "optional": false, "range": Array [ - 11, - 61, + 0, + 17, ], - "type": "TSTypeLiteral", + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, }, + "range": Array [ + 0, + 18, + ], + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { "column": 0, - "line": 5, + "line": 2, }, "start": Object { "column": 0, @@ -5998,14 +5202,14 @@ Object { }, "range": Array [ 0, - 62, + 19, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, + "column": 1, "line": 1, }, "start": Object { @@ -6015,785 +5219,665 @@ Object { }, "range": Array [ 0, - 4, + 1, ], - "type": "Identifier", - "value": "type", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 2, "line": 1, }, "start": Object { - "column": 5, + "column": 1, "line": 1, }, }, "range": Array [ - 5, - 8, + 1, + 2, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 3, "line": 1, }, "start": Object { - "column": 9, + "column": 2, "line": 1, }, }, "range": Array [ - 9, - 10, + 2, + 3, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "k", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 4, "line": 1, }, "start": Object { - "column": 11, + "column": 3, "line": 1, }, }, "range": Array [ - 11, - 12, + 3, + 4, ], "type": "Punctuator", - "value": "{", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 2, + "column": 5, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 4, + "line": 1, }, }, "range": Array [ - 15, - 16, + 4, + 5, ], "type": "Punctuator", - "value": "(", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 2, + "column": 8, + "line": 1, }, "start": Object { - "column": 3, - "line": 2, + "column": 6, + "line": 1, }, }, "range": Array [ - 16, - 17, + 6, + 8, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 10, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 9, + "line": 1, }, }, "range": Array [ - 17, - 18, + 9, + 10, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "k", }, Object { "loc": Object { "end": Object { "column": 12, - "line": 2, + "line": 1, }, "start": Object { - "column": 6, - "line": 2, + "column": 11, + "line": 1, }, }, "range": Array [ - 19, - 25, + 11, + 12, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "+", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 2, + "column": 14, + "line": 1, }, "start": Object { - "column": 12, - "line": 2, + "column": 13, + "line": 1, }, }, "range": Array [ - 25, - 26, + 13, + 14, ], - "type": "Punctuator", - "value": ")", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 15, + "line": 1, }, "start": Object { - "column": 13, - "line": 2, + "column": 14, + "line": 1, }, }, "range": Array [ - 26, - 27, + 14, + 15, ], "type": "Punctuator", - "value": ":", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 2, + "column": 16, + "line": 1, }, "start": Object { "column": 15, - "line": 2, + "line": 1, }, }, "range": Array [ - 28, - 34, + 15, + 16, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 17, + "line": 1, }, "start": Object { - "column": 2, - "line": 3, + "column": 16, + "line": 1, }, }, "range": Array [ - 37, - 40, + 16, + 17, ], - "type": "Keyword", - "value": "new", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 3, + "column": 18, + "line": 1, }, "start": Object { - "column": 5, - "line": 3, + "column": 17, + "line": 1, }, }, "range": Array [ - 40, - 41, + 17, + 18, ], "type": "Punctuator", - "value": "(", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/arrow-function-with-type-parameters.src 1`] = ` +Object { + "body": Array [ Object { + "expression": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "b", + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 22, + 31, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 33, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 4, + 8, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + }, + }, + }, + ], + "range": Array [ + 0, + 33, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + }, + }, + "type": "ArrowFunctionExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + "range": Array [ + 1, + 2, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 0, + 3, + ], + "type": "TSTypeParameterDeclaration", + }, + }, "loc": Object { "end": Object { - "column": 7, + "column": 1, "line": 3, }, "start": Object { - "column": 6, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 41, - 42, + 0, + 33, ], - "type": "Identifier", - "value": "a", + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 33, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, - "line": 3, + "column": 1, + "line": 1, }, "start": Object { - "column": 7, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 42, - 43, + 0, + 1, ], "type": "Punctuator", - "value": ":", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 2, + "line": 1, }, "start": Object { - "column": 9, - "line": 3, + "column": 1, + "line": 1, }, }, "range": Array [ - 44, - 50, + 1, + 2, ], "type": "Identifier", - "value": "string", + "value": "X", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 3, + "line": 1, }, "start": Object { - "column": 15, - "line": 3, + "column": 2, + "line": 1, }, }, "range": Array [ - 50, - 51, + 2, + 3, ], "type": "Punctuator", - "value": ")", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 3, + "column": 4, + "line": 1, }, "start": Object { - "column": 16, - "line": 3, + "column": 3, + "line": 1, }, }, "range": Array [ - 51, - 52, + 3, + 4, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 3, + "column": 5, + "line": 1, }, "start": Object { - "column": 18, - "line": 3, + "column": 4, + "line": 1, }, }, "range": Array [ - 53, - 59, + 4, + 5, ], "type": "Identifier", - "value": "string", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 6, + "line": 1, }, "start": Object { - "column": 0, - "line": 4, + "column": 5, + "line": 1, }, }, "range": Array [ - 60, - 61, + 5, + 6, ], "type": "Punctuator", - "value": "}", + "value": ":", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/call-signatures-with-generics.src 1`] = ` -Object { - "body": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 5, - 8, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 67, - ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "members": Array [ - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 6, - "line": 2, - }, - }, - "name": "a", - "range": Array [ - 19, - 28, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 7, - "line": 2, - }, - }, - "range": Array [ - 20, - 28, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "range": Array [ - 22, - 28, - ], - "type": "TSStringKeyword", - }, - }, - }, - ], - "range": Array [ - 15, - 37, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 29, - 37, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, - }, - }, - "range": Array [ - 31, - 37, - ], - "type": "TSStringKeyword", - }, - }, - "type": "TSCallSignatureDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 2, - }, - "start": Object { - "column": 3, - "line": 2, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 2, - }, - "start": Object { - "column": 3, - "line": 2, - }, - }, - "name": "T", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "range": Array [ - 16, - 17, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 15, - 18, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 3, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "name": "a", - "range": Array [ - 47, - 56, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 3, - }, - }, - "range": Array [ - 48, - 56, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "range": Array [ - 50, - 56, - ], - "type": "TSStringKeyword", - }, - }, - }, - ], - "range": Array [ - 40, - 65, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 3, - }, - "start": Object { - "column": 19, - "line": 3, - }, - }, - "range": Array [ - 57, - 65, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 3, - }, - "start": Object { - "column": 21, - "line": 3, - }, - }, - "range": Array [ - 59, - 65, - ], - "type": "TSStringKeyword", - }, - }, - "type": "TSConstructSignatureDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 3, - }, - "start": Object { - "column": 5, - "line": 3, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "name": "T", - "range": Array [ - 44, - 45, - ], - "type": "Identifier", - }, - "range": Array [ - 44, - 45, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 43, - 46, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - ], - "range": Array [ - 11, - 67, - ], - "type": "TSTypeLiteral", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 68, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, + "column": 8, "line": 1, }, "start": Object { - "column": 0, + "column": 7, "line": 1, }, }, "range": Array [ - 0, - 4, + 7, + 8, ], "type": "Identifier", - "value": "type", + "value": "X", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 9, "line": 1, }, "start": Object { - "column": 5, + "column": 8, "line": 1, }, }, "range": Array [ - 5, 8, + 9, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { @@ -6811,7 +5895,7 @@ Object { 10, ], "type": "Punctuator", - "value": "=", + "value": ":", }, Object { "loc": Object { @@ -6828,275 +5912,321 @@ Object { 11, 12, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "X", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 2, + "column": 15, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 13, + "line": 1, }, }, "range": Array [ + 13, 15, - 16, ], "type": "Punctuator", - "value": "<", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { - "column": 3, - "line": 2, + "column": 16, + "line": 1, }, }, "range": Array [ 16, 17, ], - "type": "Identifier", - "value": "T", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 17, - 18, - ], "type": "Punctuator", - "value": ">", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 10, "line": 2, }, "start": Object { - "column": 5, + "column": 4, "line": 2, }, }, "range": Array [ - 18, - 19, + 22, + 28, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "return", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 12, "line": 2, }, "start": Object { - "column": 6, + "column": 11, "line": 2, }, }, "range": Array [ - 19, - 20, + 29, + 30, ], "type": "Identifier", - "value": "a", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 13, "line": 2, }, "start": Object { - "column": 7, + "column": 12, "line": 2, }, }, "range": Array [ - 20, - 21, + 30, + 31, ], "type": "Punctuator", - "value": ":", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 1, + "line": 3, }, "start": Object { - "column": 9, - "line": 2, + "column": 0, + "line": 3, }, }, "range": Array [ - 22, - 28, + 32, + 33, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/async-function-expression.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, + "expression": Object { + "arguments": Array [], + "callee": Object { + "async": true, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 26, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "test", + "range": Array [ + 16, + 20, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 1, + 26, + ], + "type": "FunctionExpression", }, - "start": Object { - "column": 15, - "line": 2, + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, }, + "optional": false, + "range": Array [ + 0, + 29, + ], + "type": "CallExpression", }, - "range": Array [ - 28, - 29, - ], - "type": "Punctuator", - "value": ")", - }, - Object { "loc": Object { "end": Object { - "column": 17, + "column": 5, "line": 2, }, "start": Object { - "column": 16, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 29, + 0, 30, ], - "type": "Punctuator", - "value": ":", + "type": "ExpressionStatement", }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, - }, - }, - "range": Array [ - 31, - 37, - ], - "type": "Identifier", - "value": "string", + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 2, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 1, + "line": 1, }, "start": Object { - "column": 2, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 40, - 43, + 0, + 1, ], - "type": "Keyword", - "value": "new", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { "column": 6, - "line": 3, + "line": 1, }, "start": Object { - "column": 5, - "line": 3, + "column": 1, + "line": 1, }, }, "range": Array [ - 43, - 44, + 1, + 6, ], - "type": "Punctuator", - "value": "<", + "type": "Identifier", + "value": "async", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 15, + "line": 1, }, "start": Object { - "column": 6, - "line": 3, + "column": 7, + "line": 1, }, }, "range": Array [ - 44, - 45, + 7, + 15, ], - "type": "Identifier", - "value": "T", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 3, + "column": 20, + "line": 1, }, "start": Object { - "column": 7, - "line": 3, + "column": 16, + "line": 1, }, }, "range": Array [ - 45, - 46, + 16, + 20, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "test", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 3, + "column": 21, + "line": 1, }, "start": Object { - "column": 8, - "line": 3, + "column": 20, + "line": 1, }, }, "range": Array [ - 46, - 47, + 20, + 21, ], "type": "Punctuator", "value": "(", @@ -7104,71 +6234,71 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, - "line": 3, + "column": 22, + "line": 1, }, "start": Object { - "column": 9, - "line": 3, + "column": 21, + "line": 1, }, }, "range": Array [ - 47, - 48, + 21, + 22, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 3, + "column": 24, + "line": 1, }, "start": Object { - "column": 10, - "line": 3, + "column": 23, + "line": 1, }, }, "range": Array [ - 48, - 49, + 23, + 24, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 3, + "column": 1, + "line": 2, }, "start": Object { - "column": 12, - "line": 3, + "column": 0, + "line": 2, }, }, "range": Array [ - 50, - 56, + 25, + 26, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 3, + "column": 2, + "line": 2, }, "start": Object { - "column": 18, - "line": 3, + "column": 1, + "line": 2, }, }, "range": Array [ - 56, - 57, + 26, + 27, ], "type": "Punctuator", "value": ")", @@ -7176,175 +6306,350 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, - "line": 3, + "column": 3, + "line": 2, }, "start": Object { - "column": 19, - "line": 3, + "column": 2, + "line": 2, }, }, "range": Array [ - 57, - 58, + 27, + 28, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 3, + "column": 4, + "line": 2, }, "start": Object { - "column": 21, - "line": 3, + "column": 3, + "line": 2, }, }, "range": Array [ - 59, - 65, + 28, + 29, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 5, + "line": 2, }, "start": Object { - "column": 0, - "line": 4, + "column": 4, + "line": 2, }, }, "range": Array [ - 66, - 67, + 29, + 30, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/cast-as-expression.src 1`] = ` +exports[`typescript fixtures/basics/async-function-with-var-declaration.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "expression": Object { - "left": Object { + "async": true, + "body": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 32, + 35, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 38, + 43, + ], + "raw": "'foo'", + "type": "Literal", + "value": "foo", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 32, + 43, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 1, - "line": 1, + "column": 20, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 4, + "line": 2, }, }, - "name": "x", "range": Array [ - 0, - 1, + 28, + 44, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, + "type": "VariableDeclaration", }, - "operator": "<", - "range": Array [ - 0, - 5, - ], - "right": Object { + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 53, + 56, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 59, + 64, + ], + "raw": "'bar'", + "type": "Literal", + "value": "bar", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 53, + 64, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 20, + "line": 3, }, "start": Object { "column": 4, - "line": 1, + "line": 3, }, }, - "name": "y", "range": Array [ - 4, - 5, + 49, + 65, ], - "type": "Identifier", - }, - "type": "BinaryExpression", - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 16, - ], - "type": "TSAsExpression", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, + "type": "VariableDeclaration", }, - "range": Array [ - 9, - 16, - ], - "type": "TSBooleanKeyword", - }, - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 1, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 4, + }, + }, + "name": "fooBar", + "range": Array [ + 76, + 82, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 19, + "line": 4, + }, + }, + "range": Array [ + 85, + 93, + ], + "raw": "'fooBar'", + "type": "Literal", + "value": "fooBar", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 4, + }, + }, + "range": Array [ + 76, + 93, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 28, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 70, + 94, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 96, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "test", + "range": Array [ + 15, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, }, "start": Object { "column": 0, "line": 1, }, }, + "params": Array [], "range": Array [ 0, - 17, + 96, ], - "type": "ExpressionStatement", + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 6, }, "start": Object { "column": 0, @@ -7353,14 +6658,14 @@ Object { }, "range": Array [ 0, - 18, + 97, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 5, "line": 1, }, "start": Object { @@ -7370,508 +6675,641 @@ Object { }, "range": Array [ 0, - 1, + 5, ], "type": "Identifier", - "value": "x", + "value": "async", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 14, "line": 1, }, "start": Object { - "column": 2, + "column": 6, "line": 1, }, }, "range": Array [ - 2, - 3, + 6, + 14, ], - "type": "Punctuator", - "value": "<", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 19, "line": 1, }, "start": Object { - "column": 4, + "column": 15, "line": 1, }, }, "range": Array [ - 4, - 5, + 15, + 19, ], "type": "Identifier", - "value": "y", + "value": "test", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 20, "line": 1, }, "start": Object { - "column": 6, + "column": 19, "line": 1, }, }, "range": Array [ - 6, - 8, + 19, + 20, ], - "type": "Identifier", - "value": "as", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 21, "line": 1, }, "start": Object { - "column": 9, + "column": 20, "line": 1, }, }, "range": Array [ - 9, - 16, + 20, + 21, ], - "type": "Identifier", - "value": "boolean", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 23, "line": 1, }, "start": Object { - "column": 16, + "column": 22, "line": 1, }, }, "range": Array [ - 16, - 17, + 22, + 23, ], "type": "Punctuator", - "value": ";", + "value": "{", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/cast-as-multi.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "expression": Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 8, - ], - "type": "TSAsExpression", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 8, - ], - "type": "TSAnyKeyword", - }, - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 7, + "line": 2, }, - "range": Array [ - 0, - 13, - ], - "type": "TSAsExpression", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 13, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, + "start": Object { + "column": 4, + "line": 2, }, }, + "range": Array [ + 28, + 31, + ], + "type": "Keyword", + "value": "var", + }, + Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ - 0, - 14, + 32, + 35, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, + "type": "Identifier", + "value": "foo", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "=", }, - }, - "range": Array [ - 0, - 15, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, - "line": 1, + "column": 19, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 14, + "line": 2, }, }, "range": Array [ - 0, - 1, + 38, + 43, ], - "type": "Identifier", - "value": "x", + "type": "String", + "value": "'foo'", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 1, + "column": 20, + "line": 2, }, "start": Object { - "column": 2, - "line": 1, + "column": 19, + "line": 2, }, }, "range": Array [ - 2, - 4, + 43, + 44, ], - "type": "Identifier", - "value": "as", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 7, + "line": 3, }, "start": Object { - "column": 5, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 5, - 8, + 49, + 52, ], - "type": "Identifier", - "value": "any", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { "column": 11, - "line": 1, + "line": 3, }, "start": Object { - "column": 9, - "line": 1, + "column": 8, + "line": 3, }, }, "range": Array [ - 9, - 11, + 53, + 56, ], "type": "Identifier", - "value": "as", + "value": "bar", }, Object { "loc": Object { "end": Object { "column": 13, - "line": 1, + "line": 3, }, "start": Object { "column": 12, - "line": 1, + "line": 3, }, }, "range": Array [ - 12, - 13, + 57, + 58, ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { "column": 14, - "line": 1, + "line": 3, + }, + }, + "range": Array [ + 59, + 64, + ], + "type": "String", + "value": "'bar'", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, }, "start": Object { - "column": 13, - "line": 1, + "column": 19, + "line": 3, }, }, "range": Array [ - 13, - 14, + 64, + 65, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 70, + 75, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 4, + }, + }, + "range": Array [ + 76, + 82, + ], + "type": "Identifier", + "value": "fooBar", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 83, + 84, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 19, + "line": 4, + }, + }, + "range": Array [ + 85, + 93, + ], + "type": "String", + "value": "'fooBar'", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 4, + }, + "start": Object { + "column": 27, + "line": 4, + }, + }, + "range": Array [ + 93, + 94, ], "type": "Punctuator", "value": ";", }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 95, + 96, + ], + "type": "Punctuator", + "value": "}", + }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/cast-as-multi-assign.src 1`] = ` +exports[`typescript fixtures/basics/await-without-async-function.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "left": Object { - "expression": Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, + "async": false, + "body": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 25, + 28, + ], + "type": "Identifier", }, - "start": Object { - "column": 1, - "line": 1, + "init": Object { + "argument": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "name": "baz", + "range": Array [ + 37, + 40, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "optional": false, + "range": Array [ + 37, + 42, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 31, + 42, + ], + "type": "AwaitExpression", }, + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 25, + 42, + ], + "type": "VariableDeclarator", }, - "name": "a", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, + ], + "kind": "const", "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 26, + "line": 2, }, "start": Object { - "column": 1, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 1, - 12, + 19, + 43, ], - "type": "TSAsExpression", - "typeAnnotation": Object { + "type": "VariableDeclaration", + }, + Object { + "argument": Object { + "computed": false, "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 16, + "line": 3, }, "start": Object { - "column": 6, - "line": 1, + "column": 9, + "line": 3, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 53, + 56, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, }, + "name": "qux", + "range": Array [ + 57, + 60, + ], + "type": "Identifier", }, "range": Array [ - 6, - 12, + 53, + 60, ], - "type": "TSNumberKeyword", - }, - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, + "type": "MemberExpression", }, - }, - "range": Array [ - 1, - 19, - ], - "type": "TSAsExpression", - "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 17, + "line": 3, }, "start": Object { - "column": 16, - "line": 1, + "column": 2, + "line": 3, }, }, "range": Array [ - 16, - 19, + 46, + 61, ], - "type": "TSAnyKeyword", + "type": "ReturnStatement", }, - }, + ], "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { - "column": 0, + "column": 15, "line": 1, }, }, - "operator": "=", "range": Array [ - 0, - 25, + 15, + 63, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, }, - "range": Array [ - 23, - 25, - ], - "raw": "42", - "type": "Literal", - "value": 42, }, - "type": "AssignmentExpression", + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { "column": 0, "line": 1, }, }, + "params": Array [], "range": Array [ 0, - 26, + 63, ], - "type": "ExpressionStatement", + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 5, }, "start": Object { "column": 0, @@ -7880,14 +7318,14 @@ Object { }, "range": Array [ 0, - 27, + 64, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 8, "line": 1, }, "start": Object { @@ -7897,532 +7335,612 @@ Object { }, "range": Array [ 0, - 1, + 8, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 12, "line": 1, }, "start": Object { - "column": 1, + "column": 9, "line": 1, }, }, "range": Array [ - 1, - 2, + 9, + 12, ], "type": "Identifier", - "value": "a", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 13, "line": 1, }, "start": Object { - "column": 3, + "column": 12, "line": 1, }, }, "range": Array [ - 3, - 5, + 12, + 13, ], - "type": "Identifier", - "value": "as", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 14, "line": 1, }, "start": Object { - "column": 6, + "column": 13, "line": 1, }, }, "range": Array [ - 6, - 12, + 13, + 14, ], - "type": "Identifier", - "value": "number", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 16, "line": 1, }, "start": Object { - "column": 13, + "column": 15, "line": 1, }, }, "range": Array [ - 13, 15, + 16, ], - "type": "Identifier", - "value": "as", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 16, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 16, 19, + 24, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 25, + 28, ], "type": "Identifier", - "value": "any", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 19, - "line": 1, + "column": 12, + "line": 2, }, }, "range": Array [ - 19, - 20, + 29, + 30, ], "type": "Punctuator", - "value": ")", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 19, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, + "column": 14, + "line": 2, }, }, "range": Array [ - 21, - 22, + 31, + 36, + ], + "type": "Identifier", + "value": "await", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 37, + 40, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 40, + 41, ], "type": "Punctuator", - "value": "=", + "value": "(", }, Object { "loc": Object { "end": Object { "column": 25, - "line": 1, + "line": 2, }, "start": Object { - "column": 23, - "line": 1, + "column": 24, + "line": 2, }, }, "range": Array [ - 23, - 25, + 41, + 42, ], - "type": "Numeric", - "value": "42", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { "column": 26, - "line": 1, + "line": 2, }, "start": Object { "column": 25, - "line": 1, + "line": 2, }, }, "range": Array [ - 25, - 26, + 42, + 43, ], "type": "Punctuator", "value": ";", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/cast-as-operator.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "operator": "===", - "range": Array [ - 0, - 17, - ], - "right": Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 7, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 17, - ], - "type": "TSAsExpression", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 17, - ], - "type": "TSNumberKeyword", - }, - }, - "type": "BinaryExpression", - }, "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 8, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 2, + "line": 3, }, }, "range": Array [ - 0, - 18, + 46, + 52, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Keyword", + "value": "return", }, - }, - "range": Array [ - 0, - 19, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, - "line": 1, + "column": 12, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 9, + "line": 3, }, }, "range": Array [ - 0, - 1, + 53, + 56, ], "type": "Identifier", - "value": "x", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 13, + "line": 3, }, "start": Object { - "column": 2, - "line": 1, + "column": 12, + "line": 3, }, }, "range": Array [ - 2, - 5, + 56, + 57, ], "type": "Punctuator", - "value": "===", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 7, - ], - "type": "Numeric", - "value": "1", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 16, + "line": 3, }, "start": Object { - "column": 8, - "line": 1, + "column": 13, + "line": 3, }, }, "range": Array [ - 8, - 10, + 57, + 60, ], "type": "Identifier", - "value": "as", + "value": "qux", }, Object { "loc": Object { "end": Object { "column": 17, - "line": 1, + "line": 3, }, "start": Object { - "column": 11, - "line": 1, + "column": 16, + "line": 3, }, }, "range": Array [ - 11, - 17, + 60, + 61, ], - "type": "Identifier", - "value": "number", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { - "column": 17, - "line": 1, + "column": 0, + "line": 4, }, }, "range": Array [ - 17, - 18, + 62, + 63, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/cast-as-simple.src 1`] = ` +exports[`typescript fixtures/basics/call-signatures.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 61, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "members": Array [ + Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 21, + "line": 2, }, "start": Object { - "column": 6, - "line": 1, + "column": 2, + "line": 2, }, }, - "name": "foo", + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 16, + 25, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 17, + 25, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 19, + 25, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], "range": Array [ - 6, - 9, + 15, + 34, ], - "type": "Identifier", - }, - "init": Object { - "expression": Object { + "returnType": Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 21, + "line": 2, }, "start": Object { - "column": 12, - "line": 1, + "column": 13, + "line": 2, }, }, - "name": "x", "range": Array [ - 12, - 13, + 26, + 34, ], - "type": "Identifier", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 28, + 34, + ], + "type": "TSStringKeyword", + }, }, + "type": "TSCallSignatureDeclaration", + }, + Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 24, + "line": 3, }, "start": Object { - "column": 12, - "line": 1, + "column": 2, + "line": 3, }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "name": "a", + "range": Array [ + 41, + 50, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 42, + 50, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 44, + 50, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], "range": Array [ - 12, - 20, + 37, + 59, ], - "type": "TSAsExpression", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 24, + "line": 3, }, "start": Object { - "column": 17, - "line": 1, + "column": 16, + "line": 3, }, }, "range": Array [ - 17, - 20, + 51, + 59, ], - "type": "TSAnyKeyword", - }, - }, - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "range": Array [ + 53, + 59, + ], + "type": "TSStringKeyword", + }, }, + "type": "TSConstructSignatureDeclaration", }, - "range": Array [ - 6, - 20, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, + ], + "range": Array [ + 11, + 61, + ], + "type": "TSTypeLiteral", }, - "range": Array [ - 0, - 21, - ], - "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 5, }, "start": Object { "column": 0, @@ -8431,14 +7949,14 @@ Object { }, "range": Array [ 0, - 22, + 62, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 4, "line": 1, }, "start": Object { @@ -8448,25 +7966,25 @@ Object { }, "range": Array [ 0, - 5, + 4, ], - "type": "Keyword", - "value": "const", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 8, "line": 1, }, "start": Object { - "column": 6, + "column": 5, "line": 1, }, }, "range": Array [ - 6, - 9, + 5, + 8, ], "type": "Identifier", "value": "foo", @@ -8474,17 +7992,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 10, "line": 1, }, "start": Object { - "column": 10, + "column": 9, "line": 1, }, }, "range": Array [ + 9, 10, - 11, ], "type": "Punctuator", "value": "=", @@ -8492,479 +8010,305 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 12, "line": 1, }, "start": Object { - "column": 12, + "column": 11, "line": 1, }, }, "range": Array [ + 11, 12, - 13, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 3, + "line": 2, }, "start": Object { - "column": 14, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 14, + 15, 16, ], - "type": "Identifier", - "value": "as", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 4, + "line": 2, }, "start": Object { - "column": 17, - "line": 1, + "column": 3, + "line": 2, }, }, "range": Array [ + 16, 17, - 20, ], "type": "Identifier", - "value": "any", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 5, + "line": 2, }, "start": Object { - "column": 20, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 20, - 21, + 17, + 18, ], "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-multi-line-keyword-abstract.src 1`] = ` -Object { - "body": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "name": "abstract", - "range": Array [ - 0, - 8, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 8, - ], - "type": "ExpressionStatement", + "value": ":", }, Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "range": Array [ - 17, - 19, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 6, - "line": 2, - }, - }, - "name": "B", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 10, + "column": 12, "line": 2, }, "start": Object { - "column": 0, + "column": 6, "line": 2, }, }, "range": Array [ - 9, 19, + 25, ], - "superClass": null, - "type": "ClassDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "string", }, - }, - "range": Array [ - 0, - 20, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 12, + "line": 2, }, }, "range": Array [ - 0, - 8, + 25, + 26, ], - "type": "Keyword", - "value": "abstract", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 14, "line": 2, }, "start": Object { - "column": 0, + "column": 13, "line": 2, }, }, "range": Array [ - 9, - 14, + 26, + 27, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 21, "line": 2, }, "start": Object { - "column": 6, + "column": 15, "line": 2, }, }, "range": Array [ - 15, - 16, + 28, + 34, ], "type": "Identifier", - "value": "B", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 5, + "line": 3, }, "start": Object { - "column": 8, - "line": 2, + "column": 2, + "line": 3, }, }, "range": Array [ - 17, - 18, + 37, + 40, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "new", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 6, + "line": 3, }, "start": Object { - "column": 9, - "line": 2, + "column": 5, + "line": 3, }, }, "range": Array [ - 18, - 19, + 40, + 41, ], "type": "Punctuator", - "value": "}", + "value": "(", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-multi-line-keyword-declare.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "name": "declare", - "range": Array [ - 0, - 7, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { "column": 7, - "line": 1, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 6, + "line": 3, }, }, "range": Array [ - 0, - 7, + 41, + 42, ], - "type": "ExpressionStatement", + "type": "Identifier", + "value": "a", }, Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "range": Array [ - 16, - 18, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 6, - "line": 2, - }, - }, - "name": "B", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 8, + "line": 3, }, "start": Object { - "column": 0, - "line": 2, + "column": 7, + "line": 3, }, }, "range": Array [ - 8, - 18, + 42, + 43, ], - "superClass": null, - "type": "ClassDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ":", }, - }, - "range": Array [ - 0, - 19, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 15, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 9, + "line": 3, }, }, "range": Array [ - 0, - 7, + 44, + 50, ], - "type": "Keyword", - "value": "declare", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 16, + "line": 3, }, "start": Object { - "column": 0, - "line": 2, + "column": 15, + "line": 3, }, }, "range": Array [ - 8, - 13, + 50, + 51, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 17, + "line": 3, }, "start": Object { - "column": 6, - "line": 2, + "column": 16, + "line": 3, }, }, "range": Array [ - 14, - 15, + 51, + 52, ], - "type": "Identifier", - "value": "B", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 24, + "line": 3, }, "start": Object { - "column": 8, - "line": 2, + "column": 18, + "line": 3, }, }, "range": Array [ - 16, - 17, + 53, + 59, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 1, + "line": 4, }, "start": Object { - "column": 9, - "line": 2, + "column": 0, + "line": 4, }, }, "range": Array [ - 17, - 18, + 60, + 61, ], "type": "Punctuator", "value": "}", @@ -8974,36 +8318,59 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-accessibility-modifiers.src 1`] = ` +exports[`typescript fixtures/basics/call-signatures-with-generics.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 67, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "members": Array [ Object { - "accessibility": "private", - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "name": "bar", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 23, + "column": 24, "line": 2, }, "start": Object { @@ -9011,567 +8378,326 @@ Object { "line": 2, }, }, - "range": Array [ - 14, - 35, - ], - "static": false, - "type": "ClassProperty", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "range": Array [ - 26, - 34, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 22, + "column": 15, "line": 2, }, "start": Object { - "column": 16, + "column": 6, "line": 2, }, }, + "name": "a", "range": Array [ + 19, 28, - 34, ], - "type": "TSStringKeyword", - }, - }, - "value": null, - }, - Object { - "accessibility": "public", - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 16, - "line": 3, + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 20, + 28, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 22, + 28, + ], + "type": "TSStringKeyword", + }, }, }, - "name": "baz", - "range": Array [ - 52, - 55, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 29, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, + ], "range": Array [ - 38, - 65, + 15, + 37, ], - "static": true, - "type": "ClassProperty", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { - "column": 28, - "line": 3, + "column": 24, + "line": 2, }, "start": Object { - "column": 20, - "line": 3, + "column": 16, + "line": 2, }, }, "range": Array [ - 56, - 64, + 29, + 37, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 28, - "line": 3, + "column": 24, + "line": 2, }, "start": Object { - "column": 22, - "line": 3, + "column": 18, + "line": 2, }, }, "range": Array [ - 58, - 64, + 31, + 37, ], - "type": "TSNumberKeyword", + "type": "TSStringKeyword", }, }, - "value": null, - }, - Object { - "accessibility": "public", - "computed": false, - "key": Object { + "type": "TSCallSignatureDeclaration", + "typeParameters": Object { "loc": Object { "end": Object { - "column": 15, - "line": 4, + "column": 5, + "line": 2, }, "start": Object { - "column": 9, - "line": 4, + "column": 2, + "line": 2, }, }, - "name": "getBar", - "range": Array [ - 75, - 81, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 3, - "line": 6, - }, - "start": Object { - "column": 2, - "line": 4, - }, - }, - "range": Array [ - 68, - 111, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 19, - "line": 5, - }, - "start": Object { - "column": 11, - "line": 5, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 5, - }, - "start": Object { - "column": 11, - "line": 5, - }, - }, - "range": Array [ - 98, - 102, - ], - "type": "ThisExpression", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 5, - }, - "start": Object { - "column": 16, - "line": 5, - }, - }, - "name": "bar", - "range": Array [ - 103, - 106, - ], - "type": "Identifier", - }, - "range": Array [ - 98, - 106, - ], - "type": "MemberExpression", + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, }, + }, + "name": Object { "loc": Object { "end": Object { - "column": 20, - "line": 5, + "column": 4, + "line": 2, }, "start": Object { - "column": 4, - "line": 5, + "column": 3, + "line": 2, }, }, + "name": "T", "range": Array [ - 91, - 107, + 16, + 17, ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 3, - "line": 6, - }, - "start": Object { - "column": 19, - "line": 4, + "type": "Identifier", }, + "range": Array [ + 16, + 17, + ], + "type": "TSTypeParameter", }, - "range": Array [ - 85, - 111, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 3, - "line": 6, - }, - "start": Object { - "column": 16, - "line": 4, - }, - }, - "params": Array [], + ], "range": Array [ - 82, - 111, + 15, + 18, ], - "type": "FunctionExpression", + "type": "TSTypeParameterDeclaration", }, }, Object { - "accessibility": "protected", - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 7, - }, - "start": Object { - "column": 12, - "line": 7, - }, - }, - "name": "setBar", - "range": Array [ - 124, - 130, - ], - "type": "Identifier", - }, - "kind": "method", "loc": Object { "end": Object { - "column": 3, - "line": 9, + "column": 27, + "line": 3, }, "start": Object { "column": 2, - "line": 7, + "line": 3, }, }, - "range": Array [ - 114, - 171, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "expression": Object { - "left": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 12, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "range": Array [ - 152, - 156, - ], - "type": "ThisExpression", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 8, - }, - "start": Object { - "column": 9, - "line": 8, - }, - }, - "name": "bar", - "range": Array [ - 157, - 160, - ], - "type": "Identifier", - }, - "range": Array [ - 152, - 160, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 18, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "operator": "=", - "range": Array [ - 152, - 166, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 8, - }, - "start": Object { - "column": 15, - "line": 8, - }, - }, - "name": "bar", - "range": Array [ - 163, - 166, - ], - "type": "Identifier", - }, - "type": "AssignmentExpression", + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "name": "a", + "range": Array [ + 47, + 56, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 48, + 56, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 19, - "line": 8, + "column": 18, + "line": 3, }, "start": Object { - "column": 4, - "line": 8, + "column": 12, + "line": 3, }, }, "range": Array [ - 152, - 167, + 50, + 56, ], - "type": "ExpressionStatement", + "type": "TSStringKeyword", }, - ], + }, + }, + ], + "range": Array [ + 40, + 65, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 3, + }, + }, + "range": Array [ + 57, + 65, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 3, - "line": 9, + "column": 27, + "line": 3, }, "start": Object { - "column": 34, - "line": 7, + "column": 21, + "line": 3, }, }, "range": Array [ - 146, - 171, + 59, + 65, ], - "type": "BlockStatement", + "type": "TSStringKeyword", }, - "expression": false, - "generator": false, - "id": null, + }, + "type": "TSConstructSignatureDeclaration", + "typeParameters": Object { "loc": Object { "end": Object { - "column": 3, - "line": 9, + "column": 8, + "line": 3, }, "start": Object { - "column": 19, - "line": 7, + "column": 5, + "line": 3, }, }, "params": Array [ Object { "loc": Object { "end": Object { - "column": 32, - "line": 7, + "column": 7, + "line": 3, }, "start": Object { - "column": 20, - "line": 7, + "column": 6, + "line": 3, }, }, - "name": "bar", - "range": Array [ - 132, - 144, - ], - "type": "Identifier", - "typeAnnotation": Object { + "name": Object { "loc": Object { "end": Object { - "column": 32, - "line": 7, + "column": 7, + "line": 3, }, "start": Object { - "column": 24, - "line": 7, + "column": 6, + "line": 3, }, }, + "name": "T", "range": Array [ - 136, - 144, + 44, + 45, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 7, - }, - "start": Object { - "column": 26, - "line": 7, - }, - }, - "range": Array [ - 138, - 144, - ], - "type": "TSStringKeyword", - }, + "type": "Identifier", }, + "range": Array [ + 44, + 45, + ], + "type": "TSTypeParameter", }, ], "range": Array [ - 131, - 171, + 43, + 46, ], - "type": "FunctionExpression", + "type": "TSTypeParameterDeclaration", }, }, ], - "loc": Object { - "end": Object { - "column": 1, - "line": 10, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 173, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "Foo", "range": Array [ - 6, - 9, + 11, + 67, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 10, - }, - "start": Object { - "column": 0, - "line": 1, - }, + "type": "TSTypeLiteral", }, - "range": Array [ - 0, - 173, - ], - "superClass": null, - "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 11, + "line": 5, }, "start": Object { "column": 0, @@ -9580,14 +8706,14 @@ Object { }, "range": Array [ 0, - 174, + 68, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 4, "line": 1, }, "start": Object { @@ -9597,43 +8723,61 @@ Object { }, "range": Array [ 0, - 5, + 4, ], - "type": "Keyword", - "value": "class", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 8, "line": 1, }, "start": Object { - "column": 6, + "column": 5, "line": 1, }, }, "range": Array [ - 6, - 9, + 5, + 8, ], "type": "Identifier", - "value": "Foo", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 10, "line": 1, }, "start": Object { - "column": 10, + "column": 9, "line": 1, }, }, "range": Array [ + 9, 10, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ 11, + 12, ], "type": "Punctuator", "value": "{", @@ -9641,7 +8785,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 3, "line": 2, }, "start": Object { @@ -9650,152 +8794,152 @@ Object { }, }, "range": Array [ - 14, - 21, + 15, + 16, ], - "type": "Keyword", - "value": "private", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 4, "line": 2, }, "start": Object { - "column": 10, + "column": 3, "line": 2, }, }, "range": Array [ - 22, - 25, + 16, + 17, ], "type": "Identifier", - "value": "bar", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 5, "line": 2, }, "start": Object { - "column": 14, + "column": 4, "line": 2, }, }, "range": Array [ - 26, - 27, + 17, + 18, ], "type": "Punctuator", - "value": ":", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 6, "line": 2, }, "start": Object { - "column": 16, + "column": 5, "line": 2, }, }, "range": Array [ - 28, - 34, + 18, + 19, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 7, "line": 2, }, "start": Object { - "column": 22, + "column": 6, "line": 2, }, }, "range": Array [ - 34, - 35, + 19, + 20, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { "column": 8, - "line": 3, + "line": 2, }, "start": Object { - "column": 2, - "line": 3, + "column": 7, + "line": 2, }, }, "range": Array [ - 38, - 44, + 20, + 21, ], - "type": "Keyword", - "value": "public", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { "column": 15, - "line": 3, + "line": 2, }, "start": Object { "column": 9, - "line": 3, + "line": 2, }, }, "range": Array [ - 45, - 51, + 22, + 28, ], - "type": "Keyword", - "value": "static", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 3, + "column": 16, + "line": 2, }, "start": Object { - "column": 16, - "line": 3, + "column": 15, + "line": 2, }, }, "range": Array [ - 52, - 55, + 28, + 29, ], - "type": "Identifier", - "value": "baz", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 3, + "column": 17, + "line": 2, }, "start": Object { - "column": 20, - "line": 3, + "column": 16, + "line": 2, }, }, "range": Array [ - 56, - 57, + 29, + 30, ], "type": "Punctuator", "value": ":", @@ -9803,734 +8947,865 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, - "line": 3, + "column": 24, + "line": 2, }, "start": Object { - "column": 22, - "line": 3, + "column": 18, + "line": 2, }, }, "range": Array [ - 58, - 64, + 31, + 37, ], "type": "Identifier", - "value": "number", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 3, - }, - "start": Object { - "column": 28, + "column": 5, "line": 3, }, - }, - "range": Array [ - 64, - 65, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 4, - }, "start": Object { "column": 2, - "line": 4, + "line": 3, }, }, "range": Array [ - 68, - 74, + 40, + 43, ], "type": "Keyword", - "value": "public", + "value": "new", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 4, + "column": 6, + "line": 3, }, "start": Object { - "column": 9, - "line": 4, + "column": 5, + "line": 3, }, }, "range": Array [ - 75, - 81, + 43, + 44, ], - "type": "Identifier", - "value": "getBar", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 4, + "column": 7, + "line": 3, }, "start": Object { - "column": 16, - "line": 4, + "column": 6, + "line": 3, }, }, "range": Array [ - 82, - 83, + 44, + 45, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 4, + "column": 8, + "line": 3, }, "start": Object { - "column": 17, - "line": 4, + "column": 7, + "line": 3, }, }, "range": Array [ - 83, - 84, + 45, + 46, ], "type": "Punctuator", - "value": ")", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 4, + "column": 9, + "line": 3, }, "start": Object { - "column": 19, - "line": 4, + "column": 8, + "line": 3, }, }, "range": Array [ - 85, - 86, + 46, + 47, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { "column": 10, - "line": 5, + "line": 3, }, "start": Object { - "column": 4, - "line": 5, + "column": 9, + "line": 3, }, }, "range": Array [ - 91, - 97, + 47, + 48, ], - "type": "Keyword", - "value": "return", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 5, - }, - "start": Object { "column": 11, - "line": 5, - }, - }, - "range": Array [ - 98, - 102, - ], - "type": "Keyword", - "value": "this", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 5, + "line": 3, }, "start": Object { - "column": 15, - "line": 5, + "column": 10, + "line": 3, }, }, "range": Array [ - 102, - 103, + 48, + 49, ], "type": "Punctuator", - "value": ".", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 5, + "column": 18, + "line": 3, }, "start": Object { - "column": 16, - "line": 5, + "column": 12, + "line": 3, }, }, "range": Array [ - 103, - 106, + 50, + 56, ], "type": "Identifier", - "value": "bar", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 5, - }, - "start": Object { "column": 19, - "line": 5, - }, - }, - "range": Array [ - 106, - 107, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 6, + "line": 3, }, "start": Object { - "column": 2, - "line": 6, + "column": 18, + "line": 3, }, }, "range": Array [ - 110, - 111, + 56, + 57, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 7, + "column": 20, + "line": 3, }, "start": Object { - "column": 2, - "line": 7, + "column": 19, + "line": 3, }, }, "range": Array [ - 114, - 123, + 57, + 58, ], - "type": "Keyword", - "value": "protected", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 7, + "column": 27, + "line": 3, }, "start": Object { - "column": 12, - "line": 7, + "column": 21, + "line": 3, }, }, "range": Array [ - 124, - 130, + 59, + 65, ], "type": "Identifier", - "value": "setBar", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 7, + "column": 1, + "line": 4, }, "start": Object { - "column": 19, - "line": 7, + "column": 0, + "line": 4, }, }, "range": Array [ - 131, - 132, + 66, + 67, ], "type": "Punctuator", - "value": "(", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/cast-as-expression.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 7, - }, - "start": Object { - "column": 20, - "line": 7, - }, - }, - "range": Array [ - 132, - 135, + "expression": Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "<", + "range": Array [ + 0, + 5, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "type": "TSAsExpression", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 16, + ], + "type": "TSBooleanKeyword", + }, + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, ], "type": "Identifier", - "value": "bar", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 7, + "column": 3, + "line": 1, }, "start": Object { - "column": 24, - "line": 7, + "column": 2, + "line": 1, }, }, "range": Array [ - 136, - 137, + 2, + 3, ], "type": "Punctuator", - "value": ":", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 7, + "column": 5, + "line": 1, }, "start": Object { - "column": 26, - "line": 7, + "column": 4, + "line": 1, }, }, "range": Array [ - 138, - 144, + 4, + 5, ], "type": "Identifier", - "value": "string", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 7, + "column": 8, + "line": 1, }, "start": Object { - "column": 32, - "line": 7, + "column": 6, + "line": 1, }, }, "range": Array [ - 144, - 145, + 6, + 8, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "as", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 7, + "column": 16, + "line": 1, }, "start": Object { - "column": 34, - "line": 7, + "column": 9, + "line": 1, }, }, "range": Array [ - 146, - 147, + 9, + 16, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "boolean", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 8, + "column": 17, + "line": 1, }, "start": Object { - "column": 4, - "line": 8, + "column": 16, + "line": 1, }, }, "range": Array [ - 152, - 156, + 16, + 17, ], - "type": "Keyword", - "value": "this", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/cast-as-multi.src 1`] = ` +Object { + "body": Array [ Object { + "expression": Object { + "expression": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "TSAsExpression", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "TSAnyKeyword", + }, + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "TSAsExpression", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + }, + }, "loc": Object { "end": Object { - "column": 9, - "line": 8, + "column": 14, + "line": 1, }, "start": Object { - "column": 8, - "line": 8, + "column": 0, + "line": 1, }, }, "range": Array [ - 156, - 157, + 0, + 14, ], - "type": "Punctuator", - "value": ".", + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 15, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 12, - "line": 8, + "column": 1, + "line": 1, }, "start": Object { - "column": 9, - "line": 8, + "column": 0, + "line": 1, }, }, "range": Array [ - 157, - 160, + 0, + 1, ], "type": "Identifier", - "value": "bar", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 8, + "column": 4, + "line": 1, }, "start": Object { - "column": 13, - "line": 8, + "column": 2, + "line": 1, }, }, "range": Array [ - 161, - 162, + 2, + 4, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "as", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 8, + "column": 8, + "line": 1, }, "start": Object { - "column": 15, - "line": 8, + "column": 5, + "line": 1, }, }, "range": Array [ - 163, - 166, + 5, + 8, ], "type": "Identifier", - "value": "bar", + "value": "any", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 8, + "column": 11, + "line": 1, }, "start": Object { - "column": 18, - "line": 8, + "column": 9, + "line": 1, }, }, "range": Array [ - 166, - 167, + 9, + 11, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "as", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 9, + "column": 13, + "line": 1, }, "start": Object { - "column": 2, - "line": 9, + "column": 12, + "line": 1, }, }, "range": Array [ - 170, - 171, + 12, + 13, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 10, + "column": 14, + "line": 1, }, "start": Object { - "column": 0, - "line": 10, + "column": 13, + "line": 1, }, }, "range": Array [ - 172, - 173, + 13, + 14, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/class-with-constructor-and-modifier.src 1`] = ` +exports[`typescript fixtures/basics/cast-as-multi-assign.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "accessibility": "protected", - "computed": false, - "key": Object { + "expression": Object { + "left": Object { + "expression": Object { + "expression": Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 2, + "line": 1, }, "start": Object { - "column": 12, - "line": 2, + "column": 1, + "line": 1, }, }, - "name": "constructor", + "name": "a", "range": Array [ - 22, - 33, + 1, + 2, ], "type": "Identifier", }, - "kind": "constructor", "loc": Object { "end": Object { - "column": 29, - "line": 2, + "column": 12, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 1, + "line": 1, }, }, "range": Array [ + 1, 12, - 39, ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 29, - "line": 2, - }, - "start": Object { - "column": 26, - "line": 2, - }, - }, - "range": Array [ - 36, - 39, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, + "type": "TSAsExpression", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 29, - "line": 2, + "column": 12, + "line": 1, }, "start": Object { - "column": 23, - "line": 2, + "column": 6, + "line": 1, }, }, - "params": Array [], "range": Array [ - 33, - 39, + 6, + 12, ], - "type": "FunctionExpression", + "type": "TSNumberKeyword", }, }, - Object { - "accessibility": "public", - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 4, - }, - "start": Object { - "column": 10, - "line": 4, - }, - }, - "range": Array [ - 51, - 64, - ], - "raw": "'constructor'", - "type": "Literal", - "value": "constructor", + "loc": Object { + "end": Object { + "column": 19, + "line": 1, }, - "kind": "method", + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 19, + ], + "type": "TSAsExpression", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 30, - "line": 4, + "column": 19, + "line": 1, }, "start": Object { - "column": 2, - "line": 4, + "column": 16, + "line": 1, }, }, "range": Array [ - 43, - 71, + 16, + 19, ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 30, - "line": 4, - }, - "start": Object { - "column": 27, - "line": 4, - }, - }, - "range": Array [ - 68, - 71, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 30, - "line": 4, - }, - "start": Object { - "column": 24, - "line": 4, - }, - }, - "params": Array [], - "range": Array [ - 65, - 71, - ], - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 1, + "type": "TSAnyKeyword", }, }, - "range": Array [ - 8, - 73, - ], - "type": "ClassBody", - }, - "id": Object { "loc": Object { "end": Object { - "column": 7, + "column": 25, "line": 1, }, "start": Object { - "column": 6, + "column": 0, "line": 1, }, }, - "name": "C", + "operator": "=", "range": Array [ - 6, - 7, + 0, + 25, ], - "type": "Identifier", + "right": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 25, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "type": "AssignmentExpression", }, "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 26, + "line": 1, }, "start": Object { "column": 0, @@ -10539,16 +9814,15 @@ Object { }, "range": Array [ 0, - 73, + 26, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { "column": 0, - "line": 6, + "line": 2, }, "start": Object { "column": 0, @@ -10557,14 +9831,14 @@ Object { }, "range": Array [ 0, - 74, + 27, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 1, "line": 1, }, "start": Object { @@ -10574,115 +9848,115 @@ Object { }, "range": Array [ 0, - 5, + 1, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 2, "line": 1, }, "start": Object { - "column": 6, + "column": 1, "line": 1, }, }, "range": Array [ - 6, - 7, + 1, + 2, ], "type": "Identifier", - "value": "C", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 5, "line": 1, }, "start": Object { - "column": 8, + "column": 3, "line": 1, }, }, "range": Array [ - 8, - 9, + 3, + 5, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "as", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 12, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 6, + "line": 1, }, }, "range": Array [ + 6, 12, - 21, ], - "type": "Keyword", - "value": "protected", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 15, + "line": 1, }, "start": Object { - "column": 12, - "line": 2, + "column": 13, + "line": 1, }, }, "range": Array [ - 22, - 33, + 13, + 15, ], "type": "Identifier", - "value": "constructor", + "value": "as", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 2, + "column": 19, + "line": 1, }, "start": Object { - "column": 23, - "line": 2, + "column": 16, + "line": 1, }, }, "range": Array [ - 33, - 34, + 16, + 19, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "any", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 20, + "line": 1, }, "start": Object { - "column": 24, - "line": 2, + "column": 19, + "line": 1, }, }, "range": Array [ - 34, - 35, + 19, + 20, ], "type": "Punctuator", "value": ")", @@ -10690,476 +9964,399 @@ Object { Object { "loc": Object { "end": Object { - "column": 27, - "line": 2, + "column": 22, + "line": 1, }, "start": Object { - "column": 26, - "line": 2, + "column": 21, + "line": 1, }, }, "range": Array [ - 36, - 37, + 21, + 22, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 2, + "column": 25, + "line": 1, }, "start": Object { - "column": 28, - "line": 2, + "column": 23, + "line": 1, }, }, "range": Array [ - 38, - 39, + 23, + 25, ], - "type": "Punctuator", - "value": "}", + "type": "Numeric", + "value": "42", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 4, + "column": 26, + "line": 1, }, "start": Object { - "column": 2, - "line": 4, + "column": 25, + "line": 1, }, }, "range": Array [ - 43, - 49, + 25, + 26, ], - "type": "Keyword", - "value": "public", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/cast-as-operator.src 1`] = ` +Object { + "body": Array [ Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "===", + "range": Array [ + 0, + 17, + ], + "right": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 17, + ], + "type": "TSAsExpression", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 17, + ], + "type": "TSNumberKeyword", + }, + }, + "type": "BinaryExpression", + }, "loc": Object { "end": Object { - "column": 10, - "line": 4, + "column": 18, + "line": 1, }, "start": Object { - "column": 9, - "line": 4, + "column": 0, + "line": 1, }, }, "range": Array [ - 50, - 51, + 0, + 18, ], - "type": "Punctuator", - "value": "[", + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 19, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 23, - "line": 4, + "column": 1, + "line": 1, }, "start": Object { - "column": 10, - "line": 4, + "column": 0, + "line": 1, }, }, "range": Array [ - 51, - 64, + 0, + 1, ], - "type": "String", - "value": "'constructor'", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 4, + "column": 5, + "line": 1, }, "start": Object { - "column": 23, - "line": 4, + "column": 2, + "line": 1, }, }, "range": Array [ - 64, - 65, + 2, + 5, ], "type": "Punctuator", - "value": "]", + "value": "===", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 4, + "column": 7, + "line": 1, }, "start": Object { - "column": 24, - "line": 4, + "column": 6, + "line": 1, }, }, "range": Array [ - 65, - 66, + 6, + 7, ], - "type": "Punctuator", - "value": "(", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 4, + "column": 10, + "line": 1, }, "start": Object { - "column": 25, - "line": 4, + "column": 8, + "line": 1, }, }, "range": Array [ - 66, - 67, + 8, + 10, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "as", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 4, + "column": 17, + "line": 1, }, "start": Object { - "column": 27, - "line": 4, + "column": 11, + "line": 1, }, }, "range": Array [ - 68, - 69, + 11, + 17, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 4, + "column": 18, + "line": 1, }, "start": Object { - "column": 29, - "line": 4, - }, - }, - "range": Array [ - 70, - 71, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, + "column": 17, + "line": 1, }, }, "range": Array [ - 72, - 73, + 17, + 18, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/class-with-constructor-and-return-type.src 1`] = ` +exports[`typescript fixtures/basics/cast-as-simple.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "name": "constructor", - "range": Array [ - 12, - 23, - ], - "type": "Identifier", - }, - "kind": "constructor", + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { - "column": 27, - "line": 2, + "column": 9, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 6, + "line": 1, }, }, + "name": "foo", "range": Array [ - 12, - 37, + 6, + 9, ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 27, - "line": 2, - }, - "start": Object { - "column": 24, - "line": 2, - }, - }, - "range": Array [ - 34, - 37, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 27, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "params": Array [], - "range": Array [ - 23, - 37, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 15, - "line": 2, - }, - }, - "range": Array [ - 25, - 33, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "range": Array [ - 27, - 33, - ], - "type": "TSNumberKeyword", - }, - }, - "type": "FunctionExpression", - }, + "type": "Identifier", }, - Object { - "computed": true, - "key": Object { + "init": Object { + "expression": Object { "loc": Object { "end": Object { - "column": 16, - "line": 4, + "column": 13, + "line": 1, }, "start": Object { - "column": 3, - "line": 4, + "column": 12, + "line": 1, }, }, + "name": "x", "range": Array [ - 42, - 55, + 12, + 13, ], - "raw": "'constructor'", - "type": "Literal", - "value": "constructor", + "type": "Identifier", }, - "kind": "method", "loc": Object { "end": Object { - "column": 31, - "line": 4, + "column": 20, + "line": 1, }, "start": Object { - "column": 2, - "line": 4, + "column": 12, + "line": 1, }, }, "range": Array [ - 41, - 70, + 12, + 20, ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 31, - "line": 4, - }, - "start": Object { - "column": 28, - "line": 4, - }, - }, - "range": Array [ - 67, - 70, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, + "type": "TSAsExpression", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 31, - "line": 4, + "column": 20, + "line": 1, }, "start": Object { "column": 17, - "line": 4, + "line": 1, }, }, - "params": Array [], "range": Array [ - 56, - 70, + 17, + 20, ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 4, - }, - "start": Object { - "column": 19, - "line": 4, - }, - }, - "range": Array [ - 58, - 66, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 4, - }, - "start": Object { - "column": 21, - "line": 4, - }, - }, - "range": Array [ - 60, - 66, - ], - "type": "TSNumberKeyword", - }, - }, - "type": "FunctionExpression", + "type": "TSAnyKeyword", }, }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 72, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, }, + "range": Array [ + 6, + 20, + ], + "type": "VariableDeclarator", }, - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, + ], + "kind": "const", "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 21, + "line": 1, }, "start": Object { "column": 0, @@ -11168,16 +10365,15 @@ Object { }, "range": Array [ 0, - 72, + 21, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 6, + "line": 2, }, "start": Object { "column": 0, @@ -11186,7 +10382,7 @@ Object { }, "range": Array [ 0, - 73, + 22, ], "sourceType": "script", "tokens": Array [ @@ -11206,12 +10402,12 @@ Object { 5, ], "type": "Keyword", - "value": "class", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 9, "line": 1, }, "start": Object { @@ -11221,331 +10417,505 @@ Object { }, "range": Array [ 6, - 7, + 9, ], "type": "Identifier", - "value": "C", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 11, "line": 1, }, "start": Object { - "column": 8, + "column": 10, "line": 1, }, }, "range": Array [ - 8, - 9, + 10, + 11, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { "column": 13, - "line": 2, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 12, + "line": 1, }, }, "range": Array [ 12, - 23, + 13, ], "type": "Identifier", - "value": "constructor", + "value": "x", }, Object { "loc": Object { "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { "column": 14, - "line": 2, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, }, "start": Object { - "column": 13, - "line": 2, + "column": 17, + "line": 1, }, }, "range": Array [ - 23, - 24, + 17, + 20, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "any", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { - "column": 14, - "line": 2, + "column": 20, + "line": 1, }, }, "range": Array [ - 24, - 25, + 20, + 21, ], "type": "Punctuator", - "value": ")", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-multi-line-keyword-abstract.src 1`] = ` +Object { + "body": Array [ Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "abstract", + "range": Array [ + 0, + 8, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 8, + "line": 1, }, "start": Object { - "column": 15, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 25, - 26, + 0, + 8, ], - "type": "Punctuator", - "value": ":", + "type": "ExpressionStatement", }, Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 17, + 19, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "name": "B", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 23, + "column": 10, "line": 2, }, "start": Object { - "column": 17, + "column": 0, "line": 2, }, }, "range": Array [ - 27, - 33, + 9, + 19, ], - "type": "Identifier", - "value": "number", + "superClass": null, + "type": "ClassDeclaration", }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 8, + "line": 1, }, "start": Object { - "column": 24, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 34, - 35, + 0, + 8, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "abstract", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 5, "line": 2, }, "start": Object { - "column": 26, + "column": 0, "line": 2, }, }, "range": Array [ - 36, - 37, + 9, + 14, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 4, + "column": 7, + "line": 2, }, "start": Object { - "column": 2, - "line": 4, + "column": 6, + "line": 2, }, }, "range": Array [ - 41, - 42, + 15, + 16, ], - "type": "Punctuator", - "value": "[", + "type": "Identifier", + "value": "B", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 4, + "column": 9, + "line": 2, }, "start": Object { - "column": 3, - "line": 4, + "column": 8, + "line": 2, }, }, "range": Array [ - 42, - 55, + 17, + 18, ], - "type": "String", - "value": "'constructor'", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 4, + "column": 10, + "line": 2, }, "start": Object { - "column": 16, - "line": 4, + "column": 9, + "line": 2, }, }, "range": Array [ - 55, - 56, + 18, + 19, ], "type": "Punctuator", - "value": "]", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-multi-line-keyword-declare.src 1`] = ` +Object { + "body": Array [ Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "declare", + "range": Array [ + 0, + 7, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 18, - "line": 4, + "column": 7, + "line": 1, }, "start": Object { - "column": 17, - "line": 4, + "column": 0, + "line": 1, }, }, "range": Array [ - 56, - 57, + 0, + 7, ], - "type": "Punctuator", - "value": "(", + "type": "ExpressionStatement", }, Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 16, + 18, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "name": "B", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 19, - "line": 4, + "column": 10, + "line": 2, }, "start": Object { - "column": 18, - "line": 4, + "column": 0, + "line": 2, }, }, "range": Array [ - 57, - 58, + 8, + 18, ], - "type": "Punctuator", - "value": ")", + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 19, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 20, - "line": 4, + "column": 7, + "line": 1, }, "start": Object { - "column": 19, - "line": 4, + "column": 0, + "line": 1, }, }, "range": Array [ - 58, - 59, + 0, + 7, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 4, + "column": 5, + "line": 2, }, "start": Object { - "column": 21, - "line": 4, + "column": 0, + "line": 2, }, }, "range": Array [ - 60, - 66, + 8, + 13, ], - "type": "Identifier", - "value": "number", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 4, + "column": 7, + "line": 2, }, "start": Object { - "column": 28, - "line": 4, + "column": 6, + "line": 2, }, }, "range": Array [ - 67, - 68, + 14, + 15, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "B", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 4, + "column": 9, + "line": 2, }, "start": Object { - "column": 30, - "line": 4, + "column": 8, + "line": 2, }, }, "range": Array [ - 69, - 70, + 16, + 17, ], "type": "Punctuator", - "value": "}", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 10, + "line": 2, }, "start": Object { - "column": 0, - "line": 5, + "column": 9, + "line": 2, }, }, "range": Array [ - 71, - 72, + 17, + 18, ], "type": "Punctuator", "value": "}", @@ -11555,14 +10925,16 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-constructor-and-type-parameters.src 1`] = ` +exports[`typescript fixtures/basics/class-with-accessibility-modifiers.src 1`] = ` Object { "body": Array [ Object { "body": Object { "body": Array [ Object { + "accessibility": "private", "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -11570,21 +10942,20 @@ Object { "line": 2, }, "start": Object { - "column": 2, + "column": 10, "line": 2, }, }, - "name": "constructor", + "name": "bar", "range": Array [ - 12, - 23, + 22, + 25, ], "type": "Identifier", }, - "kind": "constructor", "loc": Object { "end": Object { - "column": 22, + "column": 23, "line": 2, }, "start": Object { @@ -11593,132 +10964,147 @@ Object { }, }, "range": Array [ - 12, - 32, + 14, + 35, ], "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 26, + 34, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { "column": 22, "line": 2, }, "start": Object { - "column": 19, + "column": 16, "line": 2, }, }, "range": Array [ - 29, - 32, + 28, + 34, ], - "type": "BlockStatement", + "type": "TSStringKeyword", }, - "expression": false, - "generator": false, - "id": null, + }, + "value": null, + }, + Object { + "accessibility": "public", + "computed": false, + "declare": false, + "key": Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 19, + "line": 3, }, "start": Object { - "column": 13, - "line": 2, + "column": 16, + "line": 3, }, }, - "params": Array [], + "name": "baz", "range": Array [ - 23, - 32, + 52, + 55, ], - "type": "FunctionExpression", - "typeParameters": Object { + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 38, + 65, + ], + "static": true, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 3, + }, + }, + "range": Array [ + 56, + 64, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 28, + "line": 3, }, "start": Object { - "column": 13, - "line": 2, + "column": 22, + "line": 3, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "name": "T", - "range": Array [ - 24, - 25, - ], - "type": "Identifier", - }, - "range": Array [ - 24, - 25, - ], - "type": "TSTypeParameter", - }, - ], "range": Array [ - 23, - 26, + 58, + 64, ], - "type": "TSTypeParameterDeclaration", + "type": "TSNumberKeyword", }, }, + "value": null, }, Object { - "computed": true, + "accessibility": "public", + "computed": false, "key": Object { "loc": Object { "end": Object { - "column": 16, + "column": 15, "line": 4, }, "start": Object { - "column": 3, + "column": 9, "line": 4, }, }, + "name": "getBar", "range": Array [ - 37, - 50, + 75, + 81, ], - "raw": "'constructor'", - "type": "Literal", - "value": "constructor", + "type": "Identifier", }, "kind": "method", "loc": Object { "end": Object { - "column": 26, - "line": 4, + "column": 3, + "line": 6, }, "start": Object { "column": 2, @@ -11726,28 +11112,100 @@ Object { }, }, "range": Array [ - 36, - 60, + 68, + 111, ], "static": false, "type": "MethodDefinition", "value": Object { "async": false, "body": Object { - "body": Array [], + "body": Array [ + Object { + "argument": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 98, + 102, + ], + "type": "ThisExpression", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 5, + }, + }, + "name": "bar", + "range": Array [ + 103, + 106, + ], + "type": "Identifier", + }, + "range": Array [ + 98, + 106, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 91, + 107, + ], + "type": "ReturnStatement", + }, + ], "loc": Object { "end": Object { - "column": 26, - "line": 4, + "column": 3, + "line": 6, }, "start": Object { - "column": 23, + "column": 19, "line": 4, }, }, "range": Array [ - 57, - 60, + 85, + 111, ], "type": "BlockStatement", }, @@ -11756,97 +11214,283 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 26, - "line": 4, + "column": 3, + "line": 6, }, "start": Object { - "column": 17, + "column": 16, "line": 4, }, }, "params": Array [], "range": Array [ - 51, - 60, + 82, + 111, ], "type": "FunctionExpression", - "typeParameters": Object { + }, + }, + Object { + "accessibility": "protected", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "name": "setBar", + "range": Array [ + 124, + 130, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 3, + "line": 9, + }, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "range": Array [ + 114, + 171, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 12, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 152, + 156, + ], + "type": "ThisExpression", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 8, + }, + "start": Object { + "column": 9, + "line": 8, + }, + }, + "name": "bar", + "range": Array [ + 157, + 160, + ], + "type": "Identifier", + }, + "range": Array [ + 152, + 160, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "operator": "=", + "range": Array [ + 152, + 166, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 8, + }, + "start": Object { + "column": 15, + "line": 8, + }, + }, + "name": "bar", + "range": Array [ + 163, + 166, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 152, + 167, + ], + "type": "ExpressionStatement", + }, + ], "loc": Object { "end": Object { - "column": 20, - "line": 4, + "column": 3, + "line": 9, }, "start": Object { - "column": 17, - "line": 4, + "column": 34, + "line": 7, }, }, - "params": Array [ - Object { + "range": Array [ + 146, + 171, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 9, + }, + "start": Object { + "column": 19, + "line": 7, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 7, + }, + "start": Object { + "column": 20, + "line": 7, + }, + }, + "name": "bar", + "range": Array [ + 132, + 144, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 19, - "line": 4, + "column": 32, + "line": 7, }, "start": Object { - "column": 18, - "line": 4, + "column": 24, + "line": 7, }, }, - "name": Object { + "range": Array [ + 136, + 144, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 19, - "line": 4, + "column": 32, + "line": 7, }, "start": Object { - "column": 18, - "line": 4, + "column": 26, + "line": 7, }, }, - "name": "T", "range": Array [ - 52, - 53, + 138, + 144, ], - "type": "Identifier", + "type": "TSStringKeyword", }, - "range": Array [ - 52, - 53, - ], - "type": "TSTypeParameter", }, - ], - "range": Array [ - 51, - 54, - ], - "type": "TSTypeParameterDeclaration", - }, + }, + ], + "range": Array [ + 131, + 171, + ], + "type": "FunctionExpression", }, }, ], "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 10, }, "start": Object { - "column": 8, + "column": 10, "line": 1, }, }, "range": Array [ - 8, - 62, + 10, + 173, ], "type": "ClassBody", }, "id": Object { "loc": Object { "end": Object { - "column": 7, + "column": 9, "line": 1, }, "start": Object { @@ -11854,17 +11498,17 @@ Object { "line": 1, }, }, - "name": "C", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 10, }, "start": Object { "column": 0, @@ -11873,7 +11517,7 @@ Object { }, "range": Array [ 0, - 62, + 173, ], "superClass": null, "type": "ClassDeclaration", @@ -11882,7 +11526,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 6, + "line": 11, }, "start": Object { "column": 0, @@ -11891,7 +11535,7 @@ Object { }, "range": Array [ 0, - 63, + 174, ], "sourceType": "script", "tokens": Array [ @@ -11916,7 +11560,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 9, "line": 1, }, "start": Object { @@ -11926,25 +11570,25 @@ Object { }, "range": Array [ 6, - 7, + 9, ], "type": "Identifier", - "value": "C", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 11, "line": 1, }, "start": Object { - "column": 8, + "column": 10, "line": 1, }, }, "range": Array [ - 8, - 9, + 10, + 11, ], "type": "Punctuator", "value": "{", @@ -11952,7 +11596,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 9, "line": 2, }, "start": Object { @@ -11961,29 +11605,29 @@ Object { }, }, "range": Array [ - 12, - 23, + 14, + 21, ], - "type": "Identifier", - "value": "constructor", + "type": "Keyword", + "value": "private", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 13, "line": 2, }, "start": Object { - "column": 13, + "column": 10, "line": 2, }, }, "range": Array [ - 23, - 24, + 22, + 25, ], - "type": "Punctuator", - "value": "<", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { @@ -11997,106 +11641,160 @@ Object { }, }, "range": Array [ - 24, - 25, + 26, + 27, ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 22, "line": 2, }, "start": Object { - "column": 15, + "column": 16, "line": 2, }, }, "range": Array [ - 25, - 26, + 28, + 34, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 23, "line": 2, }, "start": Object { - "column": 16, + "column": 22, "line": 2, }, }, "range": Array [ - 26, - 27, + 34, + 35, ], "type": "Punctuator", - "value": "(", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 8, + "line": 3, }, "start": Object { - "column": 17, - "line": 2, + "column": 2, + "line": 3, }, }, "range": Array [ - 27, - 28, + 38, + 44, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "public", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 15, + "line": 3, }, "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 45, + 51, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { "column": 19, - "line": 2, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, }, }, "range": Array [ - 29, - 30, + 52, + 55, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 3, + }, + }, + "range": Array [ + 56, + 57, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { "column": 22, - "line": 2, + "line": 3, + }, + }, + "range": Array [ + 58, + 64, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 3, }, "start": Object { - "column": 21, - "line": 2, + "column": 28, + "line": 3, }, }, "range": Array [ - 31, - 32, + 64, + 65, ], "type": "Punctuator", - "value": "}", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 8, "line": 4, }, "start": Object { @@ -12105,29 +11803,29 @@ Object { }, }, "range": Array [ - 36, - 37, + 68, + 74, ], - "type": "Punctuator", - "value": "[", + "type": "Keyword", + "value": "public", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 15, "line": 4, }, "start": Object { - "column": 3, + "column": 9, "line": 4, }, }, "range": Array [ - 37, - 50, + 75, + 81, ], - "type": "String", - "value": "'constructor'", + "type": "Identifier", + "value": "getBar", }, Object { "loc": Object { @@ -12141,11 +11839,11 @@ Object { }, }, "range": Array [ - 50, - 51, + 82, + 83, ], "type": "Punctuator", - "value": "]", + "value": "(", }, Object { "loc": Object { @@ -12159,62 +11857,188 @@ Object { }, }, "range": Array [ - 51, - 52, + 83, + 84, ], "type": "Punctuator", - "value": "<", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 20, "line": 4, }, "start": Object { - "column": 18, + "column": 19, "line": 4, }, }, "range": Array [ - 52, - 53, + 85, + 86, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 91, + 97, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 98, + 102, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 15, + "line": 5, + }, + }, + "range": Array [ + 102, + 103, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 5, + }, + }, + "range": Array [ + 103, + 106, ], "type": "Identifier", - "value": "T", + "value": "bar", }, Object { "loc": Object { "end": Object { "column": 20, - "line": 4, + "line": 5, }, "start": Object { "column": 19, - "line": 4, + "line": 5, }, }, "range": Array [ - 53, - 54, + 106, + 107, ], "type": "Punctuator", - "value": ">", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 4, + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 110, + 111, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 7, + }, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "range": Array [ + 114, + 123, + ], + "type": "Keyword", + "value": "protected", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 7, }, "start": Object { + "column": 12, + "line": 7, + }, + }, + "range": Array [ + 124, + 130, + ], + "type": "Identifier", + "value": "setBar", + }, + Object { + "loc": Object { + "end": Object { "column": 20, - "line": 4, + "line": 7, + }, + "start": Object { + "column": 19, + "line": 7, }, }, "range": Array [ - 54, - 55, + 131, + 132, ], "type": "Punctuator", "value": "(", @@ -12222,17 +12046,71 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, - "line": 4, + "column": 23, + "line": 7, }, "start": Object { - "column": 21, - "line": 4, + "column": 20, + "line": 7, }, }, "range": Array [ - 55, - 56, + 132, + 135, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 7, + }, + "start": Object { + "column": 24, + "line": 7, + }, + }, + "range": Array [ + 136, + 137, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 7, + }, + "start": Object { + "column": 26, + "line": 7, + }, + }, + "range": Array [ + 138, + 144, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 7, + }, + "start": Object { + "column": 32, + "line": 7, + }, + }, + "range": Array [ + 144, + 145, ], "type": "Punctuator", "value": ")", @@ -12240,17 +12118,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 24, - "line": 4, + "column": 35, + "line": 7, }, "start": Object { - "column": 23, - "line": 4, + "column": 34, + "line": 7, }, }, "range": Array [ - 57, - 58, + 146, + 147, ], "type": "Punctuator", "value": "{", @@ -12258,17 +12136,125 @@ Object { Object { "loc": Object { "end": Object { - "column": 26, - "line": 4, + "column": 8, + "line": 8, }, "start": Object { - "column": 25, - "line": 4, + "column": 4, + "line": 8, }, }, "range": Array [ - 59, - 60, + 152, + 156, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 8, + }, + "start": Object { + "column": 8, + "line": 8, + }, + }, + "range": Array [ + 156, + 157, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 8, + }, + "start": Object { + "column": 9, + "line": 8, + }, + }, + "range": Array [ + 157, + 160, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 8, + }, + "start": Object { + "column": 13, + "line": 8, + }, + }, + "range": Array [ + 161, + 162, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 8, + }, + "start": Object { + "column": 15, + "line": 8, + }, + }, + "range": Array [ + 163, + 166, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 8, + }, + "start": Object { + "column": 18, + "line": 8, + }, + }, + "range": Array [ + 166, + 167, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 9, + }, + "start": Object { + "column": 2, + "line": 9, + }, + }, + "range": Array [ + 170, + 171, ], "type": "Punctuator", "value": "}", @@ -12277,16 +12263,16 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 10, }, "start": Object { "column": 0, - "line": 5, + "line": 10, }, }, "range": Array [ - 61, - 62, + 172, + 173, ], "type": "Punctuator", "value": "}", @@ -12296,36 +12282,37 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-definite-assignment.src 1`] = ` +exports[`typescript fixtures/basics/class-with-constructor-and-modifier.src 1`] = ` Object { "body": Array [ Object { "body": Object { "body": Array [ Object { + "accessibility": "protected", "computed": false, - "definite": true, "key": Object { "loc": Object { "end": Object { - "column": 3, + "column": 23, "line": 2, }, "start": Object { - "column": 2, + "column": 12, "line": 2, }, }, - "name": "a", + "name": "constructor", "range": Array [ - 12, - 13, + 22, + 33, ], "type": "Identifier", }, + "kind": "constructor", "loc": Object { "end": Object { - "column": 13, + "column": 29, "line": 2, }, "start": Object { @@ -12335,51 +12322,136 @@ Object { }, "range": Array [ 12, - 23, + 39, ], "static": false, - "type": "ClassProperty", - "typeAnnotation": Object { + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 36, + 39, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 12, + "column": 29, "line": 2, }, "start": Object { - "column": 4, + "column": 23, "line": 2, }, }, + "params": Array [], "range": Array [ - 14, - 22, + 33, + 39, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "type": "FunctionExpression", + }, + }, + Object { + "accessibility": "public", + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 4, + }, + }, + "range": Array [ + 51, + 64, + ], + "raw": "'constructor'", + "type": "Literal", + "value": "constructor", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 30, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 43, + 71, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 12, - "line": 2, + "column": 30, + "line": 4, }, "start": Object { - "column": 6, - "line": 2, + "column": 27, + "line": 4, }, }, "range": Array [ - 16, - 22, + 68, + 71, ], - "type": "TSStringKeyword", + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 30, + "line": 4, + }, + "start": Object { + "column": 24, + "line": 4, + }, }, + "params": Array [], + "range": Array [ + 65, + 71, + ], + "type": "FunctionExpression", }, - "value": null, }, ], "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { "column": 8, @@ -12388,7 +12460,7 @@ Object { }, "range": Array [ 8, - 25, + 73, ], "type": "ClassBody", }, @@ -12403,7 +12475,7 @@ Object { "line": 1, }, }, - "name": "X", + "name": "C", "range": Array [ 6, 7, @@ -12413,7 +12485,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { "column": 0, @@ -12422,7 +12494,7 @@ Object { }, "range": Array [ 0, - 25, + 73, ], "superClass": null, "type": "ClassDeclaration", @@ -12431,7 +12503,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 6, }, "start": Object { "column": 0, @@ -12440,7 +12512,7 @@ Object { }, "range": Array [ 0, - 26, + 74, ], "sourceType": "script", "tokens": Array [ @@ -12478,7 +12550,7 @@ Object { 7, ], "type": "Identifier", - "value": "X", + "value": "C", }, Object { "loc": Object { @@ -12501,7 +12573,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 3, + "column": 11, "line": 2, }, "start": Object { @@ -12511,97 +12583,259 @@ Object { }, "range": Array [ 12, - 13, + 21, ], - "type": "Identifier", - "value": "a", + "type": "Keyword", + "value": "protected", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 23, "line": 2, }, "start": Object { - "column": 3, + "column": 12, "line": 2, }, }, "range": Array [ - 13, - 14, + 22, + 33, ], - "type": "Punctuator", - "value": "!", + "type": "Identifier", + "value": "constructor", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 24, "line": 2, }, "start": Object { - "column": 4, + "column": 23, "line": 2, }, }, "range": Array [ - 14, - 15, + 33, + 34, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 25, "line": 2, }, "start": Object { - "column": 6, + "column": 24, "line": 2, }, }, "range": Array [ - 16, - 22, + 34, + 35, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 27, "line": 2, }, "start": Object { - "column": 12, + "column": 26, "line": 2, }, }, "range": Array [ - 22, - 23, + 36, + 37, ], "type": "Punctuator", - "value": ";", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 43, + 49, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 4, + }, + }, + "range": Array [ + 51, + 64, + ], + "type": "String", + "value": "'constructor'", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 23, + "line": 4, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 4, + }, + "start": Object { + "column": 24, + "line": 4, + }, + }, + "range": Array [ + 65, + 66, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 25, + "line": 4, + }, + }, + "range": Array [ + 66, + 67, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 4, + }, + "start": Object { + "column": 27, + "line": 4, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 4, + }, + "start": Object { + "column": 29, + "line": 4, + }, + }, + "range": Array [ + 70, + 71, + ], + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { "column": 0, - "line": 3, + "line": 5, }, }, "range": Array [ - 24, - 25, + 72, + 73, ], "type": "Punctuator", "value": "}", @@ -12611,7 +12845,7 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-export-parameter-properties.src 1`] = ` +exports[`typescript fixtures/basics/class-with-constructor-and-return-type.src 1`] = ` Object { "body": Array [ Object { @@ -12622,35 +12856,35 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 15, + "column": 13, "line": 2, }, "start": Object { - "column": 4, + "column": 2, "line": 2, }, }, "name": "constructor", "range": Array [ - 16, - 27, + 12, + 23, ], "type": "Identifier", }, "kind": "constructor", "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 27, + "line": 2, }, "start": Object { - "column": 4, + "column": 2, "line": 2, }, }, "range": Array [ - 16, - 54, + 12, + 37, ], "static": false, "type": "MethodDefinition", @@ -12660,17 +12894,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 27, + "line": 2, }, "start": Object { - "column": 34, + "column": 24, "line": 2, }, }, "range": Array [ - 46, - 54, + 34, + 37, ], "type": "BlockStatement", }, @@ -12679,90 +12913,166 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 27, + "line": 2, }, "start": Object { - "column": 15, + "column": 13, "line": 2, }, }, - "params": Array [ - Object { - "export": true, + "params": Array [], + "range": Array [ + 23, + 37, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 25, + 33, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 32, + "column": 23, "line": 2, }, "start": Object { - "column": 16, + "column": 17, "line": 2, }, }, - "parameter": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 2, - }, - "start": Object { - "column": 23, - "line": 2, - }, - }, - "name": "a", - "range": Array [ - 35, - 44, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 2, - }, - "start": Object { - "column": 24, - "line": 2, - }, - }, - "range": Array [ - 36, - 44, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 2, - }, - "start": Object { - "column": 26, - "line": 2, - }, - }, - "range": Array [ - 38, - 44, - ], - "type": "TSStringKeyword", - }, - }, - }, "range": Array [ - 28, - 44, + 27, + 33, ], - "type": "TSParameterProperty", + "type": "TSNumberKeyword", + }, + }, + "type": "FunctionExpression", + }, + }, + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 3, + "line": 4, }, + }, + "range": Array [ + 42, + 55, ], + "raw": "'constructor'", + "type": "Literal", + "value": "constructor", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 41, + 70, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 28, + "line": 4, + }, + }, + "range": Array [ + 67, + 70, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "params": Array [], "range": Array [ - 27, - 54, + 56, + 70, ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 19, + "line": 4, + }, + }, + "range": Array [ + 58, + 66, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 21, + "line": 4, + }, + }, + "range": Array [ + 60, + 66, + ], + "type": "TSNumberKeyword", + }, + }, "type": "FunctionExpression", }, }, @@ -12773,20 +13083,20 @@ Object { "line": 5, }, "start": Object { - "column": 10, + "column": 8, "line": 1, }, }, "range": Array [ - 10, - 56, + 8, + 72, ], "type": "ClassBody", }, "id": Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { @@ -12794,10 +13104,10 @@ Object { "line": 1, }, }, - "name": "Foo", + "name": "C", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, @@ -12813,7 +13123,7 @@ Object { }, "range": Array [ 0, - 56, + 72, ], "superClass": null, "type": "ClassDeclaration", @@ -12822,7 +13132,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 7, + "line": 6, }, "start": Object { "column": 0, @@ -12831,7 +13141,7 @@ Object { }, "range": Array [ 0, - 58, + 73, ], "sourceType": "script", "tokens": Array [ @@ -12856,7 +13166,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { @@ -12866,25 +13176,25 @@ Object { }, "range": Array [ 6, - 9, + 7, ], "type": "Identifier", - "value": "Foo", + "value": "C", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 9, "line": 1, }, "start": Object { - "column": 10, + "column": 8, "line": 1, }, }, "range": Array [ - 10, - 11, + 8, + 9, ], "type": "Punctuator", "value": "{", @@ -12892,17 +13202,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 13, "line": 2, }, "start": Object { - "column": 4, + "column": 2, "line": 2, }, }, "range": Array [ - 16, - 27, + 12, + 23, ], "type": "Identifier", "value": "constructor", @@ -12910,17 +13220,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 14, "line": 2, }, "start": Object { - "column": 15, + "column": 13, "line": 2, }, }, "range": Array [ - 27, - 28, + 23, + 24, ], "type": "Punctuator", "value": "(", @@ -12928,53 +13238,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 28, - 34, - ], - "type": "Keyword", - "value": "export", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, + "column": 15, "line": 2, }, "start": Object { - "column": 23, + "column": 14, "line": 2, }, }, "range": Array [ - 35, - 36, + 24, + 25, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 16, "line": 2, }, "start": Object { - "column": 24, + "column": 15, "line": 2, }, }, "range": Array [ - 36, - 37, + 25, + 26, ], "type": "Punctuator", "value": ":", @@ -12982,366 +13274,233 @@ Object { Object { "loc": Object { "end": Object { - "column": 32, + "column": 23, "line": 2, }, "start": Object { - "column": 26, + "column": 17, "line": 2, }, }, "range": Array [ - 38, - 44, + 27, + 33, ], "type": "Identifier", - "value": "string", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 33, + "column": 25, "line": 2, }, "start": Object { - "column": 32, + "column": 24, "line": 2, }, }, "range": Array [ - 44, - 45, + 34, + 35, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 35, + "column": 27, "line": 2, }, "start": Object { - "column": 34, + "column": 26, "line": 2, }, }, "range": Array [ - 46, - 47, + 36, + 37, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 3, "line": 4, }, "start": Object { - "column": 4, + "column": 2, "line": 4, }, }, "range": Array [ - 53, - 54, + 41, + 42, ], "type": "Punctuator", - "value": "}", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 16, + "line": 4, }, "start": Object { - "column": 0, - "line": 5, + "column": 3, + "line": 4, }, }, "range": Array [ + 42, 55, - 56, ], - "type": "Punctuator", - "value": "}", + "type": "String", + "value": "'constructor'", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-with-extends-and-implements.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 80, - "line": 1, - }, - "start": Object { - "column": 78, - "line": 1, - }, - }, - "range": Array [ - 78, - 80, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "ClassWithParentAndInterface", - "range": Array [ - 6, - 33, - ], - "type": "Identifier", - }, - "implements": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 77, - "line": 1, - }, - "start": Object { - "column": 66, - "line": 1, - }, - }, - "name": "MyInterface", - "range": Array [ - 66, - 77, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 77, - "line": 1, - }, - "start": Object { - "column": 66, - "line": 1, - }, - }, - "range": Array [ - 66, - 77, - ], - "type": "TSClassImplements", - }, - ], "loc": Object { "end": Object { - "column": 80, - "line": 1, + "column": 17, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 16, + "line": 4, }, }, "range": Array [ - 0, - 80, + 55, + 56, ], - "superClass": Object { - "loc": Object { - "end": Object { - "column": 54, - "line": 1, - }, - "start": Object { - "column": 42, - "line": 1, - }, - }, - "name": "MyOtherClass", - "range": Array [ - 42, - 54, - ], - "type": "Identifier", - }, - "type": "ClassDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "]", }, - }, - "range": Array [ - 0, - 81, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 18, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 17, + "line": 4, }, }, "range": Array [ - 0, - 5, + 56, + 57, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 1, + "column": 19, + "line": 4, }, "start": Object { - "column": 6, - "line": 1, + "column": 18, + "line": 4, }, }, "range": Array [ - 6, - 33, + 57, + 58, ], - "type": "Identifier", - "value": "ClassWithParentAndInterface", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 1, + "column": 20, + "line": 4, }, "start": Object { - "column": 34, - "line": 1, + "column": 19, + "line": 4, }, }, "range": Array [ - 34, - 41, + 58, + 59, ], - "type": "Keyword", - "value": "extends", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 54, - "line": 1, + "column": 27, + "line": 4, }, "start": Object { - "column": 42, - "line": 1, + "column": 21, + "line": 4, }, }, "range": Array [ - 42, - 54, + 60, + 66, ], "type": "Identifier", - "value": "MyOtherClass", - }, - Object { - "loc": Object { - "end": Object { - "column": 65, - "line": 1, - }, - "start": Object { - "column": 55, - "line": 1, - }, - }, - "range": Array [ - 55, - 65, - ], - "type": "Keyword", - "value": "implements", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 77, - "line": 1, + "column": 29, + "line": 4, }, "start": Object { - "column": 66, - "line": 1, + "column": 28, + "line": 4, }, }, "range": Array [ - 66, - 77, + 67, + 68, ], - "type": "Identifier", - "value": "MyInterface", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 79, - "line": 1, + "column": 31, + "line": 4, }, "start": Object { - "column": 78, - "line": 1, + "column": 30, + "line": 4, }, }, "range": Array [ - 78, - 79, + 69, + 70, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 80, - "line": 1, + "column": 1, + "line": 5, }, "start": Object { - "column": 79, - "line": 1, + "column": 0, + "line": 5, }, }, "range": Array [ - 79, - 80, + 71, + 72, ], "type": "Punctuator", "value": "}", @@ -13351,193 +13510,334 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-extends-generic.src 1`] = ` +exports[`typescript fixtures/basics/class-with-constructor-and-type-parameters.src 1`] = ` Object { "body": Array [ Object { "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 32, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 32, - ], - "superClass": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "Bar", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "superTypeParameters": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "params": Array [ + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 26, - ], - "type": "TSTypeReference", - "typeName": Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 25, - "line": 1, + "column": 2, + "line": 2, }, }, - "name": "B", + "name": "constructor", "range": Array [ - 25, - 26, + 12, + 23, ], "type": "Identifier", }, - }, - ], - "range": Array [ - 24, - 27, - ], - "type": "TSTypeParameterInstantiation", - }, - "type": "ClassDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "params": Array [ - Object { + "kind": "constructor", "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 22, + "line": 2, }, "start": Object { - "column": 10, - "line": 1, + "column": 2, + "line": 2, }, }, - "name": Object { + "range": Array [ + 12, + 32, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 29, + 32, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 22, + "line": 2, }, "start": Object { - "column": 10, - "line": 1, + "column": 13, + "line": 2, }, }, - "name": "A", + "params": Array [], "range": Array [ - 10, - 11, + 23, + 32, ], - "type": "Identifier", - }, - "range": Array [ - 10, - 11, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 9, - 12, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - ], - "loc": Object { - "end": Object { + "type": "FunctionExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "name": "T", + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + }, + "range": Array [ + 24, + 25, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 23, + 26, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + }, + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 3, + "line": 4, + }, + }, + "range": Array [ + 37, + 50, + ], + "raw": "'constructor'", + "type": "Literal", + "value": "constructor", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 36, + 60, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 23, + "line": 4, + }, + }, + "range": Array [ + 57, + 60, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "params": Array [], + "range": Array [ + 51, + 60, + ], + "type": "FunctionExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "name": "T", + "range": Array [ + 52, + 53, + ], + "type": "Identifier", + }, + "range": Array [ + 52, + 53, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 51, + 54, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 62, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "C", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 62, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { "column": 0, - "line": 4, + "line": 6, }, "start": Object { "column": 0, @@ -13546,7 +13846,7 @@ Object { }, "range": Array [ 0, - 33, + 63, ], "sourceType": "script", "tokens": Array [ @@ -13571,7 +13871,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { @@ -13581,169 +13881,151 @@ Object { }, "range": Array [ 6, - 9, + 7, ], "type": "Identifier", - "value": "Foo", + "value": "C", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 9, "line": 1, }, "start": Object { - "column": 9, + "column": 8, "line": 1, }, }, "range": Array [ + 8, 9, - 10, ], "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - "value": "A", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 11, 12, + 23, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "constructor", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { "column": 13, - "line": 1, + "line": 2, }, }, "range": Array [ - 13, - 20, + 23, + 24, ], - "type": "Keyword", - "value": "extends", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, + "column": 14, + "line": 2, }, }, "range": Array [ - 21, 24, + 25, ], "type": "Identifier", - "value": "Bar", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 24, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ - 24, 25, + 26, ], "type": "Punctuator", - "value": "<", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 25, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 25, 26, + 27, ], - "type": "Identifier", - "value": "B", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 26, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 26, 27, + 28, ], "type": "Punctuator", - "value": ">", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 20, + "line": 2, }, "start": Object { - "column": 28, - "line": 1, + "column": 19, + "line": 2, }, }, "range": Array [ - 28, 29, + 30, ], "type": "Punctuator", "value": "{", @@ -13751,12 +14033,12 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 22, + "line": 2, }, "start": Object { - "column": 0, - "line": 3, + "column": 21, + "line": 2, }, }, "range": Array [ @@ -13766,330 +14048,74 @@ Object { "type": "Punctuator", "value": "}", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-with-extends-generic-multiple.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 41, - "line": 1, - }, - }, - "range": Array [ - 41, - 45, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 3, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 2, + "line": 4, }, }, "range": Array [ - 0, - 45, + 36, + 37, ], - "superClass": Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, - "name": "Bar", - "range": Array [ - 31, - 34, - ], - "type": "Identifier", - }, - "superTypeParameters": Object { - "loc": Object { - "end": Object { - "column": 40, - "line": 1, - }, - "start": Object { - "column": 34, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "range": Array [ - 35, - 36, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "name": "C", - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - }, - }, - Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 1, - }, - "start": Object { - "column": 38, - "line": 1, - }, - }, - "range": Array [ - 38, - 39, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 1, - }, - "start": Object { - "column": 38, - "line": 1, - }, - }, - "name": "D", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - }, - ], - "range": Array [ - 34, - 40, - ], - "type": "TSTypeParameterInstantiation", - }, - "type": "ClassDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "params": Array [ - Object { - "constraint": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "name": "B", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "A", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - "range": Array [ - 10, - 21, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 9, - 22, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "[", }, - }, - "range": Array [ - 0, - 46, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 16, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 3, + "line": 4, }, }, "range": Array [ - 0, - 5, + 37, + 50, ], - "type": "Keyword", - "value": "class", + "type": "String", + "value": "'constructor'", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 17, + "line": 4, }, "start": Object { - "column": 6, - "line": 1, + "column": 16, + "line": 4, }, }, "range": Array [ - 6, - 9, + 50, + 51, ], - "type": "Identifier", - "value": "Foo", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 18, + "line": 4, }, "start": Object { - "column": 9, - "line": 1, + "column": 17, + "line": 4, }, }, "range": Array [ - 9, - 10, + 51, + 52, ], "type": "Punctuator", "value": "<", @@ -14097,233 +14123,125 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 19, + "line": 4, }, "start": Object { - "column": 10, - "line": 1, + "column": 18, + "line": 4, }, }, "range": Array [ - 10, - 11, + 52, + 53, ], "type": "Identifier", - "value": "A", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 20, + "line": 4, }, "start": Object { - "column": 12, - "line": 1, + "column": 19, + "line": 4, }, }, "range": Array [ - 12, - 19, + 53, + 54, ], - "type": "Keyword", - "value": "extends", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { "column": 21, - "line": 1, + "line": 4, }, "start": Object { "column": 20, - "line": 1, + "line": 4, }, }, "range": Array [ - 20, - 21, + 54, + 55, ], - "type": "Identifier", - "value": "B", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { "column": 22, - "line": 1, + "line": 4, }, "start": Object { "column": 21, - "line": 1, + "line": 4, }, }, "range": Array [ - 21, - 22, + 55, + 56, ], "type": "Punctuator", - "value": ">", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 24, + "line": 4, }, "start": Object { "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 30, - ], - "type": "Keyword", - "value": "extends", - }, - Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, - "range": Array [ - 31, - 34, - ], - "type": "Identifier", - "value": "Bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 34, - "line": 1, - }, - }, - "range": Array [ - 34, - 35, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - "value": "C", - }, - Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 36, - "line": 1, - }, - }, - "range": Array [ - 36, - 37, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 1, - }, - "start": Object { - "column": 38, - "line": 1, - }, - }, - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - "value": "D", - }, - Object { - "loc": Object { - "end": Object { - "column": 40, - "line": 1, - }, - "start": Object { - "column": 39, - "line": 1, + "line": 4, }, }, "range": Array [ - 39, - 40, + 57, + 58, ], "type": "Punctuator", - "value": ">", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 26, + "line": 4, }, "start": Object { - "column": 41, - "line": 1, + "column": 25, + "line": 4, }, }, "range": Array [ - 41, - 42, + 59, + 60, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { "column": 0, - "line": 3, + "line": 5, }, }, "range": Array [ - 44, - 45, + 61, + 62, ], "type": "Punctuator", "value": "}", @@ -14333,7 +14251,7 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-generic-method.src 1`] = ` +exports[`typescript fixtures/basics/class-with-declare-properties.src 1`] = ` Object { "body": Array [ Object { @@ -14341,28 +14259,28 @@ Object { "body": Array [ Object { "computed": false, + "declare": true, "key": Object { "loc": Object { "end": Object { - "column": 8, + "column": 15, "line": 2, }, "start": Object { - "column": 2, + "column": 10, "line": 2, }, }, - "name": "getBar", + "name": "prop1", "range": Array [ - 14, - 20, + 28, + 33, ], "type": "Identifier", }, - "kind": "method", "loc": Object { "end": Object { - "column": 16, + "column": 24, "line": 2, }, "start": Object { @@ -14371,127 +14289,513 @@ Object { }, }, "range": Array [ - 14, - 28, + 20, + 42, ], "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 33, + 41, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 16, + "column": 23, "line": 2, }, "start": Object { - "column": 14, + "column": 17, "line": 2, }, }, "range": Array [ - 26, - 28, + 35, + 41, ], - "type": "BlockStatement", + "type": "TSStringKeyword", }, - "expression": false, - "generator": false, - "id": null, + }, + "value": null, + }, + Object { + "accessibility": "public", + "computed": false, + "declare": true, + "key": Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 22, + "line": 3, }, "start": Object { - "column": 8, - "line": 2, + "column": 17, + "line": 3, }, }, - "params": Array [], + "name": "prop2", "range": Array [ - 20, - 28, + 60, + 65, ], - "type": "FunctionExpression", - "typeParameters": Object { + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 45, + 74, + ], + "static": false, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 3, + }, + }, + "range": Array [ + 65, + 73, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 30, + "line": 3, }, "start": Object { - "column": 8, - "line": 2, + "column": 24, + "line": 3, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "name": "T", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - "range": Array [ - 21, - 22, - ], - "type": "TSTypeParameter", + "range": Array [ + 67, + 73, + ], + "type": "TSStringKeyword", + }, + }, + "value": null, + }, + Object { + "computed": false, + "declare": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "name": "prop3", + "range": Array [ + 92, + 97, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 77, + 106, + ], + "static": true, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 4, + }, + "start": Object { + "column": 22, + "line": 4, + }, + }, + "range": Array [ + 97, + 105, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 4, + }, + "start": Object { + "column": 24, + "line": 4, + }, + }, + "range": Array [ + 99, + 105, + ], + "type": "TSStringKeyword", + }, + }, + "value": null, + }, + Object { + "computed": false, + "declare": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 5, + }, + "start": Object { + "column": 19, + "line": 5, + }, + }, + "name": "prop3", + "range": Array [ + 126, + 131, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 109, + 140, + ], + "readonly": true, + "static": false, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 5, + }, + "start": Object { + "column": 24, + "line": 5, + }, + }, + "range": Array [ + 131, + 139, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 5, + }, + "start": Object { + "column": 26, + "line": 5, }, + }, + "range": Array [ + 133, + 139, ], + "type": "TSStringKeyword", + }, + }, + "value": null, + }, + Object { + "accessibility": "public", + "computed": false, + "declare": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 6, + }, + "start": Object { + "column": 26, + "line": 6, + }, + }, + "name": "prop4", + "range": Array [ + 167, + 172, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 40, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 143, + 181, + ], + "readonly": true, + "static": false, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 6, + }, + "start": Object { + "column": 31, + "line": 6, + }, + }, + "range": Array [ + 172, + 180, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 6, + }, + "start": Object { + "column": 33, + "line": 6, + }, + }, "range": Array [ - 20, - 23, + 174, + 180, ], - "type": "TSTypeParameterDeclaration", + "type": "TSStringKeyword", + }, + }, + "value": null, + }, + Object { + "accessibility": "public", + "computed": false, + "declare": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 7, + }, + "start": Object { + "column": 24, + "line": 7, + }, + }, + "name": "prop5", + "range": Array [ + 206, + 211, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 38, + "line": 7, + }, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "range": Array [ + 184, + 220, + ], + "static": true, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 7, + }, + "start": Object { + "column": 29, + "line": 7, + }, + }, + "range": Array [ + 211, + 219, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 7, + }, + "start": Object { + "column": 31, + "line": 7, + }, + }, + "range": Array [ + 213, + 219, + ], + "type": "TSStringKeyword", + }, + }, + "value": null, + }, + Object { + "accessibility": "public", + "computed": false, + "declare": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 8, + }, + "start": Object { + "column": 33, + "line": 8, + }, + }, + "name": "prop6", + "range": Array [ + 254, + 259, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 47, + "line": 8, + }, + "start": Object { + "column": 2, + "line": 8, + }, + }, + "range": Array [ + 223, + 268, + ], + "readonly": true, + "static": true, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 8, + }, + "start": Object { + "column": 38, + "line": 8, + }, + }, + "range": Array [ + 259, + 267, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 8, + }, + "start": Object { + "column": 40, + "line": 8, + }, + }, + "range": Array [ + 261, + 267, + ], + "type": "TSStringKeyword", }, }, + "value": null, }, ], "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 9, }, "start": Object { - "column": 10, + "column": 16, "line": 1, }, }, "range": Array [ - 10, - 30, + 16, + 270, ], "type": "ClassBody", }, "id": Object { "loc": Object { "end": Object { - "column": 9, + "column": 15, "line": 1, }, "start": Object { @@ -14499,17 +14803,17 @@ Object { "line": 1, }, }, - "name": "Foo", + "name": "DeclProps", "range": Array [ 6, - 9, + 15, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 9, }, "start": Object { "column": 0, @@ -14518,7 +14822,7 @@ Object { }, "range": Array [ 0, - 30, + 270, ], "superClass": null, "type": "ClassDeclaration", @@ -14527,7 +14831,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 10, }, "start": Object { "column": 0, @@ -14536,7 +14840,7 @@ Object { }, "range": Array [ 0, - 31, + 271, ], "sourceType": "script", "tokens": Array [ @@ -14561,7 +14865,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 15, "line": 1, }, "start": Object { @@ -14571,25 +14875,25 @@ Object { }, "range": Array [ 6, - 9, + 15, ], "type": "Identifier", - "value": "Foo", + "value": "DeclProps", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 17, "line": 1, }, "start": Object { - "column": 10, + "column": 16, "line": 1, }, }, "range": Array [ - 10, - 11, + 16, + 17, ], "type": "Punctuator", "value": "{", @@ -14597,7 +14901,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 9, "line": 2, }, "start": Object { @@ -14606,1152 +14910,818 @@ Object { }, }, "range": Array [ - 14, 20, + 27, ], "type": "Identifier", - "value": "getBar", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 15, "line": 2, }, "start": Object { - "column": 8, + "column": 10, "line": 2, }, }, "range": Array [ - 20, - 21, + 28, + 33, ], - "type": "Punctuator", - "value": "<", + "type": "Identifier", + "value": "prop1", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 16, "line": 2, }, "start": Object { - "column": 9, + "column": 15, "line": 2, }, }, "range": Array [ - 21, - 22, + 33, + 34, ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 23, "line": 2, }, "start": Object { - "column": 10, + "column": 17, "line": 2, }, }, "range": Array [ - 22, - 23, + 35, + 41, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 24, "line": 2, }, "start": Object { - "column": 11, + "column": 23, "line": 2, }, }, "range": Array [ - 23, - 24, + 41, + 42, ], "type": "Punctuator", - "value": "(", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 2, + "column": 9, + "line": 3, }, "start": Object { - "column": 12, - "line": 2, + "column": 2, + "line": 3, }, }, "range": Array [ - 24, - 25, + 45, + 52, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 16, + "line": 3, }, "start": Object { - "column": 14, - "line": 2, + "column": 10, + "line": 3, }, }, "range": Array [ - 26, - 27, + 53, + 59, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "public", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 22, + "line": 3, }, "start": Object { - "column": 15, - "line": 2, + "column": 17, + "line": 3, }, }, "range": Array [ - 27, - 28, + 60, + 65, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "prop2", }, Object { "loc": Object { "end": Object { - "column": 1, + "column": 23, "line": 3, }, "start": Object { - "column": 0, + "column": 22, "line": 3, }, }, "range": Array [ - 29, - 30, + 65, + 66, ], "type": "Punctuator", - "value": "}", + "value": ":", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-with-generic-method-default.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "name": "getBar", - "range": Array [ - 14, - 20, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 14, - 34, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 20, - "line": 2, - }, - }, - "range": Array [ - 32, - 34, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "params": Array [], - "range": Array [ - 20, - 34, - ], - "type": "FunctionExpression", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "params": Array [ - Object { - "default": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "range": Array [ - 25, - 28, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "name": "Bar", - "range": Array [ - 25, - 28, - ], - "type": "Identifier", - }, - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "name": "T", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - "range": Array [ - 21, - 28, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 20, - 29, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 30, + "line": 3, }, - "range": Array [ - 10, - 36, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, + "start": Object { + "column": 24, + "line": 3, }, - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", }, + "range": Array [ + 67, + 73, + ], + "type": "Identifier", + "value": "string", + }, + Object { "loc": Object { "end": Object { - "column": 1, + "column": 31, "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 30, + "line": 3, }, }, "range": Array [ - 0, - 36, + 73, + 74, ], - "superClass": null, - "type": "ClassDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, + "type": "Punctuator", + "value": ";", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 77, + 84, + ], + "type": "Identifier", + "value": "declare", }, - }, - "range": Array [ - 0, - 37, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 16, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 10, + "line": 4, }, }, "range": Array [ - 0, - 5, + 85, + 91, ], "type": "Keyword", - "value": "class", + "value": "static", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 22, + "line": 4, }, "start": Object { - "column": 6, - "line": 1, + "column": 17, + "line": 4, }, }, "range": Array [ - 6, - 9, + 92, + 97, ], "type": "Identifier", - "value": "Foo", + "value": "prop3", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 23, + "line": 4, }, "start": Object { - "column": 10, - "line": 1, + "column": 22, + "line": 4, }, }, "range": Array [ - 10, - 11, + 97, + 98, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 30, + "line": 4, }, "start": Object { - "column": 2, - "line": 2, + "column": 24, + "line": 4, }, }, "range": Array [ - 14, - 20, + 99, + 105, ], "type": "Identifier", - "value": "getBar", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 31, + "line": 4, }, "start": Object { - "column": 8, - "line": 2, + "column": 30, + "line": 4, }, }, "range": Array [ - 20, - 21, + 105, + 106, ], "type": "Punctuator", - "value": "<", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 9, + "line": 5, }, "start": Object { - "column": 9, - "line": 2, + "column": 2, + "line": 5, }, }, "range": Array [ - 21, - 22, + 109, + 116, ], "type": "Identifier", - "value": "T", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 2, + "column": 18, + "line": 5, }, "start": Object { - "column": 11, - "line": 2, + "column": 10, + "line": 5, }, }, "range": Array [ - 23, - 24, + 117, + 125, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "readonly", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 24, + "line": 5, }, "start": Object { - "column": 13, - "line": 2, + "column": 19, + "line": 5, }, }, "range": Array [ - 25, - 28, + 126, + 131, ], "type": "Identifier", - "value": "Bar", + "value": "prop3", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 25, + "line": 5, }, "start": Object { - "column": 16, - "line": 2, + "column": 24, + "line": 5, }, }, "range": Array [ - 28, - 29, + 131, + 132, ], "type": "Punctuator", - "value": ">", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 32, + "line": 5, }, "start": Object { - "column": 17, - "line": 2, + "column": 26, + "line": 5, }, }, "range": Array [ - 29, - 30, + 133, + 139, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 33, + "line": 5, }, "start": Object { - "column": 18, - "line": 2, + "column": 32, + "line": 5, }, }, "range": Array [ - 30, - 31, + 139, + 140, ], "type": "Punctuator", - "value": ")", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 2, + "column": 9, + "line": 6, }, "start": Object { - "column": 20, - "line": 2, + "column": 2, + "line": 6, }, }, "range": Array [ - 32, - 33, + 143, + 150, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 16, + "line": 6, }, "start": Object { - "column": 21, - "line": 2, + "column": 10, + "line": 6, }, }, "range": Array [ - 33, - 34, + 151, + 157, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "public", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 25, + "line": 6, }, "start": Object { - "column": 0, - "line": 3, + "column": 17, + "line": 6, }, }, "range": Array [ - 35, - 36, + 158, + 166, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "readonly", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-with-implements.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 25, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 31, + "line": 6, }, - "range": Array [ - 25, - 29, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, + "start": Object { + "column": 26, + "line": 6, }, - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", }, - "implements": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "Bar", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 24, - ], - "type": "TSClassImplements", - }, + "range": Array [ + 167, + 172, ], + "type": "Identifier", + "value": "prop4", + }, + Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 32, + "line": 6, }, "start": Object { - "column": 0, - "line": 1, + "column": 31, + "line": 6, }, }, "range": Array [ - 0, - 29, + 172, + 173, ], - "superClass": null, - "type": "ClassDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, + "type": "Punctuator", + "value": ":", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 6, + }, + "start": Object { + "column": 33, + "line": 6, + }, + }, + "range": Array [ + 174, + 180, + ], + "type": "Identifier", + "value": "string", }, - }, - "range": Array [ - 0, - 30, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 40, + "line": 6, }, "start": Object { - "column": 0, - "line": 1, + "column": 39, + "line": 6, }, }, "range": Array [ - 0, - 5, + 180, + 181, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { "column": 9, - "line": 1, + "line": 7, }, "start": Object { - "column": 6, - "line": 1, + "column": 2, + "line": 7, }, }, "range": Array [ - 6, - 9, + 184, + 191, ], "type": "Identifier", - "value": "Foo", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 16, + "line": 7, }, "start": Object { "column": 10, - "line": 1, + "line": 7, }, }, "range": Array [ - 10, - 20, + 192, + 198, ], "type": "Keyword", - "value": "implements", + "value": "public", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 23, + "line": 7, }, "start": Object { - "column": 21, - "line": 1, + "column": 17, + "line": 7, }, }, "range": Array [ - 21, - 24, + 199, + 205, ], - "type": "Identifier", - "value": "Bar", + "type": "Keyword", + "value": "static", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 29, + "line": 7, }, "start": Object { - "column": 25, - "line": 1, + "column": 24, + "line": 7, }, }, "range": Array [ - 25, - 26, + 206, + 211, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "prop5", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 30, + "line": 7, }, "start": Object { - "column": 0, - "line": 3, + "column": 29, + "line": 7, }, }, "range": Array [ - 28, - 29, + 211, + 212, ], "type": "Punctuator", - "value": "}", + "value": ":", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-with-implements-and-extends.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 80, - "line": 1, - }, - "start": Object { - "column": 78, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 37, + "line": 7, }, - "range": Array [ - 78, - 80, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, + "start": Object { + "column": 31, + "line": 7, }, - "name": "ClassWithParentAndInterface", - "range": Array [ - 6, - 33, - ], - "type": "Identifier", }, - "implements": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 56, - "line": 1, - }, - "start": Object { - "column": 45, - "line": 1, - }, - }, - "name": "MyInterface", - "range": Array [ - 45, - 56, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 56, - "line": 1, - }, - "start": Object { - "column": 45, - "line": 1, - }, - }, - "range": Array [ - 45, - 56, - ], - "type": "TSClassImplements", - }, + "range": Array [ + 213, + 219, ], + "type": "Identifier", + "value": "string", + }, + Object { "loc": Object { "end": Object { - "column": 80, - "line": 1, + "column": 38, + "line": 7, }, "start": Object { - "column": 0, - "line": 1, + "column": 37, + "line": 7, }, }, "range": Array [ - 0, - 80, + 219, + 220, ], - "superClass": Object { - "loc": Object { - "end": Object { - "column": 77, - "line": 1, - }, - "start": Object { - "column": 65, - "line": 1, - }, + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 8, + }, + "start": Object { + "column": 2, + "line": 8, }, - "name": "MyOtherClass", - "range": Array [ - 65, - 77, - ], - "type": "Identifier", }, - "type": "ClassDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "range": Array [ + 223, + 230, + ], + "type": "Identifier", + "value": "declare", }, - }, - "range": Array [ - 0, - 81, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 16, + "line": 8, }, "start": Object { - "column": 0, - "line": 1, + "column": 10, + "line": 8, }, }, "range": Array [ - 0, - 5, + 231, + 237, ], "type": "Keyword", - "value": "class", + "value": "public", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 1, + "column": 23, + "line": 8, }, "start": Object { - "column": 6, - "line": 1, + "column": 17, + "line": 8, }, }, "range": Array [ - 6, - 33, + 238, + 244, ], - "type": "Identifier", - "value": "ClassWithParentAndInterface", + "type": "Keyword", + "value": "static", }, Object { "loc": Object { "end": Object { - "column": 44, - "line": 1, + "column": 32, + "line": 8, }, "start": Object { - "column": 34, - "line": 1, + "column": 24, + "line": 8, }, }, "range": Array [ - 34, - 44, + 245, + 253, ], - "type": "Keyword", - "value": "implements", + "type": "Identifier", + "value": "readonly", }, Object { "loc": Object { "end": Object { - "column": 56, - "line": 1, + "column": 38, + "line": 8, }, "start": Object { - "column": 45, - "line": 1, + "column": 33, + "line": 8, }, }, "range": Array [ - 45, - 56, + 254, + 259, ], "type": "Identifier", - "value": "MyInterface", + "value": "prop6", }, Object { "loc": Object { "end": Object { - "column": 64, - "line": 1, + "column": 39, + "line": 8, }, "start": Object { - "column": 57, - "line": 1, + "column": 38, + "line": 8, }, }, "range": Array [ - 57, - 64, + 259, + 260, ], - "type": "Keyword", - "value": "extends", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 77, - "line": 1, + "column": 46, + "line": 8, }, "start": Object { - "column": 65, - "line": 1, + "column": 40, + "line": 8, }, }, "range": Array [ - 65, - 77, + 261, + 267, ], "type": "Identifier", - "value": "MyOtherClass", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 79, - "line": 1, + "column": 47, + "line": 8, }, "start": Object { - "column": 78, - "line": 1, + "column": 46, + "line": 8, }, }, "range": Array [ - 78, - 79, + 267, + 268, ], "type": "Punctuator", - "value": "{", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 80, - "line": 1, + "column": 1, + "line": 9, }, "start": Object { - "column": 79, - "line": 1, + "column": 0, + "line": 9, }, }, "range": Array [ - 79, - 80, + 269, + 270, ], "type": "Punctuator", "value": "}", @@ -15761,32 +15731,107 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-implements-generic.src 1`] = ` +exports[`typescript fixtures/basics/class-with-definite-assignment.src 1`] = ` Object { "body": Array [ Object { "body": Object { - "body": Array [], + "body": Array [ + Object { + "computed": false, + "declare": false, + "definite": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 12, + 23, + ], + "static": false, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 22, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 16, + 22, + ], + "type": "TSStringKeyword", + }, + }, + "value": null, + }, + ], "loc": Object { "end": Object { "column": 1, "line": 3, }, "start": Object { - "column": 28, + "column": 8, "line": 1, }, }, "range": Array [ - 28, - 32, + 8, + 25, ], "type": "ClassBody", }, "id": Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { @@ -15794,104 +15839,13 @@ Object { "line": 1, }, }, - "name": "Foo", + "name": "X", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, - "implements": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "Bar", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 27, - ], - "type": "TSClassImplements", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 26, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "name": "S", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - }, - ], - "range": Array [ - 24, - 27, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - ], "loc": Object { "end": Object { "column": 1, @@ -15904,7 +15858,7 @@ Object { }, "range": Array [ 0, - 32, + 25, ], "superClass": null, "type": "ClassDeclaration", @@ -15922,7 +15876,7 @@ Object { }, "range": Array [ 0, - 33, + 26, ], "sourceType": "script", "tokens": Array [ @@ -15947,7 +15901,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { @@ -15957,118 +15911,118 @@ Object { }, "range": Array [ 6, - 9, + 7, ], "type": "Identifier", - "value": "Foo", + "value": "X", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 9, "line": 1, }, "start": Object { - "column": 10, + "column": 8, "line": 1, }, }, "range": Array [ - 10, - 20, + 8, + 9, ], - "type": "Keyword", - "value": "implements", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 3, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 21, - 24, + 12, + 13, ], "type": "Identifier", - "value": "Bar", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 4, + "line": 2, }, "start": Object { - "column": 24, - "line": 1, + "column": 3, + "line": 2, }, }, "range": Array [ - 24, - 25, + 13, + 14, ], "type": "Punctuator", - "value": "<", + "value": "!", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 5, + "line": 2, }, "start": Object { - "column": 25, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 25, - 26, + 14, + 15, ], - "type": "Identifier", - "value": "S", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 12, + "line": 2, }, "start": Object { - "column": 26, - "line": 1, + "column": 6, + "line": 2, }, }, "range": Array [ - 26, - 27, + 16, + 22, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 28, - "line": 1, + "column": 12, + "line": 2, }, }, "range": Array [ - 28, - 29, + 22, + 23, ], "type": "Punctuator", - "value": "{", + "value": ";", }, Object { "loc": Object { @@ -16082,8 +16036,8 @@ Object { }, }, "range": Array [ - 31, - 32, + 24, + 25, ], "type": "Punctuator", "value": "}", @@ -16093,176 +16047,200 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-implements-generic-multiple.src 1`] = ` +exports[`typescript fixtures/basics/class-with-export-parameter-properties.src 1`] = ` Object { "body": Array [ Object { "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, - "range": Array [ - 31, - 35, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "implements": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, }, + "name": "constructor", + "range": Array [ + 16, + 27, + ], + "type": "Identifier", }, - "name": "Bar", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 30, - ], - "type": "TSClassImplements", - "typeParameters": Object { + "kind": "constructor", "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 5, + "line": 4, }, "start": Object { - "column": 24, - "line": 1, + "column": 4, + "line": 2, }, }, - "params": Array [ - Object { + "range": Array [ + 16, + 54, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 5, + "line": 4, }, "start": Object { - "column": 25, - "line": 1, + "column": 34, + "line": 2, }, }, "range": Array [ - 25, - 26, + 46, + 54, ], - "type": "TSTypeReference", - "typeName": Object { + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "params": Array [ + Object { + "export": true, "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 32, + "line": 2, }, "start": Object { - "column": 25, - "line": 1, + "column": 16, + "line": 2, }, }, - "name": "S", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - }, - Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 29, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, }, - "start": Object { - "column": 28, - "line": 1, + "name": "a", + "range": Array [ + 35, + 44, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 36, + 44, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 38, + 44, + ], + "type": "TSStringKeyword", + }, }, }, - "name": "T", "range": Array [ 28, - 29, + 44, ], - "type": "Identifier", + "type": "TSParameterProperty", }, - }, - ], - "range": Array [ - 24, - 30, - ], - "type": "TSTypeParameterInstantiation", + ], + "range": Array [ + 27, + 54, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 10, + "line": 1, }, }, - ], + "range": Array [ + 10, + 56, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { "column": 0, @@ -16271,7 +16249,7 @@ Object { }, "range": Array [ 0, - 35, + 56, ], "superClass": null, "type": "ClassDeclaration", @@ -16280,7 +16258,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 7, }, "start": Object { "column": 0, @@ -16289,7 +16267,7 @@ Object { }, "range": Array [ 0, - 36, + 58, ], "sourceType": "script", "tokens": Array [ @@ -16332,7 +16310,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, + "column": 11, "line": 1, }, "start": Object { @@ -16342,151 +16320,187 @@ Object { }, "range": Array [ 10, - 20, + 11, ], - "type": "Keyword", - "value": "implements", - }, + "type": "Punctuator", + "value": "{", + }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 21, - 24, + 16, + 27, ], "type": "Identifier", - "value": "Bar", + "value": "constructor", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 24, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ - 24, - 25, + 27, + 28, ], "type": "Punctuator", - "value": "<", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 22, + "line": 2, }, "start": Object { - "column": 25, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 25, - 26, + 28, + 34, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 35, + 36, ], "type": "Identifier", - "value": "S", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 25, + "line": 2, }, "start": Object { - "column": 26, - "line": 1, + "column": 24, + "line": 2, }, }, "range": Array [ - 26, - 27, + 36, + 37, ], "type": "Punctuator", - "value": ",", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 32, + "line": 2, }, "start": Object { - "column": 28, - "line": 1, + "column": 26, + "line": 2, }, }, "range": Array [ - 28, - 29, + 38, + 44, ], "type": "Identifier", - "value": "T", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 33, + "line": 2, }, "start": Object { - "column": 29, - "line": 1, + "column": 32, + "line": 2, }, }, "range": Array [ - 29, - 30, + 44, + 45, ], "type": "Punctuator", - "value": ">", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 1, + "column": 35, + "line": 2, }, "start": Object { - "column": 31, - "line": 1, + "column": 34, + "line": 2, }, }, "range": Array [ - 31, - 32, + 46, + 47, ], "type": "Punctuator", "value": "{", }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "}", + }, Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { "column": 0, - "line": 3, + "line": 5, }, }, "range": Array [ - 34, - 35, + 55, + 56, ], "type": "Punctuator", "value": "}", @@ -16496,355 +16510,32 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-method.src 1`] = ` +exports[`typescript fixtures/basics/class-with-extends-and-implements.src 1`] = ` Object { "body": Array [ Object { "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 12, - 15, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 12, - 29, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 26, - 29, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "params": Array [], - "range": Array [ - 15, - 29, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 7, - "line": 2, - }, - }, - "range": Array [ - 17, - 25, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "range": Array [ - 19, - 25, - ], - "type": "TSNumberKeyword", - }, - }, - "type": "FunctionExpression", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "name": "bar", - "range": Array [ - 32, - 35, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "range": Array [ - 32, - 44, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 11, - "line": 3, - }, - }, - "range": Array [ - 41, - 44, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 5, - "line": 3, - }, - }, - "params": Array [], - "range": Array [ - 35, - 44, - ], - "type": "FunctionExpression", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 3, - }, - "start": Object { - "column": 5, - "line": 3, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "name": "T", - "range": Array [ - 36, - 37, - ], - "type": "Identifier", - }, - "range": Array [ - 36, - 37, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 35, - 38, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 2, - "line": 4, - }, - }, - "name": "baz", - "range": Array [ - 47, - 50, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 10, - "line": 4, - }, - "start": Object { - "column": 2, - "line": 4, - }, - }, - "range": Array [ - 47, - 55, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 10, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 4, - }, - }, - "range": Array [ - 53, - 55, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 10, - "line": 4, - }, - "start": Object { - "column": 5, - "line": 4, - }, - }, - "params": Array [], - "range": Array [ - 50, - 55, - ], - "type": "FunctionExpression", - }, - }, - ], + "body": Array [], "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 80, + "line": 1, }, "start": Object { - "column": 8, + "column": 78, "line": 1, }, }, "range": Array [ - 8, - 57, + 78, + 80, ], "type": "ClassBody", }, "id": Object { "loc": Object { "end": Object { - "column": 7, + "column": 33, "line": 1, }, "start": Object { @@ -16852,17 +16543,54 @@ Object { "line": 1, }, }, - "name": "C", + "name": "ClassWithParentAndInterface", "range": Array [ 6, - 7, + 33, ], "type": "Identifier", }, + "implements": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 77, + "line": 1, + }, + "start": Object { + "column": 66, + "line": 1, + }, + }, + "name": "MyInterface", + "range": Array [ + 66, + 77, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 77, + "line": 1, + }, + "start": Object { + "column": 66, + "line": 1, + }, + }, + "range": Array [ + 66, + 77, + ], + "type": "TSClassImplements", + }, + ], "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 80, + "line": 1, }, "start": Object { "column": 0, @@ -16871,16 +16599,33 @@ Object { }, "range": Array [ 0, - 57, + 80, ], - "superClass": null, + "superClass": Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "name": "MyOtherClass", + "range": Array [ + 42, + 54, + ], + "type": "Identifier", + }, "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 6, + "line": 2, }, "start": Object { "column": 0, @@ -16889,7 +16634,7 @@ Object { }, "range": Array [ 0, - 58, + 81, ], "sourceType": "script", "tokens": Array [ @@ -16914,7 +16659,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 33, "line": 1, }, "start": Object { @@ -16924,187 +16669,373 @@ Object { }, "range": Array [ 6, - 7, + 33, ], "type": "Identifier", - "value": "C", + "value": "ClassWithParentAndInterface", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 41, "line": 1, }, "start": Object { - "column": 8, + "column": 34, "line": 1, }, }, "range": Array [ - 8, - 9, + 34, + 41, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "extends", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 54, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 42, + "line": 1, }, }, "range": Array [ - 12, - 15, + 42, + 54, ], "type": "Identifier", - "value": "foo", + "value": "MyOtherClass", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 2, + "column": 65, + "line": 1, }, "start": Object { - "column": 5, - "line": 2, + "column": 55, + "line": 1, }, }, "range": Array [ - 15, - 16, + 55, + 65, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "implements", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 77, + "line": 1, }, "start": Object { - "column": 6, - "line": 2, + "column": 66, + "line": 1, }, }, "range": Array [ - 16, - 17, + 66, + 77, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "MyInterface", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 79, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 78, + "line": 1, }, }, "range": Array [ - 17, - 18, + 78, + 79, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 80, + "line": 1, }, "start": Object { - "column": 9, - "line": 2, + "column": 79, + "line": 1, }, }, "range": Array [ - 19, - 25, + 79, + 80, ], - "type": "Identifier", - "value": "number", + "type": "Punctuator", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-extends-generic.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 32, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 1, + "line": 3, }, "start": Object { - "column": 16, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 26, - 27, + 0, + 32, ], - "type": "Punctuator", - "value": "{", + "superClass": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "superTypeParameters": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "B", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 24, + 27, + ], + "type": "TSTypeParameterInstantiation", + }, + "type": "ClassDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 10, + 11, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 9, + 12, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 33, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 5, + "line": 1, }, "start": Object { - "column": 18, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 28, - 29, + 0, + 5, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 9, + "line": 1, }, "start": Object { - "column": 2, - "line": 3, + "column": 6, + "line": 1, }, }, "range": Array [ - 32, - 35, + 6, + 9, ], "type": "Identifier", - "value": "bar", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 3, + "column": 10, + "line": 1, }, "start": Object { - "column": 5, - "line": 3, + "column": 9, + "line": 1, }, }, "range": Array [ - 35, - 36, + 9, + 10, ], "type": "Punctuator", "value": "<", @@ -17112,35 +17043,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 11, + "line": 1, }, "start": Object { - "column": 6, - "line": 3, + "column": 10, + "line": 1, }, }, "range": Array [ - 36, - 37, + 10, + 11, ], "type": "Identifier", - "value": "T", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 3, + "column": 12, + "line": 1, }, "start": Object { - "column": 7, - "line": 3, + "column": 11, + "line": 1, }, }, "range": Array [ - 37, - 38, + 11, + 12, ], "type": "Punctuator", "value": ">", @@ -17148,300 +17079,171 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, - "line": 3, + "column": 20, + "line": 1, }, "start": Object { - "column": 8, - "line": 3, + "column": 13, + "line": 1, }, }, "range": Array [ - 38, - 39, + 13, + 20, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "extends", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 3, + "column": 24, + "line": 1, }, "start": Object { - "column": 9, - "line": 3, + "column": 21, + "line": 1, }, }, "range": Array [ - 39, - 40, + 21, + 24, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "Bar", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 3, + "column": 25, + "line": 1, }, "start": Object { - "column": 11, - "line": 3, + "column": 24, + "line": 1, }, }, "range": Array [ - 41, - 42, + 24, + 25, ], "type": "Punctuator", - "value": "{", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 3, + "column": 26, + "line": 1, }, "start": Object { - "column": 13, - "line": 3, + "column": 25, + "line": 1, }, }, "range": Array [ - 43, - 44, + 25, + 26, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "B", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 27, + "line": 1, }, "start": Object { - "column": 2, - "line": 4, + "column": 26, + "line": 1, }, }, "range": Array [ - 47, - 50, + 26, + 27, ], - "type": "Identifier", - "value": "baz", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 4, + "column": 29, + "line": 1, }, "start": Object { - "column": 5, - "line": 4, + "column": 28, + "line": 1, }, }, "range": Array [ - 50, - 51, + 28, + 29, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 4, + "column": 1, + "line": 3, }, "start": Object { - "column": 6, - "line": 4, + "column": 0, + "line": 3, }, }, "range": Array [ - 51, - 52, + 31, + 32, ], "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 4, - }, - }, - "range": Array [ - 53, - 54, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 4, - }, - "start": Object { - "column": 9, - "line": 4, - }, - }, - "range": Array [ - 54, - 55, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, - }, - "range": Array [ - 56, - 57, - ], - "type": "Punctuator", - "value": "}", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/class-with-mixin.src 1`] = ` +exports[`typescript fixtures/basics/class-with-extends-generic-multiple.src 1`] = ` Object { "body": Array [ Object { - "async": false, "body": Object { - "body": Array [ - Object { - "argument": Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 33, - "line": 2, - }, - "start": Object { - "column": 30, - "line": 2, - }, - }, - "range": Array [ - 79, - 82, - ], - "type": "ClassBody", - }, - "id": null, - "loc": Object { - "end": Object { - "column": 33, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "range": Array [ - 60, - 82, - ], - "superClass": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 2, - }, - "start": Object { - "column": 25, - "line": 2, - }, - }, - "name": "Base", - "range": Array [ - 74, - 78, - ], - "type": "Identifier", - }, - "type": "ClassExpression", - }, - "loc": Object { - "end": Object { - "column": 33, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 53, - 82, - ], - "type": "ReturnStatement", - }, - ], + "body": Array [], "loc": Object { "end": Object { "column": 1, "line": 3, }, "start": Object { - "column": 47, + "column": 41, "line": 1, }, }, "range": Array [ - 47, - 84, + 41, + 45, ], - "type": "BlockStatement", + "type": "ClassBody", }, - "expression": false, - "generator": false, "id": Object { "loc": Object { "end": Object { - "column": 10, + "column": 9, "line": 1, }, "start": Object { - "column": 9, + "column": 6, "line": 1, }, }, - "name": "M", + "name": "Foo", "range": Array [ + 6, 9, - 10, ], "type": "Identifier", }, @@ -17455,740 +17257,204 @@ Object { "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 1, - }, - "start": Object { - "column": 38, - "line": 1, - }, - }, - "name": "Base", - "range": Array [ - 38, - 45, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 1, - }, - "start": Object { - "column": 42, - "line": 1, - }, - }, - "range": Array [ - 42, - 45, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 1, - }, - "start": Object { - "column": 44, - "line": 1, - }, - }, - "range": Array [ - 44, - 45, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 1, - }, - "start": Object { - "column": 44, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 44, - 45, - ], - "type": "Identifier", - }, - }, - }, - }, - ], "range": Array [ 0, - 84, + 45, ], - "type": "FunctionDeclaration", - "typeParameters": Object { + "superClass": Object { "loc": Object { "end": Object { - "column": 37, + "column": 34, "line": 1, }, "start": Object { - "column": 10, + "column": 31, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 31, + 34, + ], + "type": "Identifier", + }, + "superTypeParameters": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 34, "line": 1, }, }, "params": Array [ Object { - "constraint": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 36, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "Constructor", - "range": Array [ - 21, - 32, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 32, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "members": Array [], - "range": Array [ - 33, - 35, - ], - "type": "TSTypeLiteral", - }, - ], - "range": Array [ - 32, - 36, - ], - "type": "TSTypeParameterInstantiation", - }, - }, "loc": Object { "end": Object { "column": 36, "line": 1, }, "start": Object { - "column": 11, + "column": 35, "line": 1, }, }, - "name": Object { + "range": Array [ + 35, + 36, + ], + "type": "TSTypeReference", + "typeName": Object { "loc": Object { "end": Object { - "column": 12, + "column": 36, "line": 1, }, "start": Object { - "column": 11, + "column": 35, "line": 1, }, }, - "name": "T", + "name": "C", "range": Array [ - 11, - 12, + 35, + 36, ], "type": "Identifier", }, - "range": Array [ - 11, - 36, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 10, - 37, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 42, - "line": 5, - }, - "start": Object { - "column": 39, - "line": 5, - }, - }, - "range": Array [ - 125, - 128, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 5, - }, - "start": Object { - "column": 6, - "line": 5, - }, - }, - "name": "X", - "range": Array [ - 92, - 93, - ], - "type": "Identifier", - }, - "implements": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 5, - }, - "start": Object { - "column": 37, - "line": 5, - }, - }, - "name": "I", - "range": Array [ - 123, - 124, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 38, - "line": 5, - }, - "start": Object { - "column": 37, - "line": 5, - }, }, - "range": Array [ - 123, - 124, - ], - "type": "TSClassImplements", - }, - ], - "loc": Object { - "end": Object { - "column": 42, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, - }, - "range": Array [ - 86, - 128, - ], - "superClass": Object { - "arguments": Array [ Object { "loc": Object { "end": Object { - "column": 24, - "line": 5, + "column": 39, + "line": 1, }, "start": Object { - "column": 23, - "line": 5, + "column": 38, + "line": 1, }, }, - "name": "C", "range": Array [ - 109, - 110, + 38, + 39, ], - "type": "Identifier", - }, - ], - "callee": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 5, - }, - "start": Object { - "column": 16, - "line": 5, - }, - }, - "name": "M", - "range": Array [ - 102, - 103, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 25, - "line": 5, - }, - "start": Object { - "column": 16, - "line": 5, - }, - }, - "range": Array [ - 102, - 111, - ], - "type": "CallExpression", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 5, - }, - "start": Object { - "column": 17, - "line": 5, - }, - }, - "params": Array [ - Object { + "type": "TSTypeReference", + "typeName": Object { "loc": Object { "end": Object { - "column": 21, - "line": 5, + "column": 39, + "line": 1, }, "start": Object { - "column": 18, - "line": 5, + "column": 38, + "line": 1, }, }, + "name": "D", "range": Array [ - 104, - 107, + 38, + 39, ], - "type": "TSAnyKeyword", + "type": "Identifier", }, - ], - "range": Array [ - 103, - 108, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - "type": "ClassDeclaration", - }, - Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 11, - "line": 7, }, - "start": Object { - "column": 8, - "line": 7, - }, - }, - "range": Array [ - 138, - 141, ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 7, - }, - "start": Object { - "column": 6, - "line": 7, - }, - }, - "name": "C", "range": Array [ - 136, - 137, + 34, + 40, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 7, - }, - "start": Object { - "column": 0, - "line": 7, - }, + "type": "TSTypeParameterInstantiation", }, - "range": Array [ - 130, - 141, - ], - "superClass": null, "type": "ClassDeclaration", - }, - Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 15, - "line": 8, - }, - "start": Object { - "column": 12, - "line": 8, - }, - }, - "range": Array [ - 154, - 157, - ], - "type": "TSInterfaceBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 8, - }, - "start": Object { - "column": 10, - "line": 8, - }, - }, - "name": "I", - "range": Array [ - 152, - 153, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 8, - }, - "start": Object { - "column": 0, - "line": 8, - }, - }, - "range": Array [ - 142, - 157, - ], - "type": "TSInterfaceDeclaration", - }, - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 9, - }, - "start": Object { - "column": 5, - "line": 9, - }, - }, - "name": "Constructor", - "range": Array [ - 163, - 174, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 48, - "line": 9, - }, - "start": Object { - "column": 0, - "line": 9, - }, - }, - "range": Array [ - 158, - 206, - ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { + "typeParameters": Object { "loc": Object { "end": Object { - "column": 47, - "line": 9, + "column": 22, + "line": 1, }, "start": Object { - "column": 22, - "line": 9, + "column": 9, + "line": 1, }, }, "params": Array [ Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 9, - }, - "start": Object { - "column": 30, - "line": 9, - }, - }, - "name": "args", - "range": Array [ - 188, - 192, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 41, - "line": 9, - }, - "start": Object { - "column": 27, - "line": 9, - }, - }, - "range": Array [ - 185, - 199, - ], - "type": "RestElement", - "typeAnnotation": Object { + "constraint": Object { "loc": Object { "end": Object { - "column": 41, - "line": 9, + "column": 21, + "line": 1, }, "start": Object { - "column": 34, - "line": 9, + "column": 20, + "line": 1, }, }, "range": Array [ - 192, - 199, + 20, + 21, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "elementType": Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 9, - }, - "start": Object { - "column": 36, - "line": 9, - }, - }, - "range": Array [ - 194, - 197, - ], - "type": "TSAnyKeyword", - }, + "type": "TSTypeReference", + "typeName": Object { "loc": Object { "end": Object { - "column": 41, - "line": 9, + "column": 21, + "line": 1, }, "start": Object { - "column": 36, - "line": 9, + "column": 20, + "line": 1, }, }, + "name": "B", "range": Array [ - 194, - 199, + 20, + 21, ], - "type": "TSArrayType", - }, - }, - }, - ], - "range": Array [ - 180, - 205, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 9, - }, - "start": Object { - "column": 43, - "line": 9, - }, - }, - "range": Array [ - 201, - 205, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 9, - }, - "start": Object { - "column": 46, - "line": 9, - }, - }, - "range": Array [ - 204, - 205, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 9, - }, - "start": Object { - "column": 46, - "line": 9, - }, + "type": "Identifier", }, - "name": "T", - "range": Array [ - 204, - 205, - ], - "type": "Identifier", }, - }, - }, - "type": "TSConstructorType", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 9, - }, - "start": Object { - "column": 16, - "line": 9, - }, - }, - "params": Array [ - Object { "loc": Object { "end": Object { - "column": 18, - "line": 9, + "column": 21, + "line": 1, }, "start": Object { - "column": 17, - "line": 9, + "column": 10, + "line": 1, }, }, "name": Object { "loc": Object { "end": Object { - "column": 18, - "line": 9, + "column": 11, + "line": 1, }, "start": Object { - "column": 17, - "line": 9, + "column": 10, + "line": 1, }, }, - "name": "T", + "name": "A", "range": Array [ - 175, - 176, + 10, + 11, ], "type": "Identifier", }, "range": Array [ - 175, - 176, + 10, + 21, ], "type": "TSTypeParameter", }, ], "range": Array [ - 174, - 177, + 9, + 22, ], "type": "TSTypeParameterDeclaration", }, @@ -18197,7 +17463,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 10, + "line": 4, }, "start": Object { "column": 0, @@ -18206,14 +17472,14 @@ Object { }, "range": Array [ 0, - 207, + 46, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 5, "line": 1, }, "start": Object { @@ -18223,43 +17489,43 @@ Object { }, "range": Array [ 0, - 8, + 5, ], "type": "Keyword", - "value": "function", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 9, "line": 1, }, "start": Object { - "column": 9, + "column": 6, "line": 1, }, }, "range": Array [ + 6, 9, - 10, ], "type": "Identifier", - "value": "M", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 10, "line": 1, }, "start": Object { - "column": 10, + "column": 9, "line": 1, }, }, "range": Array [ + 9, 10, - 11, ], "type": "Punctuator", "value": "<", @@ -18267,35 +17533,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 11, "line": 1, }, "start": Object { - "column": 11, + "column": 10, "line": 1, }, }, "range": Array [ + 10, 11, - 12, ], "type": "Identifier", - "value": "T", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 19, "line": 1, }, "start": Object { - "column": 13, + "column": 12, "line": 1, }, }, "range": Array [ - 13, - 20, + 12, + 19, ], "type": "Keyword", "value": "extends", @@ -18303,133 +17569,133 @@ Object { Object { "loc": Object { "end": Object { - "column": 32, + "column": 21, "line": 1, }, "start": Object { - "column": 21, + "column": 20, "line": 1, }, }, "range": Array [ + 20, 21, - 32, ], "type": "Identifier", - "value": "Constructor", + "value": "B", }, Object { "loc": Object { "end": Object { - "column": 33, + "column": 22, "line": 1, }, "start": Object { - "column": 32, + "column": 21, "line": 1, }, }, "range": Array [ - 32, - 33, + 21, + 22, ], "type": "Punctuator", - "value": "<", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 34, + "column": 30, "line": 1, }, "start": Object { - "column": 33, + "column": 23, "line": 1, }, }, "range": Array [ - 33, - 34, + 23, + 30, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "extends", }, Object { "loc": Object { "end": Object { - "column": 35, + "column": 34, "line": 1, }, "start": Object { - "column": 34, + "column": 31, "line": 1, }, }, "range": Array [ + 31, 34, - 35, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "Bar", }, Object { "loc": Object { "end": Object { - "column": 36, + "column": 35, "line": 1, }, "start": Object { - "column": 35, + "column": 34, "line": 1, }, }, "range": Array [ + 34, 35, - 36, ], "type": "Punctuator", - "value": ">", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 37, + "column": 36, "line": 1, }, "start": Object { - "column": 36, + "column": 35, "line": 1, }, }, "range": Array [ + 35, 36, - 37, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "C", }, Object { "loc": Object { "end": Object { - "column": 38, + "column": 37, "line": 1, }, "start": Object { - "column": 37, + "column": 36, "line": 1, }, }, "range": Array [ + 36, 37, - 38, ], "type": "Punctuator", - "value": "(", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 42, + "column": 39, "line": 1, }, "start": Object { @@ -18439,1213 +17705,1651 @@ Object { }, "range": Array [ 38, - 42, + 39, ], "type": "Identifier", - "value": "Base", + "value": "D", }, Object { "loc": Object { "end": Object { - "column": 43, + "column": 40, "line": 1, }, "start": Object { - "column": 42, + "column": 39, "line": 1, }, }, "range": Array [ - 42, - 43, + 39, + 40, ], "type": "Punctuator", - "value": ":", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 45, + "column": 42, "line": 1, }, "start": Object { - "column": 44, + "column": 41, "line": 1, }, }, "range": Array [ - 44, - 45, + 41, + 42, ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 46, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 45, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ + 44, 45, - 46, ], "type": "Punctuator", - "value": ")", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-generic-method.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 1, - }, - "start": Object { - "column": 47, + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "getBar", + "range": Array [ + 14, + 20, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 14, + 28, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 26, + 28, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 20, + 28, + ], + "type": "FunctionExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "range": Array [ + 21, + 22, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 20, + 23, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 30, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, "line": 1, }, }, "range": Array [ - 47, - 48, + 0, + 30, ], - "type": "Punctuator", - "value": "{", + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 5, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 53, - 59, + 0, + 5, ], "type": "Keyword", - "value": "return", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 9, + "line": 1, }, "start": Object { - "column": 11, - "line": 2, + "column": 6, + "line": 1, }, }, "range": Array [ - 60, - 65, + 6, + 9, ], - "type": "Keyword", - "value": "class", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 2, + "column": 11, + "line": 1, }, "start": Object { - "column": 17, - "line": 2, + "column": 10, + "line": 1, }, }, "range": Array [ - 66, - 73, + 10, + 11, ], - "type": "Keyword", - "value": "extends", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 8, "line": 2, }, "start": Object { - "column": 25, + "column": 2, "line": 2, }, }, "range": Array [ - 74, - 78, + 14, + 20, ], "type": "Identifier", - "value": "Base", + "value": "getBar", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 9, "line": 2, }, "start": Object { - "column": 30, + "column": 8, "line": 2, }, }, "range": Array [ - 79, - 80, + 20, + 21, ], "type": "Punctuator", - "value": "{", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 33, + "column": 10, "line": 2, }, "start": Object { - "column": 32, + "column": 9, "line": 2, }, }, "range": Array [ - 81, - 82, + 21, + 22, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 11, + "line": 2, }, "start": Object { - "column": 0, - "line": 3, + "column": 10, + "line": 2, }, }, "range": Array [ - 83, - 84, + 22, + 23, ], "type": "Punctuator", - "value": "}", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 5, + "column": 12, + "line": 2, }, "start": Object { - "column": 0, - "line": 5, + "column": 11, + "line": 2, }, }, "range": Array [ - 86, - 91, + 23, + 24, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 5, + "column": 13, + "line": 2, }, "start": Object { - "column": 6, - "line": 5, + "column": 12, + "line": 2, }, }, "range": Array [ - 92, - 93, + 24, + 25, ], - "type": "Identifier", - "value": "X", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { "column": 15, - "line": 5, + "line": 2, }, "start": Object { - "column": 8, - "line": 5, + "column": 14, + "line": 2, }, }, "range": Array [ - 94, - 101, + 26, + 27, ], - "type": "Keyword", - "value": "extends", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 5, + "column": 16, + "line": 2, }, "start": Object { - "column": 16, - "line": 5, + "column": 15, + "line": 2, }, }, "range": Array [ - 102, - 103, + 27, + 28, ], - "type": "Identifier", - "value": "M", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 5, + "column": 1, + "line": 3, }, "start": Object { - "column": 17, - "line": 5, + "column": 0, + "line": 3, }, }, "range": Array [ - 103, - 104, + 29, + 30, ], "type": "Punctuator", - "value": "<", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-generic-method-default.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 5, + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "getBar", + "range": Array [ + 14, + 20, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 14, + 34, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 32, + 34, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 20, + 34, + ], + "type": "FunctionExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "params": Array [ + Object { + "default": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 25, + 28, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "name": "Bar", + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + }, + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "range": Array [ + 21, + 28, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 20, + 29, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 1, + }, }, - "start": Object { - "column": 18, - "line": 5, + "range": Array [ + 10, + 36, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", }, - "range": Array [ - 104, - 107, - ], - "type": "Identifier", - "value": "any", - }, - Object { "loc": Object { "end": Object { - "column": 22, - "line": 5, + "column": 1, + "line": 3, }, "start": Object { - "column": 21, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 107, - 108, + 0, + 36, ], - "type": "Punctuator", - "value": ">", + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 37, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 23, - "line": 5, + "column": 5, + "line": 1, }, "start": Object { - "column": 22, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 108, - 109, + 0, + 5, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 5, + "column": 9, + "line": 1, }, "start": Object { - "column": 23, - "line": 5, + "column": 6, + "line": 1, }, }, "range": Array [ - 109, - 110, + 6, + 9, ], "type": "Identifier", - "value": "C", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 5, + "column": 11, + "line": 1, }, "start": Object { - "column": 24, - "line": 5, + "column": 10, + "line": 1, }, }, "range": Array [ - 110, - 111, + 10, + 11, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 36, - "line": 5, + "column": 8, + "line": 2, }, "start": Object { - "column": 26, - "line": 5, + "column": 2, + "line": 2, }, }, "range": Array [ - 112, - 122, + 14, + 20, ], - "type": "Keyword", - "value": "implements", + "type": "Identifier", + "value": "getBar", }, Object { "loc": Object { "end": Object { - "column": 38, - "line": 5, + "column": 9, + "line": 2, }, "start": Object { - "column": 37, - "line": 5, + "column": 8, + "line": 2, }, }, "range": Array [ - 123, - 124, + 20, + 21, ], - "type": "Identifier", - "value": "I", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 40, - "line": 5, + "column": 10, + "line": 2, }, "start": Object { - "column": 39, - "line": 5, + "column": 9, + "line": 2, }, }, "range": Array [ - 125, - 126, + 21, + 22, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 5, + "column": 12, + "line": 2, }, "start": Object { - "column": 41, - "line": 5, + "column": 11, + "line": 2, }, }, "range": Array [ - 127, - 128, + 23, + 24, ], "type": "Punctuator", - "value": "}", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 7, + "column": 16, + "line": 2, }, "start": Object { - "column": 0, - "line": 7, + "column": 13, + "line": 2, }, }, "range": Array [ - 130, - 135, + 25, + 28, ], - "type": "Keyword", - "value": "class", + "type": "Identifier", + "value": "Bar", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 7, + "column": 17, + "line": 2, }, "start": Object { - "column": 6, - "line": 7, + "column": 16, + "line": 2, }, }, "range": Array [ - 136, - 137, + 28, + 29, ], - "type": "Identifier", - "value": "C", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 7, + "column": 18, + "line": 2, }, "start": Object { - "column": 8, - "line": 7, + "column": 17, + "line": 2, }, }, "range": Array [ - 138, - 139, + 29, + 30, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 7, + "column": 19, + "line": 2, }, "start": Object { - "column": 10, - "line": 7, + "column": 18, + "line": 2, }, }, "range": Array [ - 140, - 141, + 30, + 31, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 8, + "column": 21, + "line": 2, }, "start": Object { - "column": 0, - "line": 8, + "column": 20, + "line": 2, }, }, "range": Array [ - 142, - 151, + 32, + 33, ], - "type": "Keyword", - "value": "interface", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 8, + "column": 22, + "line": 2, }, "start": Object { - "column": 10, - "line": 8, + "column": 21, + "line": 2, }, }, "range": Array [ - 152, - 153, + 33, + 34, ], - "type": "Identifier", - "value": "I", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 8, + "column": 1, + "line": 3, }, "start": Object { - "column": 12, - "line": 8, + "column": 0, + "line": 3, }, }, "range": Array [ - 154, - 155, + 35, + 36, ], "type": "Punctuator", - "value": "{", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-implements.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 29, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "implements": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "TSClassImplements", + }, + ], "loc": Object { "end": Object { - "column": 15, - "line": 8, + "column": 1, + "line": 3, }, "start": Object { - "column": 14, - "line": 8, + "column": 0, + "line": 1, }, }, "range": Array [ - 156, - 157, + 0, + 29, ], - "type": "Punctuator", - "value": "}", + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, - "line": 9, + "column": 5, + "line": 1, }, "start": Object { "column": 0, - "line": 9, + "line": 1, }, }, "range": Array [ - 158, - 162, + 0, + 5, ], - "type": "Identifier", - "value": "type", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 9, + "column": 9, + "line": 1, }, "start": Object { - "column": 5, - "line": 9, + "column": 6, + "line": 1, }, }, "range": Array [ - 163, - 174, + 6, + 9, ], "type": "Identifier", - "value": "Constructor", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 9, + "column": 20, + "line": 1, }, "start": Object { - "column": 16, - "line": 9, + "column": 10, + "line": 1, }, }, "range": Array [ - 174, - 175, + 10, + 20, ], - "type": "Punctuator", - "value": "<", + "type": "Keyword", + "value": "implements", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 9, + "column": 24, + "line": 1, }, "start": Object { - "column": 17, - "line": 9, + "column": 21, + "line": 1, }, }, "range": Array [ - 175, - 176, + 21, + 24, ], "type": "Identifier", - "value": "T", + "value": "Bar", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 9, + "column": 26, + "line": 1, }, "start": Object { - "column": 18, - "line": 9, + "column": 25, + "line": 1, }, }, "range": Array [ - 176, - 177, + 25, + 26, ], "type": "Punctuator", - "value": ">", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 9, + "column": 1, + "line": 3, }, "start": Object { - "column": 20, - "line": 9, + "column": 0, + "line": 3, }, }, "range": Array [ - 178, - 179, + 28, + 29, ], "type": "Punctuator", - "value": "=", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-implements-and-extends.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 9, - }, - "start": Object { - "column": 22, - "line": 9, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 80, + "line": 1, + }, + "start": Object { + "column": 78, + "line": 1, + }, }, + "range": Array [ + 78, + 80, + ], + "type": "ClassBody", }, - "range": Array [ - 180, - 183, - ], - "type": "Keyword", - "value": "new", - }, - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 9, - }, - "start": Object { - "column": 26, - "line": 9, + "id": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, }, + "name": "ClassWithParentAndInterface", + "range": Array [ + 6, + 33, + ], + "type": "Identifier", }, - "range": Array [ - 184, - 185, + "implements": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 45, + "line": 1, + }, + }, + "name": "MyInterface", + "range": Array [ + 45, + 56, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 45, + "line": 1, + }, + }, + "range": Array [ + 45, + 56, + ], + "type": "TSClassImplements", + }, ], - "type": "Punctuator", - "value": "(", - }, - Object { "loc": Object { "end": Object { - "column": 30, - "line": 9, + "column": 80, + "line": 1, }, "start": Object { - "column": 27, - "line": 9, + "column": 0, + "line": 1, }, }, "range": Array [ - 185, - 188, + 0, + 80, ], - "type": "Punctuator", - "value": "...", - }, - Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 9, - }, - "start": Object { - "column": 30, - "line": 9, + "superClass": Object { + "loc": Object { + "end": Object { + "column": 77, + "line": 1, + }, + "start": Object { + "column": 65, + "line": 1, + }, }, + "name": "MyOtherClass", + "range": Array [ + 65, + 77, + ], + "type": "Identifier", }, - "range": Array [ - 188, - 192, - ], - "type": "Identifier", - "value": "args", + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 81, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 35, - "line": 9, + "column": 5, + "line": 1, }, "start": Object { - "column": 34, - "line": 9, + "column": 0, + "line": 1, }, }, "range": Array [ - 192, - 193, + 0, + 5, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 39, - "line": 9, + "column": 33, + "line": 1, }, "start": Object { - "column": 36, - "line": 9, + "column": 6, + "line": 1, }, }, "range": Array [ - 194, - 197, + 6, + 33, ], "type": "Identifier", - "value": "any", + "value": "ClassWithParentAndInterface", }, Object { "loc": Object { "end": Object { - "column": 40, - "line": 9, + "column": 44, + "line": 1, }, "start": Object { - "column": 39, - "line": 9, + "column": 34, + "line": 1, }, }, "range": Array [ - 197, - 198, + 34, + 44, ], - "type": "Punctuator", - "value": "[", + "type": "Keyword", + "value": "implements", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 9, + "column": 56, + "line": 1, }, "start": Object { - "column": 40, - "line": 9, + "column": 45, + "line": 1, }, }, "range": Array [ - 198, - 199, + 45, + 56, ], - "type": "Punctuator", - "value": "]", + "type": "Identifier", + "value": "MyInterface", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 9, + "column": 64, + "line": 1, }, "start": Object { - "column": 41, - "line": 9, + "column": 57, + "line": 1, }, }, "range": Array [ - 199, - 200, + 57, + 64, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "extends", }, Object { "loc": Object { "end": Object { - "column": 45, - "line": 9, + "column": 77, + "line": 1, }, "start": Object { - "column": 43, - "line": 9, + "column": 65, + "line": 1, }, }, "range": Array [ - 201, - 203, + 65, + 77, ], - "type": "Punctuator", - "value": "=>", + "type": "Identifier", + "value": "MyOtherClass", }, Object { "loc": Object { "end": Object { - "column": 47, - "line": 9, + "column": 79, + "line": 1, }, "start": Object { - "column": 46, - "line": 9, + "column": 78, + "line": 1, }, }, "range": Array [ - 204, - 205, + 78, + 79, ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 48, - "line": 9, + "column": 80, + "line": 1, }, "start": Object { - "column": 47, - "line": 9, + "column": 79, + "line": 1, }, }, "range": Array [ - 205, - 206, + 79, + 80, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/class-with-mixin-reference.src 1`] = ` +exports[`typescript fixtures/basics/class-with-implements-generic.src 1`] = ` Object { "body": Array [ Object { - "async": false, "body": Object { "body": Array [], "loc": Object { "end": Object { "column": 1, - "line": 2, + "line": 3, }, "start": Object { - "column": 46, + "column": 28, "line": 1, }, }, "range": Array [ - 46, - 49, + 28, + 32, ], - "type": "BlockStatement", + "type": "ClassBody", }, - "expression": false, - "generator": false, "id": Object { "loc": Object { "end": Object { - "column": 10, + "column": 9, "line": 1, }, "start": Object { - "column": 9, + "column": 6, "line": 1, }, }, - "name": "M", + "name": "Foo", "range": Array [ + 6, 9, - 10, ], "type": "Identifier", }, - "loc": Object { - "end": Object { - "column": 1, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ + "implements": Array [ Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 44, + "column": 27, "line": 1, }, "start": Object { - "column": 37, + "column": 21, "line": 1, }, }, - "name": "Base", "range": Array [ - 37, - 44, + 21, + 27, ], - "type": "Identifier", - "typeAnnotation": Object { + "type": "TSClassImplements", + "typeParameters": Object { "loc": Object { "end": Object { - "column": 44, + "column": 27, "line": 1, }, "start": Object { - "column": 41, + "column": 24, "line": 1, }, }, - "range": Array [ - 41, - 44, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 43, - "line": 1, - }, - }, - "range": Array [ - 43, - 44, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 43, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 43, - 44, - ], - "type": "Identifier", - }, - }, - }, - }, - ], - "range": Array [ - 0, - 49, - ], - "type": "FunctionDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "params": Array [ - Object { - "constraint": Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 35, - ], - "type": "TSTypeReference", - "typeName": Object { + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 32, + "column": 26, "line": 1, }, "start": Object { - "column": 21, + "column": 25, "line": 1, }, }, - "name": "Constructor", "range": Array [ - 21, - 32, + 25, + 26, ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 32, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, }, - "range": Array [ - 33, - 34, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "name": "M", - "range": Array [ - 33, - 34, - ], - "type": "Identifier", + "start": Object { + "column": 25, + "line": 1, }, }, - ], - "range": Array [ - 32, - 35, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, + "name": "S", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", }, }, - "name": "T", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, + ], "range": Array [ - 11, - 35, + 24, + 27, ], - "type": "TSTypeParameter", + "type": "TSTypeParameterInstantiation", }, - ], - "range": Array [ - 10, - 36, - ], - "type": "TSTypeParameterDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, }, + "range": Array [ + 0, + 32, + ], + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 3, + "line": 4, }, "start": Object { "column": 0, @@ -19654,14 +19358,14 @@ Object { }, "range": Array [ 0, - 50, + 33, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 5, "line": 1, }, "start": Object { @@ -19671,33 +19375,33 @@ Object { }, "range": Array [ 0, - 8, + 5, ], "type": "Keyword", - "value": "function", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 9, "line": 1, }, "start": Object { - "column": 9, + "column": 6, "line": 1, }, }, "range": Array [ + 6, 9, - 10, ], "type": "Identifier", - "value": "M", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 20, "line": 1, }, "start": Object { @@ -19707,205 +19411,464 @@ Object { }, "range": Array [ 10, - 11, + 20, ], - "type": "Punctuator", - "value": "<", + "type": "Keyword", + "value": "implements", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 24, "line": 1, }, "start": Object { - "column": 11, + "column": 21, "line": 1, }, }, "range": Array [ - 11, - 12, + 21, + 24, ], "type": "Identifier", - "value": "T", + "value": "Bar", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 25, "line": 1, }, "start": Object { - "column": 13, + "column": 24, "line": 1, }, }, "range": Array [ - 13, - 20, + 24, + 25, ], - "type": "Keyword", - "value": "extends", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 26, "line": 1, }, "start": Object { - "column": 21, + "column": 25, "line": 1, }, }, "range": Array [ - 21, - 32, + 25, + 26, ], "type": "Identifier", - "value": "Constructor", + "value": "S", }, Object { "loc": Object { "end": Object { - "column": 33, + "column": 27, "line": 1, }, "start": Object { - "column": 32, + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, "line": 1, }, }, "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 31, 32, - 33, ], "type": "Punctuator", - "value": "<", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-implements-generic-multiple.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 35, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "implements": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 30, + ], + "type": "TSClassImplements", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "S", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 24, + 30, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 35, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 36, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 34, + "column": 9, "line": 1, }, "start": Object { - "column": 33, + "column": 6, "line": 1, }, }, "range": Array [ - 33, - 34, + 6, + 9, ], "type": "Identifier", - "value": "M", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 35, + "column": 20, "line": 1, }, "start": Object { - "column": 34, + "column": 10, "line": 1, }, }, "range": Array [ - 34, - 35, + 10, + 20, ], - "type": "Punctuator", - "value": ">", + "type": "Keyword", + "value": "implements", }, Object { "loc": Object { "end": Object { - "column": 36, + "column": 24, "line": 1, }, "start": Object { - "column": 35, + "column": 21, "line": 1, }, }, "range": Array [ - 35, - 36, + 21, + 24, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "Bar", }, Object { "loc": Object { "end": Object { - "column": 37, + "column": 25, "line": 1, }, "start": Object { - "column": 36, + "column": 24, "line": 1, }, }, "range": Array [ - 36, - 37, + 24, + 25, ], "type": "Punctuator", - "value": "(", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 41, + "column": 26, "line": 1, }, "start": Object { - "column": 37, + "column": 25, "line": 1, }, }, "range": Array [ - 37, - 41, + 25, + 26, ], "type": "Identifier", - "value": "Base", + "value": "S", }, Object { "loc": Object { "end": Object { - "column": 42, + "column": 27, "line": 1, }, "start": Object { - "column": 41, + "column": 26, "line": 1, }, }, "range": Array [ - 41, - 42, + 26, + 27, ], "type": "Punctuator", - "value": ":", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 44, + "column": 29, "line": 1, }, "start": Object { - "column": 43, + "column": 28, "line": 1, }, }, "range": Array [ - 43, - 44, + 28, + 29, ], "type": "Identifier", "value": "T", @@ -19913,35 +19876,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 45, + "column": 30, "line": 1, }, "start": Object { - "column": 44, + "column": 29, "line": 1, }, }, "range": Array [ - 44, - 45, + 29, + 30, ], "type": "Punctuator", - "value": ")", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 47, + "column": 32, "line": 1, }, "start": Object { - "column": 46, + "column": 31, "line": 1, }, }, "range": Array [ - 46, - 47, + 31, + 32, ], "type": "Punctuator", "value": "{", @@ -19950,16 +19913,16 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 2, + "line": 3, }, "start": Object { "column": 0, - "line": 2, + "line": 3, }, }, "range": Array [ - 48, - 49, + 34, + 35, ], "type": "Punctuator", "value": "}", @@ -19969,372 +19932,18 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-optional-computed-property.src 1`] = ` +exports[`typescript fixtures/basics/class-with-method.src 1`] = ` Object { "body": Array [ Object { "body": Object { "body": Array [ Object { - "accessibility": "private", - "computed": true, + "computed": false, "key": Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "range": Array [ - 23, - 28, - ], - "raw": "'foo'", - "type": "Literal", - "value": "foo", - }, - "loc": Object { - "end": Object { - "column": 33, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "optional": true, - "range": Array [ - 14, - 43, - ], - "static": false, - "type": "ClassProperty", - "value": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 2, - }, - "start": Object { - "column": 23, - "line": 2, - }, - }, - "name": "undefined", - "range": Array [ - 33, - 42, - ], - "type": "Identifier", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 45, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "X", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 45, - ], - "superClass": null, - "type": "ClassDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 46, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 5, - ], - "type": "Keyword", - "value": "class", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - "value": "X", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 9, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 21, - ], - "type": "Keyword", - "value": "private", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": "[", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "range": Array [ - 23, - 28, - ], - "type": "String", - "value": "'foo'", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, - }, - }, - "range": Array [ - 28, - 29, - ], - "type": "Punctuator", - "value": "]", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 19, - "line": 2, - }, - }, - "range": Array [ - 29, - 30, - ], - "type": "Punctuator", - "value": "?", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 21, - "line": 2, - }, - }, - "range": Array [ - 31, - 32, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 2, - }, - "start": Object { - "column": 23, - "line": 2, - }, - }, - "range": Array [ - 33, - 42, - ], - "type": "Keyword", - "value": "undefined", - }, - Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 2, - }, - "start": Object { - "column": 32, - "line": 2, - }, - }, - "range": Array [ - 42, - 43, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 44, - 45, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-with-optional-methods.src 1`] = ` -Object { - "body": Array [ - Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 5, + "column": 5, "line": 2, }, "start": Object { @@ -20343,17 +19952,16 @@ Object { }, }, "name": "foo", - "optional": true, "range": Array [ - 14, - 17, + 12, + 15, ], "type": "Identifier", }, "kind": "method", "loc": Object { "end": Object { - "column": 9, + "column": 19, "line": 2, }, "start": Object { @@ -20362,32 +19970,83 @@ Object { }, }, "range": Array [ - 14, - 21, + 12, + 29, ], "static": false, "type": "MethodDefinition", "value": Object { "async": false, - "body": null, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "BlockStatement", + }, "expression": false, "generator": false, "id": null, "loc": Object { "end": Object { - "column": 9, + "column": 19, "line": 2, }, "start": Object { - "column": 6, + "column": 5, "line": 2, }, }, "params": Array [], "range": Array [ - 18, - 21, + 15, + 29, ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 17, + 25, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 25, + ], + "type": "TSNumberKeyword", + }, + }, "type": "FunctionExpression", }, }, @@ -20405,17 +20064,16 @@ Object { }, }, "name": "bar", - "optional": true, "range": Array [ - 24, - 27, + 32, + 35, ], "type": "Identifier", }, "kind": "method", "loc": Object { "end": Object { - "column": 17, + "column": 14, "line": 3, }, "start": Object { @@ -20424,95 +20082,130 @@ Object { }, }, "range": Array [ - 24, - 39, + 32, + 44, ], "static": false, "type": "MethodDefinition", "value": Object { "async": false, - "body": null, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 41, + 44, + ], + "type": "BlockStatement", + }, "expression": false, "generator": false, "id": null, "loc": Object { "end": Object { - "column": 17, + "column": 14, "line": 3, }, "start": Object { - "column": 6, + "column": 5, "line": 3, }, }, "params": Array [], "range": Array [ - 28, - 39, + 35, + 44, ], - "returnType": Object { + "type": "FunctionExpression", + "typeParameters": Object { "loc": Object { "end": Object { - "column": 16, + "column": 8, "line": 3, }, "start": Object { - "column": 8, + "column": 5, "line": 3, }, }, - "range": Array [ - 30, - 38, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 3, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, }, - "start": Object { - "column": 10, - "line": 3, + "name": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "name": "T", + "range": Array [ + 36, + 37, + ], + "type": "Identifier", }, + "range": Array [ + 36, + 37, + ], + "type": "TSTypeParameter", }, - "range": Array [ - 32, - 38, - ], - "type": "TSStringKeyword", - }, + ], + "range": Array [ + 35, + 38, + ], + "type": "TSTypeParameterDeclaration", }, - "type": "FunctionExpression", }, }, Object { - "accessibility": "private", "computed": false, "key": Object { "loc": Object { "end": Object { - "column": 13, + "column": 5, "line": 4, }, "start": Object { - "column": 10, + "column": 2, "line": 4, }, }, "name": "baz", - "optional": true, "range": Array [ + 47, 50, - 53, ], "type": "Identifier", }, "kind": "method", "loc": Object { "end": Object { - "column": 25, + "column": 10, "line": 4, }, "start": Object { @@ -20521,66 +20214,49 @@ Object { }, }, "range": Array [ - 42, - 65, + 47, + 55, ], "static": false, "type": "MethodDefinition", "value": Object { "async": false, - "body": null, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 53, + 55, + ], + "type": "BlockStatement", + }, "expression": false, "generator": false, "id": null, "loc": Object { "end": Object { - "column": 25, + "column": 10, "line": 4, }, "start": Object { - "column": 14, + "column": 5, "line": 4, }, }, "params": Array [], "range": Array [ - 54, - 65, + 50, + 55, ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 4, - }, - "start": Object { - "column": 16, - "line": 4, - }, - }, - "range": Array [ - 56, - 64, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 4, - }, - "start": Object { - "column": 18, - "line": 4, - }, - }, - "range": Array [ - 58, - 64, - ], - "type": "TSStringKeyword", - }, - }, "type": "FunctionExpression", }, }, @@ -20591,20 +20267,20 @@ Object { "line": 5, }, "start": Object { - "column": 10, + "column": 8, "line": 1, }, }, "range": Array [ - 10, - 67, + 8, + 57, ], "type": "ClassBody", }, "id": Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { @@ -20612,10 +20288,10 @@ Object { "line": 1, }, }, - "name": "Foo", + "name": "C", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, @@ -20631,7 +20307,7 @@ Object { }, "range": Array [ 0, - 67, + 57, ], "superClass": null, "type": "ClassDeclaration", @@ -20649,7 +20325,7 @@ Object { }, "range": Array [ 0, - 68, + 58, ], "sourceType": "script", "tokens": Array [ @@ -20674,7 +20350,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { @@ -20684,25 +20360,25 @@ Object { }, "range": Array [ 6, - 9, + 7, ], "type": "Identifier", - "value": "Foo", + "value": "C", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 9, "line": 1, }, "start": Object { - "column": 10, + "column": 8, "line": 1, }, }, "range": Array [ - 10, - 11, + 8, + 9, ], "type": "Punctuator", "value": "{", @@ -20719,8 +20395,8 @@ Object { }, }, "range": Array [ - 14, - 17, + 12, + 15, ], "type": "Identifier", "value": "foo", @@ -20737,11 +20413,11 @@ Object { }, }, "range": Array [ - 17, - 18, + 15, + 16, ], "type": "Punctuator", - "value": "?", + "value": "(", }, Object { "loc": Object { @@ -20755,11 +20431,11 @@ Object { }, }, "range": Array [ - 18, - 19, + 16, + 17, ], "type": "Punctuator", - "value": "(", + "value": ")", }, Object { "loc": Object { @@ -20773,146 +20449,146 @@ Object { }, }, "range": Array [ - 19, - 20, + 17, + 18, ], "type": "Punctuator", - "value": ")", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 15, "line": 2, }, "start": Object { - "column": 8, + "column": 9, "line": 2, }, }, "range": Array [ - 20, - 21, + 19, + 25, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 17, + "line": 2, }, "start": Object { - "column": 2, - "line": 3, + "column": 16, + "line": 2, }, }, "range": Array [ - 24, + 26, 27, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 3, + "column": 19, + "line": 2, }, "start": Object { - "column": 5, - "line": 3, + "column": 18, + "line": 2, }, }, "range": Array [ - 27, 28, + 29, ], "type": "Punctuator", - "value": "?", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 3, }, "start": Object { - "column": 6, + "column": 2, "line": 3, }, }, "range": Array [ - 28, - 29, + 32, + 35, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 6, "line": 3, }, "start": Object { - "column": 7, + "column": 5, "line": 3, }, }, "range": Array [ - 29, - 30, + 35, + 36, ], "type": "Punctuator", - "value": ")", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 3, }, "start": Object { - "column": 8, + "column": 6, "line": 3, }, }, "range": Array [ - 30, - 31, + 36, + 37, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 8, "line": 3, }, "start": Object { - "column": 10, + "column": 7, "line": 3, }, }, "range": Array [ - 32, + 37, 38, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 9, "line": 3, }, "start": Object { - "column": 16, + "column": 8, "line": 3, }, }, @@ -20921,151 +20597,151 @@ Object { 39, ], "type": "Punctuator", - "value": ";", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 4, + "column": 10, + "line": 3, }, "start": Object { - "column": 2, - "line": 4, + "column": 9, + "line": 3, }, }, "range": Array [ - 42, - 49, + 39, + 40, ], - "type": "Keyword", - "value": "private", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 4, + "column": 12, + "line": 3, }, "start": Object { - "column": 10, - "line": 4, + "column": 11, + "line": 3, }, }, "range": Array [ - 50, - 53, + 41, + 42, ], - "type": "Identifier", - "value": "baz", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { "column": 14, - "line": 4, + "line": 3, }, "start": Object { "column": 13, - "line": 4, + "line": 3, }, }, "range": Array [ - 53, - 54, + 43, + 44, ], "type": "Punctuator", - "value": "?", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 5, "line": 4, }, "start": Object { - "column": 14, + "column": 2, "line": 4, }, }, "range": Array [ - 54, - 55, + 47, + 50, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 6, "line": 4, }, "start": Object { - "column": 15, + "column": 5, "line": 4, }, }, "range": Array [ - 55, - 56, + 50, + 51, ], "type": "Punctuator", - "value": ")", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 7, "line": 4, }, "start": Object { - "column": 16, + "column": 6, "line": 4, }, }, "range": Array [ - 56, - 57, + 51, + 52, ], "type": "Punctuator", - "value": ":", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 9, "line": 4, }, "start": Object { - "column": 18, + "column": 8, "line": 4, }, }, "range": Array [ - 58, - 64, + 53, + 54, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 10, "line": 4, }, "start": Object { - "column": 24, + "column": 9, "line": 4, }, }, "range": Array [ - 64, - 65, + 54, + 55, ], "type": "Punctuator", - "value": ";", + "value": "}", }, Object { "loc": Object { @@ -21079,8 +20755,8 @@ Object { }, }, "range": Array [ - 66, - 67, + 56, + 57, ], "type": "Punctuator", "value": "}", @@ -21090,743 +20766,875 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-optional-properties.src 1`] = ` +exports[`typescript fixtures/basics/class-with-mixin.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "range": Array [ + 79, + 82, + ], + "type": "ClassBody", }, - "start": Object { - "column": 6, - "line": 1, + "id": null, + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 60, + 82, + ], + "superClass": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "name": "Base", + "range": Array [ + 74, + 78, + ], + "type": "Identifier", }, + "type": "ClassExpression", }, - "name": "computed", - "range": Array [ - 6, - 14, - ], - "type": "Identifier", - }, - "init": Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 33, + "line": 2, }, "start": Object { - "column": 17, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 17, - 23, + 53, + 82, ], - "raw": "'buzz'", - "type": "Literal", - "value": "buzz", + "type": "ReturnStatement", }, - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 47, + "line": 1, }, - "range": Array [ - 6, - 23, - ], - "type": "VariableDeclarator", }, - ], - "kind": "const", + "range": Array [ + 47, + 84, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "M", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { "column": 0, "line": 1, }, }, - "range": Array [ - 0, - 24, - ], - "type": "VariableDeclaration", - }, - Object { - "declarations": Array [ + "params": Array [ Object { - "id": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "name": "Base", + "range": Array [ + 38, + 45, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 45, + "line": 1, }, "start": Object { - "column": 6, - "line": 2, + "column": 42, + "line": 1, }, }, - "name": "computed2", - "range": Array [ - 31, - 40, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, - }, - }, - "range": Array [ - 43, - 49, - ], - "raw": "'bazz'", - "type": "Literal", - "value": "bazz", - }, - "loc": Object { - "end": Object { - "column": 24, - "line": 2, - }, - "start": Object { - "column": 6, - "line": 2, - }, - }, - "range": Array [ - 31, - 49, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 25, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 25, - 50, - ], - "type": "VariableDeclaration", - }, - Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 2, - "line": 4, - }, - }, - "name": "foo", - "range": Array [ - 65, - 68, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 4, - }, - "start": Object { - "column": 2, - "line": 4, - }, - }, - "optional": true, - "range": Array [ - 65, - 70, - ], - "static": false, - "type": "ClassProperty", - "value": null, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 5, - }, - "start": Object { - "column": 2, - "line": 5, - }, - }, - "name": "bar", - "range": Array [ - 73, - 76, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 5, - }, - "start": Object { - "column": 2, - "line": 5, - }, - }, - "optional": true, "range": Array [ - 73, - 87, + 42, + 45, ], - "static": false, - "type": "ClassProperty", + "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 15, - "line": 5, + "column": 45, + "line": 1, }, "start": Object { - "column": 7, - "line": 5, + "column": 44, + "line": 1, }, }, "range": Array [ - 78, - 86, + 44, + 45, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "type": "TSTypeReference", + "typeName": Object { "loc": Object { "end": Object { - "column": 15, - "line": 5, + "column": 45, + "line": 1, }, "start": Object { - "column": 9, - "line": 5, + "column": 44, + "line": 1, }, }, + "name": "T", "range": Array [ - 80, - 86, + 44, + 45, ], - "type": "TSStringKeyword", + "type": "Identifier", }, }, - "value": null, }, + }, + ], + "range": Array [ + 0, + 84, + ], + "type": "FunctionDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "params": Array [ Object { - "accessibility": "private", - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 6, - }, - "start": Object { - "column": 10, - "line": 6, - }, - }, - "name": "baz", - "range": Array [ - 98, - 101, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 24, - "line": 6, - }, - "start": Object { - "column": 2, - "line": 6, - }, - }, - "optional": true, - "range": Array [ - 90, - 112, - ], - "static": false, - "type": "ClassProperty", - "typeAnnotation": Object { + "constraint": Object { "loc": Object { "end": Object { - "column": 23, - "line": 6, + "column": 36, + "line": 1, }, "start": Object { - "column": 15, - "line": 6, + "column": 21, + "line": 1, }, }, "range": Array [ - 103, - 111, + 21, + 36, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "type": "TSTypeReference", + "typeName": Object { "loc": Object { "end": Object { - "column": 23, - "line": 6, + "column": 32, + "line": 1, }, "start": Object { - "column": 17, - "line": 6, + "column": 21, + "line": 1, }, }, + "name": "Constructor", "range": Array [ - 105, - 111, + 21, + 32, ], - "type": "TSStringKeyword", + "type": "Identifier", }, - }, - "value": null, - }, - Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 7, - }, - "start": Object { - "column": 3, - "line": 7, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "members": Array [], + "range": Array [ + 33, + 35, + ], + "type": "TSTypeLiteral", + }, + ], + "range": Array [ + 32, + 36, + ], + "type": "TSTypeParameterInstantiation", }, - "name": "computed", - "range": Array [ - 116, - 124, - ], - "type": "Identifier", }, "loc": Object { "end": Object { - "column": 14, - "line": 7, + "column": 36, + "line": 1, }, "start": Object { - "column": 2, - "line": 7, + "column": 11, + "line": 1, }, }, - "optional": true, - "range": Array [ - 115, - 127, - ], - "static": false, - "type": "ClassProperty", - "value": null, - }, - Object { - "computed": true, - "key": Object { + "name": Object { "loc": Object { "end": Object { "column": 12, - "line": 8, + "line": 1, }, "start": Object { - "column": 3, - "line": 8, + "column": 11, + "line": 1, }, }, + "name": "T", "range": Array [ - 131, - 140, + 11, + 12, ], - "raw": "'literal'", - "type": "Literal", - "value": "literal", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 8, - }, - "start": Object { - "column": 2, - "line": 8, - }, + "type": "Identifier", }, - "optional": true, "range": Array [ - 130, - 143, + 11, + 36, ], - "static": false, - "type": "ClassProperty", - "value": null, + "type": "TSTypeParameter", }, - Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 9, - }, - "start": Object { - "column": 3, - "line": 9, - }, - }, - "range": Array [ - 147, - 148, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, + ], + "range": Array [ + 10, + 37, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 42, + "line": 5, + }, + "start": Object { + "column": 39, + "line": 5, + }, + }, + "range": Array [ + 125, + 128, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "name": "X", + "range": Array [ + 92, + 93, + ], + "type": "Identifier", + }, + "implements": Array [ + Object { + "expression": Object { "loc": Object { "end": Object { - "column": 7, - "line": 9, + "column": 38, + "line": 5, }, "start": Object { - "column": 2, - "line": 9, + "column": 37, + "line": 5, }, }, - "optional": true, + "name": "I", "range": Array [ - 146, - 151, + 123, + 124, ], - "static": false, - "type": "ClassProperty", - "value": null, + "type": "Identifier", }, - Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 10, - }, - "start": Object { - "column": 3, - "line": 10, - }, - }, - "name": "computed2", - "range": Array [ - 155, - 164, - ], - "type": "Identifier", + "loc": Object { + "end": Object { + "column": 38, + "line": 5, + }, + "start": Object { + "column": 37, + "line": 5, }, + }, + "range": Array [ + 123, + 124, + ], + "type": "TSClassImplements", + }, + ], + "loc": Object { + "end": Object { + "column": 42, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 86, + 128, + ], + "superClass": Object { + "arguments": Array [ + Object { "loc": Object { "end": Object { - "column": 23, - "line": 10, + "column": 24, + "line": 5, }, "start": Object { - "column": 2, - "line": 10, + "column": 23, + "line": 5, }, }, - "optional": true, + "name": "C", "range": Array [ - 154, - 175, + 109, + 110, ], - "static": false, - "type": "ClassProperty", - "typeAnnotation": Object { + "type": "Identifier", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 5, + }, + }, + "name": "M", + "range": Array [ + 102, + 103, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 5, + }, + }, + "optional": false, + "range": Array [ + 102, + 111, + ], + "type": "CallExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 22, - "line": 10, + "column": 21, + "line": 5, }, "start": Object { - "column": 14, - "line": 10, + "column": 18, + "line": 5, }, }, "range": Array [ - 166, - 174, + 104, + 107, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 10, - }, - "start": Object { - "column": 16, - "line": 10, - }, - }, - "range": Array [ - 168, - 174, - ], - "type": "TSStringKeyword", - }, + "type": "TSAnyKeyword", }, - "value": null, + ], + "range": Array [ + 103, + 108, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + "type": "ClassDeclaration", + }, + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 11, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "range": Array [ + 138, + 141, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 6, + "line": 7, + }, + }, + "name": "C", + "range": Array [ + 136, + 137, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "range": Array [ + 130, + 141, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 15, + "line": 8, + }, + "start": Object { + "column": 12, + "line": 8, + }, + }, + "range": Array [ + 154, + 157, + ], + "type": "TSInterfaceBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 8, + }, + "start": Object { + "column": 10, + "line": 8, + }, + }, + "name": "I", + "range": Array [ + 152, + 153, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 8, + }, + }, + "range": Array [ + 142, + 157, + ], + "type": "TSInterfaceDeclaration", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 9, + }, + "start": Object { + "column": 5, + "line": 9, + }, + }, + "name": "Constructor", + "range": Array [ + 163, + 174, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 48, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + "range": Array [ + 158, + 206, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 9, + }, + "start": Object { + "column": 22, + "line": 9, }, + }, + "params": Array [ Object { - "computed": true, - "key": Object { + "argument": Object { "loc": Object { "end": Object { - "column": 13, - "line": 11, + "column": 34, + "line": 9, }, "start": Object { - "column": 3, - "line": 11, + "column": 30, + "line": 9, }, }, + "name": "args", "range": Array [ - 179, - 189, + 188, + 192, ], - "raw": "'literal2'", - "type": "Literal", - "value": "literal2", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 24, - "line": 11, + "column": 41, + "line": 9, }, "start": Object { - "column": 2, - "line": 11, + "column": 27, + "line": 9, }, }, - "optional": true, "range": Array [ - 178, - 200, + 185, + 199, ], - "static": false, - "type": "ClassProperty", + "type": "RestElement", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 23, - "line": 11, + "column": 41, + "line": 9, }, "start": Object { - "column": 15, - "line": 11, + "column": 34, + "line": 9, }, }, "range": Array [ - 191, + 192, 199, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { + "elementType": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 9, + }, + "start": Object { + "column": 36, + "line": 9, + }, + }, + "range": Array [ + 194, + 197, + ], + "type": "TSAnyKeyword", + }, "loc": Object { "end": Object { - "column": 23, - "line": 11, + "column": 41, + "line": 9, }, "start": Object { - "column": 17, - "line": 11, + "column": 36, + "line": 9, }, }, "range": Array [ - 193, + 194, 199, ], - "type": "TSStringKeyword", + "type": "TSArrayType", }, }, - "value": null, }, - Object { - "computed": true, - "key": Object { + ], + "range": Array [ + 180, + 205, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 9, + }, + "start": Object { + "column": 43, + "line": 9, + }, + }, + "range": Array [ + 201, + 205, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 9, + }, + "start": Object { + "column": 46, + "line": 9, + }, + }, + "range": Array [ + 204, + 205, + ], + "type": "TSTypeReference", + "typeName": Object { "loc": Object { "end": Object { - "column": 4, - "line": 12, + "column": 47, + "line": 9, }, "start": Object { - "column": 3, - "line": 12, + "column": 46, + "line": 9, }, }, + "name": "T", "range": Array [ 204, 205, ], - "raw": "2", - "type": "Literal", - "value": 2, + "type": "Identifier", }, + }, + }, + "type": "TSConstructorType", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 9, + }, + "start": Object { + "column": 16, + "line": 9, + }, + }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 15, - "line": 12, + "column": 18, + "line": 9, }, "start": Object { - "column": 2, - "line": 12, + "column": 17, + "line": 9, }, }, - "optional": true, - "range": Array [ - 203, - 216, - ], - "static": false, - "type": "ClassProperty", - "typeAnnotation": Object { + "name": Object { "loc": Object { "end": Object { - "column": 14, - "line": 12, + "column": 18, + "line": 9, }, "start": Object { - "column": 6, - "line": 12, + "column": 17, + "line": 9, }, }, + "name": "T", "range": Array [ - 207, - 215, + 175, + 176, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 12, - }, - "start": Object { - "column": 8, - "line": 12, - }, - }, - "range": Array [ - 209, - 215, - ], - "type": "TSStringKeyword", - }, + "type": "Identifier", }, - "value": null, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 13, - }, - "start": Object { - "column": 10, - "line": 3, + "range": Array [ + 175, + 176, + ], + "type": "TSTypeParameter", }, - }, - "range": Array [ - 61, - 218, ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "name": "Foo", "range": Array [ - 57, - 60, + 174, + 177, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 13, - }, - "start": Object { - "column": 0, - "line": 3, - }, + "type": "TSTypeParameterDeclaration", }, - "range": Array [ - 51, - 218, - ], - "superClass": null, - "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 14, + "line": 10, }, "start": Object { "column": 0, @@ -21835,14 +21643,14 @@ Object { }, "range": Array [ 0, - 219, + 207, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 8, "line": 1, }, "start": Object { @@ -21852,866 +21660,866 @@ Object { }, "range": Array [ 0, - 5, + 8, ], "type": "Keyword", - "value": "const", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 10, "line": 1, }, "start": Object { - "column": 6, + "column": 9, "line": 1, }, }, "range": Array [ - 6, - 14, + 9, + 10, ], "type": "Identifier", - "value": "computed", + "value": "M", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 11, "line": 1, }, "start": Object { - "column": 15, + "column": 10, "line": 1, }, }, "range": Array [ - 15, - 16, + 10, + 11, ], "type": "Punctuator", - "value": "=", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 12, "line": 1, }, "start": Object { - "column": 17, + "column": 11, "line": 1, }, }, "range": Array [ - 17, - 23, + 11, + 12, ], - "type": "String", - "value": "'buzz'", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 20, "line": 1, }, "start": Object { - "column": 23, + "column": 13, "line": 1, }, }, "range": Array [ - 23, - 24, + 13, + 20, ], - "type": "Punctuator", - "value": ";", + "type": "Keyword", + "value": "extends", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 32, + "line": 1, }, "start": Object { - "column": 0, - "line": 2, + "column": 21, + "line": 1, }, }, "range": Array [ - 25, - 30, + 21, + 32, ], - "type": "Keyword", - "value": "const", + "type": "Identifier", + "value": "Constructor", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 33, + "line": 1, }, "start": Object { - "column": 6, - "line": 2, + "column": 32, + "line": 1, }, }, "range": Array [ - 31, - 40, + 32, + 33, ], - "type": "Identifier", - "value": "computed2", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 34, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 33, + "line": 1, }, }, "range": Array [ - 41, - 42, + 33, + 34, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 2, + "column": 35, + "line": 1, }, "start": Object { - "column": 18, - "line": 2, + "column": 34, + "line": 1, }, }, "range": Array [ - 43, - 49, + 34, + 35, ], - "type": "String", - "value": "'bazz'", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 36, + "line": 1, }, "start": Object { - "column": 24, - "line": 2, + "column": 35, + "line": 1, }, }, "range": Array [ - 49, - 50, + 35, + 36, ], "type": "Punctuator", - "value": ";", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 37, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 36, + "line": 1, }, }, "range": Array [ - 51, - 56, + 36, + 37, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 3, + "column": 38, + "line": 1, }, "start": Object { - "column": 6, - "line": 3, + "column": 37, + "line": 1, }, }, "range": Array [ - 57, - 60, + 37, + 38, ], - "type": "Identifier", - "value": "Foo", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 3, + "column": 42, + "line": 1, }, "start": Object { - "column": 10, - "line": 3, + "column": 38, + "line": 1, }, }, "range": Array [ - 61, - 62, + 38, + 42, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "Base", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 43, + "line": 1, }, "start": Object { - "column": 2, - "line": 4, + "column": 42, + "line": 1, }, }, "range": Array [ - 65, - 68, + 42, + 43, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 4, + "column": 45, + "line": 1, }, "start": Object { - "column": 5, - "line": 4, + "column": 44, + "line": 1, }, }, "range": Array [ - 68, - 69, + 44, + 45, ], - "type": "Punctuator", - "value": "?", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 4, + "column": 46, + "line": 1, }, "start": Object { - "column": 6, - "line": 4, + "column": 45, + "line": 1, }, }, "range": Array [ - 69, - 70, + 45, + 46, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 5, + "column": 48, + "line": 1, }, "start": Object { - "column": 2, - "line": 5, + "column": 47, + "line": 1, }, }, "range": Array [ - 73, - 76, + 47, + 48, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 5, + "column": 10, + "line": 2, }, "start": Object { - "column": 5, - "line": 5, + "column": 4, + "line": 2, }, }, "range": Array [ - 76, - 77, + 53, + 59, ], - "type": "Punctuator", - "value": "?", + "type": "Keyword", + "value": "return", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 5, + "column": 16, + "line": 2, }, "start": Object { - "column": 7, - "line": 5, + "column": 11, + "line": 2, }, }, "range": Array [ - 78, - 79, + 60, + 65, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 5, + "column": 24, + "line": 2, }, "start": Object { - "column": 9, - "line": 5, + "column": 17, + "line": 2, }, }, "range": Array [ - 80, - 86, + 66, + 73, ], - "type": "Identifier", - "value": "string", + "type": "Keyword", + "value": "extends", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 5, + "column": 29, + "line": 2, }, "start": Object { - "column": 15, - "line": 5, + "column": 25, + "line": 2, }, }, "range": Array [ - 86, - 87, + 74, + 78, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "Base", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 6, + "column": 31, + "line": 2, }, "start": Object { - "column": 2, - "line": 6, + "column": 30, + "line": 2, }, }, "range": Array [ - 90, - 97, + 79, + 80, ], - "type": "Keyword", - "value": "private", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 6, + "column": 33, + "line": 2, }, "start": Object { - "column": 10, - "line": 6, + "column": 32, + "line": 2, }, }, "range": Array [ - 98, - 101, + 81, + 82, ], - "type": "Identifier", - "value": "baz", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 6, + "column": 1, + "line": 3, }, "start": Object { - "column": 13, - "line": 6, + "column": 0, + "line": 3, }, }, "range": Array [ - 101, - 102, + 83, + 84, ], "type": "Punctuator", - "value": "?", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 6, + "column": 5, + "line": 5, }, "start": Object { - "column": 15, - "line": 6, + "column": 0, + "line": 5, }, }, "range": Array [ - 103, - 104, + 86, + 91, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 6, + "column": 7, + "line": 5, }, "start": Object { - "column": 17, - "line": 6, + "column": 6, + "line": 5, }, }, "range": Array [ - 105, - 111, + 92, + 93, ], "type": "Identifier", - "value": "string", + "value": "X", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 6, + "column": 15, + "line": 5, }, "start": Object { - "column": 23, - "line": 6, + "column": 8, + "line": 5, }, }, "range": Array [ - 111, - 112, + 94, + 101, ], - "type": "Punctuator", - "value": ";", + "type": "Keyword", + "value": "extends", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 7, + "column": 17, + "line": 5, }, "start": Object { - "column": 2, - "line": 7, + "column": 16, + "line": 5, }, }, "range": Array [ - 115, - 116, + 102, + 103, ], - "type": "Punctuator", - "value": "[", + "type": "Identifier", + "value": "M", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 7, + "column": 18, + "line": 5, }, "start": Object { - "column": 3, - "line": 7, + "column": 17, + "line": 5, }, }, "range": Array [ - 116, - 124, + 103, + 104, ], - "type": "Identifier", - "value": "computed", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 7, + "column": 21, + "line": 5, }, "start": Object { - "column": 11, - "line": 7, + "column": 18, + "line": 5, }, }, "range": Array [ - 124, - 125, + 104, + 107, ], - "type": "Punctuator", - "value": "]", + "type": "Identifier", + "value": "any", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 7, + "column": 22, + "line": 5, }, "start": Object { - "column": 12, - "line": 7, + "column": 21, + "line": 5, }, }, "range": Array [ - 125, - 126, + 107, + 108, ], "type": "Punctuator", - "value": "?", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 7, + "column": 23, + "line": 5, }, "start": Object { - "column": 13, - "line": 7, + "column": 22, + "line": 5, }, }, "range": Array [ - 126, - 127, + 108, + 109, ], "type": "Punctuator", - "value": ";", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 8, + "column": 24, + "line": 5, }, "start": Object { - "column": 2, - "line": 8, + "column": 23, + "line": 5, }, }, "range": Array [ - 130, - 131, + 109, + 110, ], - "type": "Punctuator", - "value": "[", + "type": "Identifier", + "value": "C", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 8, + "column": 25, + "line": 5, }, "start": Object { - "column": 3, - "line": 8, + "column": 24, + "line": 5, }, }, "range": Array [ - 131, - 140, + 110, + 111, ], - "type": "String", - "value": "'literal'", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 8, + "column": 36, + "line": 5, }, "start": Object { - "column": 12, - "line": 8, + "column": 26, + "line": 5, }, }, "range": Array [ - 140, - 141, + 112, + 122, ], - "type": "Punctuator", - "value": "]", + "type": "Keyword", + "value": "implements", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 8, + "column": 38, + "line": 5, }, "start": Object { - "column": 13, - "line": 8, + "column": 37, + "line": 5, }, }, "range": Array [ - 141, - 142, + 123, + 124, ], - "type": "Punctuator", - "value": "?", + "type": "Identifier", + "value": "I", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 8, + "column": 40, + "line": 5, }, "start": Object { - "column": 14, - "line": 8, + "column": 39, + "line": 5, }, }, "range": Array [ - 142, - 143, + 125, + 126, ], "type": "Punctuator", - "value": ";", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 9, + "column": 42, + "line": 5, }, "start": Object { - "column": 2, - "line": 9, + "column": 41, + "line": 5, }, }, "range": Array [ - 146, - 147, + 127, + 128, ], "type": "Punctuator", - "value": "[", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 9, + "column": 5, + "line": 7, }, "start": Object { - "column": 3, - "line": 9, + "column": 0, + "line": 7, }, }, "range": Array [ - 147, - 148, + 130, + 135, ], - "type": "Numeric", - "value": "1", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 9, + "column": 7, + "line": 7, }, "start": Object { - "column": 4, - "line": 9, + "column": 6, + "line": 7, }, }, "range": Array [ - 148, - 149, + 136, + 137, ], - "type": "Punctuator", - "value": "]", + "type": "Identifier", + "value": "C", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 9, + "column": 9, + "line": 7, }, "start": Object { - "column": 5, - "line": 9, + "column": 8, + "line": 7, }, }, "range": Array [ - 149, - 150, + 138, + 139, ], "type": "Punctuator", - "value": "?", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 9, + "column": 11, + "line": 7, }, "start": Object { - "column": 6, - "line": 9, + "column": 10, + "line": 7, }, }, "range": Array [ - 150, - 151, + 140, + 141, ], "type": "Punctuator", - "value": ";", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 10, + "column": 9, + "line": 8, }, "start": Object { - "column": 2, - "line": 10, + "column": 0, + "line": 8, }, }, "range": Array [ - 154, - 155, + 142, + 151, ], - "type": "Punctuator", - "value": "[", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 10, + "column": 11, + "line": 8, }, "start": Object { - "column": 3, - "line": 10, + "column": 10, + "line": 8, }, }, "range": Array [ - 155, - 164, + 152, + 153, ], "type": "Identifier", - "value": "computed2", + "value": "I", }, Object { "loc": Object { "end": Object { "column": 13, - "line": 10, + "line": 8, }, "start": Object { "column": 12, - "line": 10, + "line": 8, }, }, "range": Array [ - 164, - 165, + 154, + 155, ], "type": "Punctuator", - "value": "]", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 10, + "column": 15, + "line": 8, }, "start": Object { - "column": 13, - "line": 10, + "column": 14, + "line": 8, }, }, "range": Array [ - 165, - 166, + 156, + 157, ], "type": "Punctuator", - "value": "?", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 10, + "column": 4, + "line": 9, }, "start": Object { - "column": 14, - "line": 10, + "column": 0, + "line": 9, }, }, "range": Array [ - 166, - 167, + 158, + 162, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 10, + "column": 16, + "line": 9, }, "start": Object { - "column": 16, - "line": 10, + "column": 5, + "line": 9, }, }, "range": Array [ - 168, + 163, 174, ], "type": "Identifier", - "value": "string", + "value": "Constructor", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 10, + "column": 17, + "line": 9, }, "start": Object { - "column": 22, - "line": 10, + "column": 16, + "line": 9, }, }, "range": Array [ @@ -22719,403 +22527,562 @@ Object { 175, ], "type": "Punctuator", - "value": ";", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 11, + "column": 18, + "line": 9, }, "start": Object { - "column": 2, - "line": 11, + "column": 17, + "line": 9, }, }, "range": Array [ - 178, - 179, + 175, + 176, ], - "type": "Punctuator", - "value": "[", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 11, + "column": 19, + "line": 9, }, "start": Object { - "column": 3, - "line": 11, + "column": 18, + "line": 9, }, }, "range": Array [ - 179, - 189, + 176, + 177, ], - "type": "String", - "value": "'literal2'", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 11, + "column": 21, + "line": 9, }, "start": Object { - "column": 13, - "line": 11, + "column": 20, + "line": 9, }, }, "range": Array [ - 189, - 190, + 178, + 179, ], "type": "Punctuator", - "value": "]", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 11, + "column": 25, + "line": 9, }, "start": Object { - "column": 14, - "line": 11, + "column": 22, + "line": 9, }, }, "range": Array [ - 190, - 191, + 180, + 183, ], - "type": "Punctuator", - "value": "?", + "type": "Keyword", + "value": "new", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 11, + "column": 27, + "line": 9, }, "start": Object { - "column": 15, - "line": 11, + "column": 26, + "line": 9, }, }, "range": Array [ - 191, - 192, + 184, + 185, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 11, + "column": 30, + "line": 9, }, "start": Object { - "column": 17, - "line": 11, + "column": 27, + "line": 9, }, }, "range": Array [ - 193, - 199, + 185, + 188, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 11, + "column": 34, + "line": 9, }, "start": Object { - "column": 23, - "line": 11, + "column": 30, + "line": 9, }, }, "range": Array [ - 199, - 200, + 188, + 192, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "args", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 12, + "column": 35, + "line": 9, }, "start": Object { - "column": 2, - "line": 12, + "column": 34, + "line": 9, }, }, "range": Array [ - 203, - 204, + 192, + 193, ], "type": "Punctuator", - "value": "[", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 12, + "column": 39, + "line": 9, }, "start": Object { - "column": 3, - "line": 12, + "column": 36, + "line": 9, }, }, "range": Array [ - 204, - 205, + 194, + 197, ], - "type": "Numeric", - "value": "2", + "type": "Identifier", + "value": "any", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 12, + "column": 40, + "line": 9, }, "start": Object { - "column": 4, - "line": 12, + "column": 39, + "line": 9, }, }, "range": Array [ - 205, - 206, + 197, + 198, ], "type": "Punctuator", - "value": "]", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 12, + "column": 41, + "line": 9, }, "start": Object { - "column": 5, - "line": 12, + "column": 40, + "line": 9, }, }, "range": Array [ - 206, - 207, + 198, + 199, ], "type": "Punctuator", - "value": "?", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 12, + "column": 42, + "line": 9, }, "start": Object { - "column": 6, - "line": 12, + "column": 41, + "line": 9, }, }, "range": Array [ - 207, - 208, + 199, + 200, ], "type": "Punctuator", - "value": ":", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 12, + "column": 45, + "line": 9, }, "start": Object { - "column": 8, - "line": 12, + "column": 43, + "line": 9, }, }, "range": Array [ - 209, - 215, + 201, + 203, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 12, + "column": 47, + "line": 9, }, "start": Object { - "column": 14, - "line": 12, + "column": 46, + "line": 9, }, }, "range": Array [ - 215, - 216, + 204, + 205, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 13, + "column": 48, + "line": 9, }, "start": Object { - "column": 0, - "line": 13, + "column": 47, + "line": 9, }, }, "range": Array [ - 217, - 218, + 205, + 206, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/class-with-optional-property-undefined.src 1`] = ` +exports[`typescript fixtures/basics/class-with-mixin-reference.src 1`] = ` Object { "body": Array [ Object { + "async": false, "body": Object { - "body": Array [ - Object { - "accessibility": "private", - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 20, - 23, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 27, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "optional": true, - "range": Array [ - 12, - 37, - ], - "static": false, - "type": "ClassProperty", - "value": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "name": "undefined", - "range": Array [ - 27, - 36, - ], - "type": "Identifier", - }, - }, - ], + "body": Array [], "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 2, }, "start": Object { - "column": 8, + "column": 46, "line": 1, }, }, "range": Array [ - 8, - 39, + 46, + 49, ], - "type": "ClassBody", + "type": "BlockStatement", }, + "expression": false, + "generator": false, "id": Object { "loc": Object { "end": Object { - "column": 7, + "column": 10, "line": 1, }, "start": Object { - "column": 6, + "column": 9, "line": 1, }, }, - "name": "X", + "name": "M", "range": Array [ - 6, - 7, - ], + 9, + 10, + ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 2, }, "start": Object { "column": 0, "line": 1, }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "name": "Base", + "range": Array [ + 37, + 44, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 44, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + }, + }, + }, + }, + ], "range": Array [ 0, - 39, + 49, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "FunctionDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "params": Array [ + Object { + "constraint": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 35, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "Constructor", + "range": Array [ + 21, + 32, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "name": "M", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 32, + 35, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "range": Array [ + 11, + 35, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 10, + 36, + ], + "type": "TSTypeParameterDeclaration", + }, }, ], "loc": Object { "end": Object { "column": 0, - "line": 5, + "line": 3, }, "start": Object { "column": 0, @@ -23124,14 +23091,14 @@ Object { }, "range": Array [ 0, - 41, + 50, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 8, "line": 1, }, "start": Object { @@ -23141,146 +23108,182 @@ Object { }, "range": Array [ 0, - 5, + 8, ], "type": "Keyword", - "value": "class", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 10, "line": 1, }, "start": Object { - "column": 6, + "column": 9, "line": 1, }, }, "range": Array [ - 6, - 7, + 9, + 10, ], "type": "Identifier", - "value": "X", + "value": "M", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 11, "line": 1, }, "start": Object { - "column": 8, + "column": 10, "line": 1, }, }, "range": Array [ - 8, - 9, + 10, + 11, ], "type": "Punctuator", - "value": "{", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 12, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 11, + "line": 1, }, }, "range": Array [ + 11, 12, - 19, ], - "type": "Keyword", - "value": "private", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 2, + "column": 20, + "line": 1, }, "start": Object { - "column": 10, - "line": 2, + "column": 13, + "line": 1, }, }, "range": Array [ + 13, 20, - 23, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 32, ], "type": "Identifier", - "value": "foo", + "value": "Constructor", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 33, + "line": 1, }, "start": Object { - "column": 13, - "line": 2, + "column": 32, + "line": 1, }, }, "range": Array [ - 23, - 24, + 32, + 33, ], "type": "Punctuator", - "value": "?", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 34, + "line": 1, }, "start": Object { - "column": 15, - "line": 2, + "column": 33, + "line": 1, }, }, "range": Array [ - 25, - 26, + 33, + 34, + ], + "type": "Identifier", + "value": "M", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, ], "type": "Punctuator", - "value": "=", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 2, + "column": 36, + "line": 1, }, "start": Object { - "column": 17, - "line": 2, + "column": 35, + "line": 1, }, }, "range": Array [ - 27, + 35, 36, ], - "type": "Keyword", - "value": "undefined", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 2, + "column": 37, + "line": 1, }, "start": Object { - "column": 26, - "line": 2, + "column": 36, + "line": 1, }, }, "range": Array [ @@ -23288,22 +23291,112 @@ Object { 37, ], "type": "Punctuator", - "value": ";", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 41, + ], + "type": "Identifier", + "value": "Base", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 46, + "line": 1, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 2, }, "start": Object { "column": 0, - "line": 3, + "line": 2, }, }, "range": Array [ - 38, - 39, + 48, + 49, ], "type": "Punctuator", "value": "}", @@ -23313,466 +23406,92 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-private-parameter-properties.src 1`] = ` +exports[`typescript fixtures/basics/class-with-optional-computed-property.src 1`] = ` Object { "body": Array [ Object { "body": Object { "body": Array [ Object { - "computed": false, + "accessibility": "private", + "computed": true, + "declare": false, "key": Object { "loc": Object { "end": Object { - "column": 13, + "column": 18, "line": 2, }, "start": Object { - "column": 2, + "column": 13, "line": 2, }, }, - "name": "constructor", "range": Array [ - 14, - 25, + 23, + 28, ], - "type": "Identifier", + "raw": "'foo'", + "type": "Literal", + "value": "foo", }, - "kind": "constructor", "loc": Object { "end": Object { - "column": 59, - "line": 5, + "column": 33, + "line": 2, }, "start": Object { - "column": 2, + "column": 4, "line": 2, }, }, + "optional": true, "range": Array [ 14, - 201, + 43, ], "static": false, - "type": "MethodDefinition", + "type": "ClassProperty", "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 59, - "line": 5, - }, - "start": Object { - "column": 57, - "line": 5, - }, - }, - "range": Array [ - 199, - 201, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, "loc": Object { "end": Object { - "column": 59, - "line": 5, + "column": 32, + "line": 2, }, "start": Object { - "column": 13, + "column": 23, "line": 2, }, }, - "params": Array [ - Object { - "accessibility": "private", - "loc": Object { - "end": Object { - "column": 39, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "parameter": Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 2, - }, - "start": Object { - "column": 22, - "line": 2, - }, - }, - "name": "firstName", - "range": Array [ - 34, - 51, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 2, - }, - "start": Object { - "column": 31, - "line": 2, - }, - }, - "range": Array [ - 43, - 51, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 2, - }, - "start": Object { - "column": 33, - "line": 2, - }, - }, - "range": Array [ - 45, - 51, - ], - "type": "TSStringKeyword", - }, - }, - }, - "range": Array [ - 26, - 51, - ], - "type": "TSParameterProperty", - }, - Object { - "accessibility": "private", - "loc": Object { - "end": Object { - "column": 47, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "parameter": Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 3, - }, - "start": Object { - "column": 31, - "line": 3, - }, - }, - "name": "lastName", - "range": Array [ - 84, - 100, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 3, - }, - "start": Object { - "column": 39, - "line": 3, - }, - }, - "range": Array [ - 92, - 100, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 3, - }, - "start": Object { - "column": 41, - "line": 3, - }, - }, - "range": Array [ - 94, - 100, - ], - "type": "TSStringKeyword", - }, - }, - }, - "range": Array [ - 67, - 100, - ], - "readonly": true, - "type": "TSParameterProperty", - }, - Object { - "accessibility": "private", - "loc": Object { - "end": Object { - "column": 38, - "line": 4, - }, - "start": Object { - "column": 14, - "line": 4, - }, - }, - "parameter": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 4, - }, - "start": Object { - "column": 22, - "line": 4, - }, - }, - "name": "age", - "range": Array [ - 124, - 135, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 4, - }, - "start": Object { - "column": 25, - "line": 4, - }, - }, - "range": Array [ - 127, - 135, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 4, - }, - "start": Object { - "column": 27, - "line": 4, - }, - }, - "range": Array [ - 129, - 135, - ], - "type": "TSNumberKeyword", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 38, - "line": 4, - }, - "start": Object { - "column": 22, - "line": 4, - }, - }, - "range": Array [ - 124, - 140, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 4, - }, - "start": Object { - "column": 36, - "line": 4, - }, - }, - "range": Array [ - 138, - 140, - ], - "raw": "30", - "type": "Literal", - "value": 30, - }, - "type": "AssignmentPattern", - }, - "range": Array [ - 116, - 140, - ], - "type": "TSParameterProperty", - }, - Object { - "accessibility": "private", - "loc": Object { - "end": Object { - "column": 55, - "line": 5, - }, - "start": Object { - "column": 14, - "line": 5, - }, - }, - "parameter": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 5, - }, - "start": Object { - "column": 31, - "line": 5, - }, - }, - "name": "student", - "range": Array [ - 173, - 189, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 5, - }, - "start": Object { - "column": 38, - "line": 5, - }, - }, - "range": Array [ - 180, - 189, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 5, - }, - "start": Object { - "column": 40, - "line": 5, - }, - }, - "range": Array [ - 182, - 189, - ], - "type": "TSBooleanKeyword", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 55, - "line": 5, - }, - "start": Object { - "column": 31, - "line": 5, - }, - }, - "range": Array [ - 173, - 197, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 55, - "line": 5, - }, - "start": Object { - "column": 50, - "line": 5, - }, - }, - "range": Array [ - 192, - 197, - ], - "raw": "false", - "type": "Literal", - "value": false, - }, - "type": "AssignmentPattern", - }, - "range": Array [ - 156, - 197, - ], - "readonly": true, - "type": "TSParameterProperty", - }, - ], + "name": "undefined", "range": Array [ - 25, - 201, + 33, + 42, ], - "type": "FunctionExpression", + "type": "Identifier", }, }, ], "loc": Object { "end": Object { "column": 1, - "line": 6, + "line": 3, }, "start": Object { - "column": 10, + "column": 8, "line": 1, }, }, "range": Array [ - 10, - 203, + 8, + 45, ], "type": "ClassBody", }, "id": Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { @@ -23780,17 +23499,17 @@ Object { "line": 1, }, }, - "name": "Foo", + "name": "X", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 6, + "line": 3, }, "start": Object { "column": 0, @@ -23799,7 +23518,7 @@ Object { }, "range": Array [ 0, - 203, + 45, ], "superClass": null, "type": "ClassDeclaration", @@ -23807,8 +23526,8 @@ Object { ], "loc": Object { "end": Object { - "column": 1, - "line": 6, + "column": 0, + "line": 4, }, "start": Object { "column": 0, @@ -23817,7 +23536,7 @@ Object { }, "range": Array [ 0, - 203, + 46, ], "sourceType": "script", "tokens": Array [ @@ -23842,7 +23561,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { @@ -23852,25 +23571,25 @@ Object { }, "range": Array [ 6, - 9, + 7, ], "type": "Identifier", - "value": "Foo", + "value": "X", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 9, "line": 1, }, "start": Object { - "column": 10, + "column": 8, "line": 1, }, }, "range": Array [ - 10, - 11, + 8, + 9, ], "type": "Punctuator", "value": "{", @@ -23878,557 +23597,161 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 11, "line": 2, }, "start": Object { - "column": 2, + "column": 4, "line": 2, }, }, "range": Array [ 14, - 25, + 21, ], - "type": "Identifier", - "value": "constructor", + "type": "Keyword", + "value": "private", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 13, "line": 2, }, "start": Object { - "column": 13, + "column": 12, "line": 2, }, }, "range": Array [ - 25, - 26, + 22, + 23, ], "type": "Punctuator", - "value": "(", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 18, "line": 2, }, "start": Object { - "column": 14, + "column": 13, "line": 2, }, }, "range": Array [ - 26, - 33, + 23, + 28, ], - "type": "Keyword", - "value": "private", + "type": "String", + "value": "'foo'", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 19, "line": 2, }, "start": Object { - "column": 22, + "column": 18, "line": 2, }, }, "range": Array [ - 34, - 43, + 28, + 29, ], - "type": "Identifier", - "value": "firstName", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 20, "line": 2, }, "start": Object { - "column": 31, + "column": 19, "line": 2, }, }, "range": Array [ - 43, - 44, + 29, + 30, ], "type": "Punctuator", - "value": ":", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 39, + "column": 22, "line": 2, }, "start": Object { - "column": 33, + "column": 21, "line": 2, }, }, "range": Array [ - 45, - 51, + 31, + 32, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 40, + "column": 32, "line": 2, }, "start": Object { - "column": 39, + "column": 23, "line": 2, }, }, "range": Array [ - 51, - 52, + 33, + 42, ], - "type": "Punctuator", - "value": ",", + "type": "Keyword", + "value": "undefined", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 3, + "column": 33, + "line": 2, }, "start": Object { - "column": 14, - "line": 3, + "column": 32, + "line": 2, }, }, "range": Array [ - 67, - 74, + 42, + 43, ], - "type": "Keyword", - "value": "private", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 1, "line": 3, }, "start": Object { - "column": 22, + "column": 0, "line": 3, }, }, "range": Array [ - 75, - 83, - ], - "type": "Identifier", - "value": "readonly", - }, - Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 3, - }, - "start": Object { - "column": 31, - "line": 3, - }, - }, - "range": Array [ - 84, - 92, - ], - "type": "Identifier", - "value": "lastName", - }, - Object { - "loc": Object { - "end": Object { - "column": 40, - "line": 3, - }, - "start": Object { - "column": 39, - "line": 3, - }, - }, - "range": Array [ - 92, - 93, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 3, - }, - "start": Object { - "column": 41, - "line": 3, - }, - }, - "range": Array [ - 94, - 100, - ], - "type": "Identifier", - "value": "string", - }, - Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 3, - }, - "start": Object { - "column": 47, - "line": 3, - }, - }, - "range": Array [ - 100, - 101, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 4, - }, - "start": Object { - "column": 14, - "line": 4, - }, - }, - "range": Array [ - 116, - 123, - ], - "type": "Keyword", - "value": "private", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 4, - }, - "start": Object { - "column": 22, - "line": 4, - }, - }, - "range": Array [ - 124, - 127, - ], - "type": "Identifier", - "value": "age", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 4, - }, - "start": Object { - "column": 25, - "line": 4, - }, - }, - "range": Array [ - 127, - 128, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 4, - }, - "start": Object { - "column": 27, - "line": 4, - }, - }, - "range": Array [ - 129, - 135, - ], - "type": "Identifier", - "value": "number", - }, - Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 4, - }, - "start": Object { - "column": 34, - "line": 4, - }, - }, - "range": Array [ - 136, - 137, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 4, - }, - "start": Object { - "column": 36, - "line": 4, - }, - }, - "range": Array [ - 138, - 140, - ], - "type": "Numeric", - "value": "30", - }, - Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 4, - }, - "start": Object { - "column": 38, - "line": 4, - }, - }, - "range": Array [ - 140, - 141, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 5, - }, - "start": Object { - "column": 14, - "line": 5, - }, - }, - "range": Array [ - 156, - 163, - ], - "type": "Keyword", - "value": "private", - }, - Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 5, - }, - "start": Object { - "column": 22, - "line": 5, - }, - }, - "range": Array [ - 164, - 172, - ], - "type": "Identifier", - "value": "readonly", - }, - Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 5, - }, - "start": Object { - "column": 31, - "line": 5, - }, - }, - "range": Array [ - 173, - 180, - ], - "type": "Identifier", - "value": "student", - }, - Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 5, - }, - "start": Object { - "column": 38, - "line": 5, - }, - }, - "range": Array [ - 180, - 181, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 5, - }, - "start": Object { - "column": 40, - "line": 5, - }, - }, - "range": Array [ - 182, - 189, - ], - "type": "Identifier", - "value": "boolean", - }, - Object { - "loc": Object { - "end": Object { - "column": 49, - "line": 5, - }, - "start": Object { - "column": 48, - "line": 5, - }, - }, - "range": Array [ - 190, - 191, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 55, - "line": 5, - }, - "start": Object { - "column": 50, - "line": 5, - }, - }, - "range": Array [ - 192, - 197, - ], - "type": "Boolean", - "value": "false", - }, - Object { - "loc": Object { - "end": Object { - "column": 56, - "line": 5, - }, - "start": Object { - "column": 55, - "line": 5, - }, - }, - "range": Array [ - 197, - 198, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 58, - "line": 5, - }, - "start": Object { - "column": 57, - "line": 5, - }, - }, - "range": Array [ - 199, - 200, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 59, - "line": 5, - }, - "start": Object { - "column": 58, - "line": 5, - }, - }, - "range": Array [ - 200, - 201, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 6, - }, - "start": Object { - "column": 0, - "line": 6, - }, - }, - "range": Array [ - 202, - 203, + 44, + 45, ], "type": "Punctuator", "value": "}", @@ -24438,7 +23761,7 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-property-function.src 1`] = ` +exports[`typescript fixtures/basics/class-with-optional-methods.src 1`] = ` Object { "body": Array [ Object { @@ -24458,15 +23781,17 @@ Object { }, }, "name": "foo", + "optional": true, "range": Array [ 14, 17, ], "type": "Identifier", }, + "kind": "method", "loc": Object { "end": Object { - "column": 43, + "column": 9, "line": 2, }, "start": Object { @@ -24476,271 +23801,232 @@ Object { }, "range": Array [ 14, - 55, + 21, ], "static": false, - "type": "ClassProperty", - "typeAnnotation": Object { + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": null, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 20, + "column": 9, "line": 2, }, "start": Object { - "column": 5, + "column": 6, "line": 2, }, }, + "params": Array [], "range": Array [ - 17, - 32, + 18, + 21, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 7, - "line": 2, - }, + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, }, - "params": Array [], - "range": Array [ - 19, - 32, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 22, - 32, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "range": Array [ - 25, - 32, - ], - "type": "TSBooleanKeyword", - }, + "start": Object { + "column": 2, + "line": 3, }, - "type": "TSFunctionType", + }, + "name": "bar", + "optional": true, + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, }, }, + "range": Array [ + 24, + 39, + ], + "static": false, + "type": "MethodDefinition", "value": Object { "async": false, - "body": Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 2, - }, - "start": Object { - "column": 38, - "line": 2, - }, - }, - "range": Array [ - 50, - 54, - ], - "raw": "true", - "type": "Literal", - "value": true, - }, - "expression": true, + "body": null, + "expression": false, "generator": false, "id": null, "loc": Object { "end": Object { - "column": 42, - "line": 2, + "column": 17, + "line": 3, }, "start": Object { - "column": 23, - "line": 2, + "column": 6, + "line": 3, }, }, "params": Array [], "range": Array [ - 35, - 54, + 28, + 39, ], "returnType": Object { "loc": Object { "end": Object { - "column": 34, - "line": 2, + "column": 16, + "line": 3, }, "start": Object { - "column": 25, - "line": 2, + "column": 8, + "line": 3, }, }, "range": Array [ - 37, - 46, + 30, + 38, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 34, - "line": 2, + "column": 16, + "line": 3, }, "start": Object { - "column": 27, - "line": 2, + "column": 10, + "line": 3, }, }, "range": Array [ - 39, - 46, + 32, + 38, ], - "type": "TSBooleanKeyword", + "type": "TSStringKeyword", }, }, - "type": "ArrowFunctionExpression", + "type": "FunctionExpression", }, }, Object { + "accessibility": "private", "computed": false, "key": Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 13, + "line": 4, }, "start": Object { - "column": 2, - "line": 3, + "column": 10, + "line": 4, }, }, - "name": "bar", + "name": "baz", + "optional": true, "range": Array [ - 58, - 61, + 50, + 53, ], "type": "Identifier", }, + "kind": "method", "loc": Object { "end": Object { - "column": 27, - "line": 3, + "column": 25, + "line": 4, }, "start": Object { "column": 2, - "line": 3, + "line": 4, }, }, "range": Array [ - 58, - 83, + 42, + 65, ], "static": false, - "type": "ClassProperty", - "typeAnnotation": Object { + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": null, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 13, - "line": 3, + "column": 25, + "line": 4, }, "start": Object { - "column": 5, - "line": 3, + "column": 14, + "line": 4, }, }, + "params": Array [], "range": Array [ - 61, - 69, + 54, + 65, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { - "column": 13, - "line": 3, + "column": 24, + "line": 4, }, "start": Object { - "column": 7, - "line": 3, + "column": 16, + "line": 4, }, }, "range": Array [ - 63, - 69, + 56, + 64, ], - "type": "TSStringKeyword", - }, - }, - "value": Object { - "async": false, - "body": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 3, - }, - "start": Object { - "column": 22, - "line": 3, + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, }, - }, - "name": "test", - "range": Array [ - 78, - 82, - ], - "type": "Identifier", - }, - "expression": true, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 26, - "line": 3, - }, - "start": Object { - "column": 16, - "line": 3, + "range": Array [ + 58, + 64, + ], + "type": "TSStringKeyword", }, }, - "params": Array [], - "range": Array [ - 72, - 82, - ], - "type": "ArrowFunctionExpression", + "type": "FunctionExpression", }, }, ], "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 5, }, "start": Object { "column": 10, @@ -24749,7 +24035,7 @@ Object { }, "range": Array [ 10, - 85, + 67, ], "type": "ClassBody", }, @@ -24774,7 +24060,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 5, }, "start": Object { "column": 0, @@ -24783,7 +24069,7 @@ Object { }, "range": Array [ 0, - 85, + 67, ], "superClass": null, "type": "ClassDeclaration", @@ -24792,7 +24078,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 5, + "line": 6, }, "start": Object { "column": 0, @@ -24801,7 +24087,7 @@ Object { }, "range": Array [ 0, - 86, + 68, ], "sourceType": "script", "tokens": Array [ @@ -24893,22 +24179,22 @@ Object { 18, ], "type": "Punctuator", - "value": ":", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 7, "line": 2, }, "start": Object { - "column": 7, + "column": 6, "line": 2, }, }, "range": Array [ + 18, 19, - 20, ], "type": "Punctuator", "value": "(", @@ -24916,17 +24202,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 8, "line": 2, }, "start": Object { - "column": 8, + "column": 7, "line": 2, }, }, "range": Array [ + 19, 20, - 21, ], "type": "Punctuator", "value": ")", @@ -24934,71 +24220,71 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 9, "line": 2, }, "start": Object { - "column": 10, + "column": 8, "line": 2, }, }, "range": Array [ - 22, - 24, + 20, + 21, ], "type": "Punctuator", - "value": "=>", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 5, + "line": 3, }, "start": Object { - "column": 13, - "line": 2, + "column": 2, + "line": 3, }, }, "range": Array [ - 25, - 32, + 24, + 27, ], "type": "Identifier", - "value": "boolean", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 6, + "line": 3, }, "start": Object { - "column": 21, - "line": 2, + "column": 5, + "line": 3, }, }, "range": Array [ - 33, - 34, + 27, + 28, ], "type": "Punctuator", - "value": "=", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 2, + "column": 7, + "line": 3, }, "start": Object { - "column": 23, - "line": 2, + "column": 6, + "line": 3, }, }, "range": Array [ - 35, - 36, + 28, + 29, ], "type": "Punctuator", "value": "(", @@ -25006,17 +24292,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 8, + "line": 3, }, "start": Object { - "column": 24, - "line": 2, + "column": 7, + "line": 3, }, }, "range": Array [ - 36, - 37, + 29, + 30, ], "type": "Punctuator", "value": ")", @@ -25024,17 +24310,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 26, - "line": 2, + "column": 9, + "line": 3, }, "start": Object { - "column": 25, - "line": 2, + "column": 8, + "line": 3, }, }, "range": Array [ - 37, - 38, + 30, + 31, ], "type": "Punctuator", "value": ":", @@ -25042,71 +24328,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 34, - "line": 2, + "column": 16, + "line": 3, }, "start": Object { - "column": 27, - "line": 2, + "column": 10, + "line": 3, }, }, "range": Array [ - 39, - 46, + 32, + 38, ], "type": "Identifier", - "value": "boolean", - }, - Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 2, - }, - "start": Object { - "column": 35, - "line": 2, - }, - }, - "range": Array [ - 47, - 49, - ], - "type": "Punctuator", - "value": "=>", - }, - Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 2, - }, - "start": Object { - "column": 38, - "line": 2, - }, - }, - "range": Array [ - 50, - 54, - ], - "type": "Boolean", - "value": "true", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 43, - "line": 2, + "column": 17, + "line": 3, }, "start": Object { - "column": 42, - "line": 2, + "column": 16, + "line": 3, }, }, "range": Array [ - 54, - 55, + 38, + 39, ], "type": "Punctuator", "value": ";", @@ -25114,89 +24364,71 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 9, + "line": 4, }, "start": Object { "column": 2, - "line": 3, - }, - }, - "range": Array [ - 58, - 61, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 3, - }, - "start": Object { - "column": 5, - "line": 3, + "line": 4, }, }, "range": Array [ - 61, - 62, + 42, + 49, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "private", }, Object { "loc": Object { "end": Object { "column": 13, - "line": 3, + "line": 4, }, "start": Object { - "column": 7, - "line": 3, + "column": 10, + "line": 4, }, }, "range": Array [ - 63, - 69, + 50, + 53, ], "type": "Identifier", - "value": "string", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 14, + "line": 4, }, "start": Object { - "column": 14, - "line": 3, + "column": 13, + "line": 4, }, }, "range": Array [ - 70, - 71, + 53, + 54, ], "type": "Punctuator", - "value": "=", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 3, + "column": 15, + "line": 4, }, "start": Object { - "column": 16, - "line": 3, + "column": 14, + "line": 4, }, }, "range": Array [ - 72, - 73, + 54, + 55, ], "type": "Punctuator", "value": "(", @@ -25204,17 +24436,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, - "line": 3, + "column": 16, + "line": 4, }, "start": Object { - "column": 17, - "line": 3, + "column": 15, + "line": 4, }, }, "range": Array [ - 73, - 74, + 55, + 56, ], "type": "Punctuator", "value": ")", @@ -25222,53 +24454,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, - "line": 3, + "column": 17, + "line": 4, }, "start": Object { - "column": 19, - "line": 3, + "column": 16, + "line": 4, }, }, "range": Array [ - 75, - 77, + 56, + 57, ], "type": "Punctuator", - "value": "=>", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 3, + "column": 24, + "line": 4, }, "start": Object { - "column": 22, - "line": 3, + "column": 18, + "line": 4, }, }, "range": Array [ - 78, - 82, + 58, + 64, ], "type": "Identifier", - "value": "test", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 3, + "column": 25, + "line": 4, }, "start": Object { - "column": 26, - "line": 3, + "column": 24, + "line": 4, }, }, "range": Array [ - 82, - 83, + 64, + 65, ], "type": "Punctuator", "value": ";", @@ -25277,16 +24509,16 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 5, }, "start": Object { "column": 0, - "line": 4, + "line": 5, }, }, "range": Array [ - 84, - 85, + 66, + 67, ], "type": "Punctuator", "value": "}", @@ -25296,396 +24528,709 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-property-values.src 1`] = ` +exports[`typescript fixtures/basics/class-with-optional-properties.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "name": "a", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 14, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 6, + "line": 1, }, }, + "name": "computed", "range": Array [ + 6, 14, - 20, ], - "static": false, - "type": "ClassProperty", - "value": Object { + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 23, + ], + "raw": "'buzz'", + "type": "Literal", + "value": "buzz", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 23, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "name": "computed2", + "range": Array [ + 31, + 40, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 43, + 49, + ], + "raw": "'bazz'", + "type": "Literal", + "value": "bazz", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 31, + 49, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 25, + 50, + ], + "type": "VariableDeclaration", + }, + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "declare": false, + "key": Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 5, + "line": 4, }, "start": Object { - "column": 6, - "line": 2, + "column": 2, + "line": 4, }, }, + "name": "foo", "range": Array [ - 18, - 19, + 65, + 68, ], - "raw": "2", - "type": "Literal", - "value": 2, + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, }, + "optional": true, + "range": Array [ + 65, + 70, + ], + "static": false, + "type": "ClassProperty", + "value": null, }, Object { "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { - "column": 3, - "line": 3, + "column": 5, + "line": 5, }, "start": Object { "column": 2, - "line": 3, + "line": 5, }, }, - "name": "b", + "name": "bar", "range": Array [ - 23, - 24, + 73, + 76, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 9, - "line": 3, + "column": 16, + "line": 5, }, "start": Object { "column": 2, - "line": 3, + "line": 5, }, }, + "optional": true, "range": Array [ - 23, - 30, + 73, + 87, ], "static": false, "type": "ClassProperty", - "value": Object { + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 8, - "line": 3, + "column": 15, + "line": 5, }, "start": Object { - "column": 6, - "line": 3, + "column": 7, + "line": 5, }, }, - "properties": Array [], "range": Array [ - 27, - 29, + 78, + 86, ], - "type": "ObjectExpression", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "range": Array [ + 80, + 86, + ], + "type": "TSStringKeyword", + }, }, + "value": null, }, Object { + "accessibility": "private", "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { - "column": 3, - "line": 4, + "column": 13, + "line": 6, }, "start": Object { - "column": 2, - "line": 4, + "column": 10, + "line": 6, }, }, - "name": "c", + "name": "baz", "range": Array [ - 33, - 34, + 98, + 101, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 9, - "line": 4, + "column": 24, + "line": 6, }, "start": Object { "column": 2, - "line": 4, + "line": 6, }, }, + "optional": true, "range": Array [ - 33, - 40, + 90, + 112, ], "static": false, "type": "ClassProperty", - "value": Object { - "elements": Array [], + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 8, - "line": 4, + "column": 23, + "line": 6, }, "start": Object { - "column": 6, - "line": 4, + "column": 15, + "line": 6, }, }, "range": Array [ - 37, - 39, + 103, + 111, ], - "type": "ArrayExpression", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 6, + }, + "start": Object { + "column": 17, + "line": 6, + }, + }, + "range": Array [ + 105, + 111, + ], + "type": "TSStringKeyword", + }, }, + "value": null, }, Object { - "computed": false, + "computed": true, + "declare": false, "key": Object { "loc": Object { "end": Object { - "column": 3, - "line": 5, + "column": 11, + "line": 7, }, "start": Object { - "column": 2, - "line": 5, + "column": 3, + "line": 7, }, }, - "name": "d", + "name": "computed", "range": Array [ - 43, - 44, + 116, + 124, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 14, + "line": 7, }, "start": Object { "column": 2, - "line": 5, + "line": 7, }, }, + "optional": true, "range": Array [ - 43, - 50, + 115, + 127, ], "static": false, "type": "ClassProperty", - "value": Object { + "value": null, + }, + Object { + "computed": true, + "declare": false, + "key": Object { "loc": Object { "end": Object { - "column": 8, - "line": 5, + "column": 12, + "line": 8, }, "start": Object { - "column": 6, - "line": 5, + "column": 3, + "line": 8, }, }, "range": Array [ - 47, - 49, + 131, + 140, ], - "raw": "\\"\\"", + "raw": "'literal'", "type": "Literal", - "value": "", + "value": "literal", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 8, + }, + "start": Object { + "column": 2, + "line": 8, + }, }, + "optional": true, + "range": Array [ + 130, + 143, + ], + "static": false, + "type": "ClassProperty", + "value": null, }, Object { - "computed": false, + "computed": true, + "declare": false, "key": Object { "loc": Object { "end": Object { + "column": 4, + "line": 9, + }, + "start": Object { "column": 3, - "line": 6, + "line": 9, + }, + }, + "range": Array [ + 147, + 148, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 9, + }, + "start": Object { + "column": 2, + "line": 9, + }, + }, + "optional": true, + "range": Array [ + 146, + 151, + ], + "static": false, + "type": "ClassProperty", + "value": null, + }, + Object { + "computed": true, + "declare": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 10, }, "start": Object { - "column": 2, - "line": 6, + "column": 3, + "line": 10, }, }, - "name": "e", + "name": "computed2", "range": Array [ - 53, - 54, + 155, + 164, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 29, - "line": 6, + "column": 23, + "line": 10, }, "start": Object { "column": 2, - "line": 6, + "line": 10, }, }, + "optional": true, "range": Array [ - 53, - 80, + 154, + 175, ], "static": false, "type": "ClassProperty", - "value": Object { - "arguments": Array [ - Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 6, - }, - "start": Object { - "column": 17, - "line": 6, - }, - }, - "properties": Array [], - "range": Array [ - 68, - 70, - ], - "type": "ObjectExpression", - }, - Object { - "elements": Array [], - "loc": Object { - "end": Object { - "column": 23, - "line": 6, - }, - "start": Object { - "column": 21, - "line": 6, - }, - }, - "range": Array [ - 72, - 74, - ], - "type": "ArrayExpression", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 6, - }, - "start": Object { - "column": 25, - "line": 6, - }, - }, - "range": Array [ - 76, - 77, - ], - "raw": "2", - "type": "Literal", - "value": 2, - }, - ], - "loc": Object { - "end": Object { - "column": 27, - "line": 6, - }, - "start": Object { - "column": 16, - "line": 6, - }, + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 10, + }, + "start": Object { + "column": 14, + "line": 10, + }, + }, + "range": Array [ + 166, + 174, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 10, }, - "range": Array [ - 67, - 78, - ], - "type": "ArrayExpression", + "start": Object { + "column": 16, + "line": 10, + }, + }, + "range": Array [ + 168, + 174, + ], + "type": "TSStringKeyword", + }, + }, + "value": null, + }, + Object { + "computed": true, + "declare": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 11, + }, + "start": Object { + "column": 3, + "line": 11, }, + }, + "range": Array [ + 179, + 189, ], - "callee": Object { + "raw": "'literal2'", + "type": "Literal", + "value": "literal2", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 11, + }, + "start": Object { + "column": 2, + "line": 11, + }, + }, + "optional": true, + "range": Array [ + 178, + 200, + ], + "static": false, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 11, + }, + "start": Object { + "column": 15, + "line": 11, + }, + }, + "range": Array [ + 191, + 199, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 15, - "line": 6, + "column": 23, + "line": 11, }, "start": Object { - "column": 10, - "line": 6, + "column": 17, + "line": 11, }, }, - "name": "Array", "range": Array [ - 61, - 66, + 193, + 199, ], - "type": "Identifier", + "type": "TSStringKeyword", }, + }, + "value": null, + }, + Object { + "computed": true, + "declare": false, + "key": Object { "loc": Object { "end": Object { - "column": 28, - "line": 6, + "column": 4, + "line": 12, + }, + "start": Object { + "column": 3, + "line": 12, + }, + }, + "range": Array [ + 204, + 205, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 12, + }, + "start": Object { + "column": 2, + "line": 12, + }, + }, + "optional": true, + "range": Array [ + 203, + 216, + ], + "static": false, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 12, }, "start": Object { "column": 6, - "line": 6, + "line": 12, }, }, "range": Array [ - 57, - 79, + 207, + 215, ], - "type": "NewExpression", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 12, + }, + "start": Object { + "column": 8, + "line": 12, + }, + }, + "range": Array [ + 209, + 215, + ], + "type": "TSStringKeyword", + }, }, + "value": null, }, ], "loc": Object { "end": Object { "column": 1, - "line": 7, + "line": 13, }, "start": Object { "column": 10, - "line": 1, + "line": 3, }, }, "range": Array [ - 10, - 82, + 61, + 218, ], "type": "ClassBody", }, @@ -25693,33 +25238,33 @@ Object { "loc": Object { "end": Object { "column": 9, - "line": 1, + "line": 3, }, "start": Object { "column": 6, - "line": 1, + "line": 3, }, }, "name": "Foo", "range": Array [ - 6, - 9, + 57, + 60, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 7, + "line": 13, }, "start": Object { "column": 0, - "line": 1, + "line": 3, }, }, "range": Array [ - 0, - 82, + 51, + 218, ], "superClass": null, "type": "ClassDeclaration", @@ -25728,7 +25273,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 8, + "line": 14, }, "start": Object { "column": 0, @@ -25737,7 +25282,7 @@ Object { }, "range": Array [ 0, - 83, + 219, ], "sourceType": "script", "tokens": Array [ @@ -25757,12 +25302,12 @@ Object { 5, ], "type": "Keyword", - "value": "class", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 14, "line": 1, }, "start": Object { @@ -25772,46 +25317,64 @@ Object { }, "range": Array [ 6, - 9, + 14, ], "type": "Identifier", - "value": "Foo", + "value": "computed", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 16, "line": 1, }, "start": Object { - "column": 10, + "column": 15, "line": 1, }, }, "range": Array [ - 10, - 11, + 15, + 16, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 17, + "line": 1, }, }, "range": Array [ - 14, - 15, + 17, + 23, ], - "type": "Identifier", - "value": "a", + "type": "String", + "value": "'buzz'", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { @@ -25820,21 +25383,21 @@ Object { "line": 2, }, "start": Object { - "column": 4, + "column": 0, "line": 2, }, }, "range": Array [ - 16, - 17, + 25, + 30, ], - "type": "Punctuator", - "value": "=", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 15, "line": 2, }, "start": Object { @@ -25843,124 +25406,124 @@ Object { }, }, "range": Array [ - 18, - 19, + 31, + 40, ], - "type": "Numeric", - "value": "2", + "type": "Identifier", + "value": "computed2", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 17, "line": 2, }, "start": Object { - "column": 7, + "column": 16, "line": 2, }, }, "range": Array [ - 19, - 20, + 41, + 42, ], "type": "Punctuator", - "value": ";", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 3, + "column": 24, + "line": 2, }, "start": Object { - "column": 2, - "line": 3, + "column": 18, + "line": 2, }, }, "range": Array [ - 23, - 24, + 43, + 49, ], - "type": "Identifier", - "value": "b", + "type": "String", + "value": "'bazz'", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 25, + "line": 2, }, "start": Object { - "column": 4, - "line": 3, + "column": 24, + "line": 2, }, }, "range": Array [ - 25, - 26, + 49, + 50, ], "type": "Punctuator", - "value": "=", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 3, }, "start": Object { - "column": 6, + "column": 0, "line": 3, }, }, "range": Array [ - 27, - 28, + 51, + 56, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 9, "line": 3, }, "start": Object { - "column": 7, + "column": 6, "line": 3, }, }, "range": Array [ - 28, - 29, + 57, + 60, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 11, "line": 3, }, "start": Object { - "column": 8, + "column": 10, "line": 3, }, }, "range": Array [ - 29, - 30, + 61, + 62, ], "type": "Punctuator", - "value": ";", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 4, }, "start": Object { @@ -25969,29 +25532,29 @@ Object { }, }, "range": Array [ - 33, - 34, + 65, + 68, ], "type": "Identifier", - "value": "c", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 6, "line": 4, }, "start": Object { - "column": 4, + "column": 5, "line": 4, }, }, "range": Array [ - 35, - 36, + 68, + 69, ], "type": "Punctuator", - "value": "=", + "value": "?", }, Object { "loc": Object { @@ -26005,224 +25568,224 @@ Object { }, }, "range": Array [ - 37, - 38, + 69, + 70, ], "type": "Punctuator", - "value": "[", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 4, + "column": 5, + "line": 5, }, "start": Object { - "column": 7, - "line": 4, + "column": 2, + "line": 5, }, }, "range": Array [ - 38, - 39, + 73, + 76, ], - "type": "Punctuator", - "value": "]", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 4, + "column": 6, + "line": 5, }, "start": Object { - "column": 8, - "line": 4, + "column": 5, + "line": 5, }, }, "range": Array [ - 39, - 40, + 76, + 77, ], "type": "Punctuator", - "value": ";", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 8, "line": 5, }, "start": Object { - "column": 2, + "column": 7, "line": 5, }, }, "range": Array [ - 43, - 44, + 78, + 79, ], - "type": "Identifier", - "value": "d", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 15, "line": 5, }, "start": Object { - "column": 4, + "column": 9, "line": 5, }, }, "range": Array [ - 45, - 46, + 80, + 86, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 16, "line": 5, }, "start": Object { - "column": 6, + "column": 15, "line": 5, }, }, "range": Array [ - 47, - 49, + 86, + 87, ], - "type": "String", - "value": "\\"\\"", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { "column": 9, - "line": 5, + "line": 6, }, "start": Object { - "column": 8, - "line": 5, + "column": 2, + "line": 6, }, }, "range": Array [ - 49, - 50, + 90, + 97, ], - "type": "Punctuator", - "value": ";", + "type": "Keyword", + "value": "private", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 13, "line": 6, }, "start": Object { - "column": 2, + "column": 10, "line": 6, }, }, "range": Array [ - 53, - 54, + 98, + 101, ], "type": "Identifier", - "value": "e", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 14, "line": 6, }, "start": Object { - "column": 4, + "column": 13, "line": 6, }, }, "range": Array [ - 55, - 56, + 101, + 102, ], "type": "Punctuator", - "value": "=", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 16, "line": 6, }, "start": Object { - "column": 6, + "column": 15, "line": 6, }, }, "range": Array [ - 57, - 60, + 103, + 104, ], - "type": "Keyword", - "value": "new", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 23, "line": 6, }, "start": Object { - "column": 10, + "column": 17, "line": 6, }, }, "range": Array [ - 61, - 66, + 105, + 111, ], "type": "Identifier", - "value": "Array", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 24, "line": 6, }, "start": Object { - "column": 15, + "column": 23, "line": 6, }, }, "range": Array [ - 66, - 67, + 111, + 112, ], "type": "Punctuator", - "value": "(", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 6, + "column": 3, + "line": 7, }, "start": Object { - "column": 16, - "line": 6, + "column": 2, + "line": 7, }, }, "range": Array [ - 67, - 68, + 115, + 116, ], "type": "Punctuator", "value": "[", @@ -26230,125 +25793,539 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, - "line": 6, + "column": 11, + "line": 7, }, "start": Object { - "column": 17, - "line": 6, - }, + "column": 3, + "line": 7, + }, }, "range": Array [ - 68, - 69, + 116, + 124, + ], + "type": "Identifier", + "value": "computed", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 7, + }, + "start": Object { + "column": 11, + "line": 7, + }, + }, + "range": Array [ + 124, + 125, ], "type": "Punctuator", - "value": "{", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 6, + "column": 13, + "line": 7, }, "start": Object { - "column": 18, - "line": 6, + "column": 12, + "line": 7, }, }, "range": Array [ - 69, - 70, + 125, + 126, ], "type": "Punctuator", - "value": "}", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 6, + "column": 14, + "line": 7, }, "start": Object { - "column": 19, - "line": 6, + "column": 13, + "line": 7, }, }, "range": Array [ - 70, - 71, + 126, + 127, ], "type": "Punctuator", - "value": ",", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 6, + "column": 3, + "line": 8, }, "start": Object { - "column": 21, - "line": 6, + "column": 2, + "line": 8, }, }, "range": Array [ - 72, - 73, + 130, + 131, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 8, + }, + "start": Object { + "column": 3, + "line": 8, + }, + }, + "range": Array [ + 131, + 140, + ], + "type": "String", + "value": "'literal'", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 8, + }, + "start": Object { + "column": 12, + "line": 8, + }, + }, + "range": Array [ + 140, + 141, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 8, + }, + "start": Object { + "column": 13, + "line": 8, + }, + }, + "range": Array [ + 141, + 142, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 8, + }, + "start": Object { + "column": 14, + "line": 8, + }, + }, + "range": Array [ + 142, + 143, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 9, + }, + "start": Object { + "column": 2, + "line": 9, + }, + }, + "range": Array [ + 146, + 147, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 9, + }, + "start": Object { + "column": 3, + "line": 9, + }, + }, + "range": Array [ + 147, + 148, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 9, + }, + "start": Object { + "column": 4, + "line": 9, + }, + }, + "range": Array [ + 148, + 149, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 9, + }, + "start": Object { + "column": 5, + "line": 9, + }, + }, + "range": Array [ + 149, + 150, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 9, + }, + "start": Object { + "column": 6, + "line": 9, + }, + }, + "range": Array [ + 150, + 151, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 10, + }, + "start": Object { + "column": 2, + "line": 10, + }, + }, + "range": Array [ + 154, + 155, ], "type": "Punctuator", "value": "[", }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 10, + }, + "start": Object { + "column": 3, + "line": 10, + }, + }, + "range": Array [ + 155, + 164, + ], + "type": "Identifier", + "value": "computed2", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 10, + }, + "start": Object { + "column": 12, + "line": 10, + }, + }, + "range": Array [ + 164, + 165, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 10, + }, + "start": Object { + "column": 13, + "line": 10, + }, + }, + "range": Array [ + 165, + 166, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 10, + }, + "start": Object { + "column": 14, + "line": 10, + }, + }, + "range": Array [ + 166, + 167, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 10, + }, + "start": Object { + "column": 16, + "line": 10, + }, + }, + "range": Array [ + 168, + 174, + ], + "type": "Identifier", + "value": "string", + }, Object { "loc": Object { "end": Object { "column": 23, - "line": 6, + "line": 10, }, "start": Object { "column": 22, - "line": 6, + "line": 10, }, }, "range": Array [ - 73, - 74, + 174, + 175, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 11, + }, + "start": Object { + "column": 2, + "line": 11, + }, + }, + "range": Array [ + 178, + 179, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 11, + }, + "start": Object { + "column": 3, + "line": 11, + }, + }, + "range": Array [ + 179, + 189, + ], + "type": "String", + "value": "'literal2'", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 11, + }, + "start": Object { + "column": 13, + "line": 11, + }, + }, + "range": Array [ + 189, + 190, ], "type": "Punctuator", "value": "]", }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 11, + }, + "start": Object { + "column": 14, + "line": 11, + }, + }, + "range": Array [ + 190, + 191, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 11, + }, + "start": Object { + "column": 15, + "line": 11, + }, + }, + "range": Array [ + 191, + 192, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 11, + }, + "start": Object { + "column": 17, + "line": 11, + }, + }, + "range": Array [ + 193, + 199, + ], + "type": "Identifier", + "value": "string", + }, Object { "loc": Object { "end": Object { "column": 24, - "line": 6, + "line": 11, }, "start": Object { "column": 23, - "line": 6, + "line": 11, }, }, "range": Array [ - 74, - 75, + 199, + 200, ], "type": "Punctuator", - "value": ",", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 6, + "column": 3, + "line": 12, }, "start": Object { - "column": 25, - "line": 6, + "column": 2, + "line": 12, }, }, "range": Array [ - 76, - 77, + 203, + 204, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 12, + }, + "start": Object { + "column": 3, + "line": 12, + }, + }, + "range": Array [ + 204, + 205, ], "type": "Numeric", "value": "2", @@ -26356,17 +26333,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 27, - "line": 6, + "column": 5, + "line": 12, }, "start": Object { - "column": 26, - "line": 6, + "column": 4, + "line": 12, }, }, "range": Array [ - 77, - 78, + 205, + 206, ], "type": "Punctuator", "value": "]", @@ -26374,35 +26351,71 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, - "line": 6, + "column": 6, + "line": 12, }, "start": Object { - "column": 27, - "line": 6, + "column": 5, + "line": 12, }, }, "range": Array [ - 78, - 79, + 206, + 207, ], "type": "Punctuator", - "value": ")", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 6, + "column": 7, + "line": 12, }, "start": Object { - "column": 28, - "line": 6, + "column": 6, + "line": 12, }, }, "range": Array [ - 79, - 80, + 207, + 208, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 12, + }, + "start": Object { + "column": 8, + "line": 12, + }, + }, + "range": Array [ + 209, + 215, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 12, + }, + "start": Object { + "column": 14, + "line": 12, + }, + }, + "range": Array [ + 215, + 216, ], "type": "Punctuator", "value": ";", @@ -26411,16 +26424,16 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 7, + "line": 13, }, "start": Object { "column": 0, - "line": 7, + "line": 13, }, }, "range": Array [ - 81, - 82, + 217, + 218, ], "type": "Punctuator", "value": "}", @@ -26430,7 +26443,325 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-protected-parameter-properties.src 1`] = ` +exports[`typescript fixtures/basics/class-with-optional-property-undefined.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "accessibility": "private", + "computed": false, + "declare": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "optional": true, + "range": Array [ + 12, + 37, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "name": "undefined", + "range": Array [ + 27, + 36, + ], + "type": "Identifier", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 39, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 39, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 41, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 12, + 19, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 27, + 36, + ], + "type": "Keyword", + "value": "undefined", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-private-parameter-properties.src 1`] = ` Object { "body": Array [ Object { @@ -26459,7 +26790,7 @@ Object { "kind": "constructor", "loc": Object { "end": Object { - "column": 61, + "column": 59, "line": 5, }, "start": Object { @@ -26469,7 +26800,7 @@ Object { }, "range": Array [ 14, - 209, + 201, ], "static": false, "type": "MethodDefinition", @@ -26479,17 +26810,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 61, + "column": 59, "line": 5, }, "start": Object { - "column": 59, + "column": 57, "line": 5, }, }, "range": Array [ - 207, - 209, + 199, + 201, ], "type": "BlockStatement", }, @@ -26498,7 +26829,7 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 61, + "column": 59, "line": 5, }, "start": Object { @@ -26508,10 +26839,10 @@ Object { }, "params": Array [ Object { - "accessibility": "protected", + "accessibility": "private", "loc": Object { "end": Object { - "column": 41, + "column": 39, "line": 2, }, "start": Object { @@ -26522,50 +26853,50 @@ Object { "parameter": Object { "loc": Object { "end": Object { - "column": 41, + "column": 39, "line": 2, }, "start": Object { - "column": 24, + "column": 22, "line": 2, }, }, "name": "firstName", "range": Array [ - 36, - 53, + 34, + 51, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 41, + "column": 39, "line": 2, }, "start": Object { - "column": 33, + "column": 31, "line": 2, }, }, "range": Array [ - 45, - 53, + 43, + 51, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 41, + "column": 39, "line": 2, }, "start": Object { - "column": 35, + "column": 33, "line": 2, }, }, "range": Array [ - 47, - 53, + 45, + 51, ], "type": "TSStringKeyword", }, @@ -26573,15 +26904,15 @@ Object { }, "range": Array [ 26, - 53, + 51, ], "type": "TSParameterProperty", }, Object { - "accessibility": "protected", + "accessibility": "private", "loc": Object { "end": Object { - "column": 49, + "column": 47, "line": 3, }, "start": Object { @@ -26592,67 +26923,67 @@ Object { "parameter": Object { "loc": Object { "end": Object { - "column": 49, + "column": 47, "line": 3, }, "start": Object { - "column": 33, + "column": 31, "line": 3, }, }, "name": "lastName", "range": Array [ - 88, - 104, + 84, + 100, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 49, + "column": 47, "line": 3, }, "start": Object { - "column": 41, + "column": 39, "line": 3, }, }, "range": Array [ - 96, - 104, + 92, + 100, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 49, + "column": 47, "line": 3, }, "start": Object { - "column": 43, + "column": 41, "line": 3, }, }, "range": Array [ - 98, - 104, + 94, + 100, ], "type": "TSStringKeyword", }, }, }, "range": Array [ - 69, - 104, + 67, + 100, ], "readonly": true, "type": "TSParameterProperty", }, Object { - "accessibility": "protected", + "accessibility": "private", "loc": Object { "end": Object { - "column": 40, + "column": 38, "line": 4, }, "start": Object { @@ -26664,50 +26995,50 @@ Object { "left": Object { "loc": Object { "end": Object { - "column": 35, + "column": 33, "line": 4, }, "start": Object { - "column": 24, + "column": 22, "line": 4, }, }, "name": "age", "range": Array [ - 130, - 141, + 124, + 135, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 35, + "column": 33, "line": 4, }, "start": Object { - "column": 27, + "column": 25, "line": 4, }, }, "range": Array [ - 133, - 141, + 127, + 135, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 35, + "column": 33, "line": 4, }, "start": Object { - "column": 29, + "column": 27, "line": 4, }, }, "range": Array [ + 129, 135, - 141, ], "type": "TSNumberKeyword", }, @@ -26715,32 +27046,32 @@ Object { }, "loc": Object { "end": Object { - "column": 40, + "column": 38, "line": 4, }, "start": Object { - "column": 24, + "column": 22, "line": 4, }, }, "range": Array [ - 130, - 146, + 124, + 140, ], "right": Object { "loc": Object { "end": Object { - "column": 40, + "column": 38, "line": 4, }, "start": Object { - "column": 38, + "column": 36, "line": 4, }, }, "range": Array [ - 144, - 146, + 138, + 140, ], "raw": "30", "type": "Literal", @@ -26749,16 +27080,16 @@ Object { "type": "AssignmentPattern", }, "range": Array [ - 120, - 146, + 116, + 140, ], "type": "TSParameterProperty", }, Object { - "accessibility": "protected", + "accessibility": "private", "loc": Object { "end": Object { - "column": 57, + "column": 55, "line": 5, }, "start": Object { @@ -26770,50 +27101,50 @@ Object { "left": Object { "loc": Object { "end": Object { - "column": 49, + "column": 47, "line": 5, }, "start": Object { - "column": 33, + "column": 31, "line": 5, }, }, "name": "student", "range": Array [ - 181, - 197, + 173, + 189, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 49, + "column": 47, "line": 5, }, "start": Object { - "column": 40, + "column": 38, "line": 5, }, }, "range": Array [ - 188, - 197, + 180, + 189, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 49, + "column": 47, "line": 5, }, "start": Object { - "column": 42, + "column": 40, "line": 5, }, }, "range": Array [ - 190, - 197, + 182, + 189, ], "type": "TSBooleanKeyword", }, @@ -26821,32 +27152,32 @@ Object { }, "loc": Object { "end": Object { - "column": 57, + "column": 55, "line": 5, }, "start": Object { - "column": 33, + "column": 31, "line": 5, }, }, "range": Array [ - 181, - 205, + 173, + 197, ], "right": Object { "loc": Object { "end": Object { - "column": 57, + "column": 55, "line": 5, }, "start": Object { - "column": 52, + "column": 50, "line": 5, }, }, "range": Array [ - 200, - 205, + 192, + 197, ], "raw": "false", "type": "Literal", @@ -26855,8 +27186,8 @@ Object { "type": "AssignmentPattern", }, "range": Array [ - 162, - 205, + 156, + 197, ], "readonly": true, "type": "TSParameterProperty", @@ -26864,7 +27195,7 @@ Object { ], "range": Array [ 25, - 209, + 201, ], "type": "FunctionExpression", }, @@ -26882,7 +27213,7 @@ Object { }, "range": Array [ 10, - 211, + 203, ], "type": "ClassBody", }, @@ -26916,7 +27247,7 @@ Object { }, "range": Array [ 0, - 211, + 203, ], "superClass": null, "type": "ClassDeclaration", @@ -26934,7 +27265,7 @@ Object { }, "range": Array [ 0, - 211, + 203, ], "sourceType": "script", "tokens": Array [ @@ -27031,7 +27362,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, + "column": 21, "line": 2, }, "start": Object { @@ -27041,25 +27372,25 @@ Object { }, "range": Array [ 26, - 35, + 33, ], "type": "Keyword", - "value": "protected", + "value": "private", }, Object { "loc": Object { "end": Object { - "column": 33, + "column": 31, "line": 2, }, "start": Object { - "column": 24, + "column": 22, "line": 2, }, }, "range": Array [ - 36, - 45, + 34, + 43, ], "type": "Identifier", "value": "firstName", @@ -27067,17 +27398,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 34, + "column": 32, "line": 2, }, "start": Object { - "column": 33, + "column": 31, "line": 2, }, }, "range": Array [ - 45, - 46, + 43, + 44, ], "type": "Punctuator", "value": ":", @@ -27085,17 +27416,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 41, + "column": 39, "line": 2, }, "start": Object { - "column": 35, + "column": 33, "line": 2, }, }, "range": Array [ - 47, - 53, + 45, + 51, ], "type": "Identifier", "value": "string", @@ -27103,17 +27434,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 42, + "column": 40, "line": 2, }, "start": Object { - "column": 41, + "column": 39, "line": 2, }, }, "range": Array [ - 53, - 54, + 51, + 52, ], "type": "Punctuator", "value": ",", @@ -27121,7 +27452,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, + "column": 21, "line": 3, }, "start": Object { @@ -27130,26 +27461,26 @@ Object { }, }, "range": Array [ - 69, - 78, + 67, + 74, ], "type": "Keyword", - "value": "protected", + "value": "private", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 30, "line": 3, }, "start": Object { - "column": 24, + "column": 22, "line": 3, }, }, "range": Array [ - 79, - 87, + 75, + 83, ], "type": "Identifier", "value": "readonly", @@ -27157,17 +27488,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 41, + "column": 39, "line": 3, }, "start": Object { - "column": 33, + "column": 31, "line": 3, }, }, "range": Array [ - 88, - 96, + 84, + 92, ], "type": "Identifier", "value": "lastName", @@ -27175,17 +27506,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 42, + "column": 40, "line": 3, }, "start": Object { - "column": 41, + "column": 39, "line": 3, }, }, "range": Array [ - 96, - 97, + 92, + 93, ], "type": "Punctuator", "value": ":", @@ -27193,17 +27524,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 49, + "column": 47, "line": 3, }, "start": Object { - "column": 43, + "column": 41, "line": 3, }, }, "range": Array [ - 98, - 104, + 94, + 100, ], "type": "Identifier", "value": "string", @@ -27211,17 +27542,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 50, + "column": 48, "line": 3, }, "start": Object { - "column": 49, + "column": 47, "line": 3, }, }, "range": Array [ - 104, - 105, + 100, + 101, ], "type": "Punctuator", "value": ",", @@ -27229,7 +27560,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, + "column": 21, "line": 4, }, "start": Object { @@ -27238,26 +27569,26 @@ Object { }, }, "range": Array [ - 120, - 129, + 116, + 123, ], "type": "Keyword", - "value": "protected", + "value": "private", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 25, "line": 4, }, "start": Object { - "column": 24, + "column": 22, "line": 4, }, }, "range": Array [ - 130, - 133, + 124, + 127, ], "type": "Identifier", "value": "age", @@ -27265,17 +27596,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, + "column": 26, "line": 4, }, "start": Object { - "column": 27, + "column": 25, "line": 4, }, }, "range": Array [ - 133, - 134, + 127, + 128, ], "type": "Punctuator", "value": ":", @@ -27283,17 +27614,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 35, + "column": 33, "line": 4, }, "start": Object { - "column": 29, + "column": 27, "line": 4, }, }, "range": Array [ + 129, 135, - 141, ], "type": "Identifier", "value": "number", @@ -27301,17 +27632,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 37, + "column": 35, "line": 4, }, "start": Object { - "column": 36, + "column": 34, "line": 4, }, }, "range": Array [ - 142, - 143, + 136, + 137, ], "type": "Punctuator", "value": "=", @@ -27319,17 +27650,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 40, + "column": 38, "line": 4, }, "start": Object { - "column": 38, + "column": 36, "line": 4, }, }, "range": Array [ - 144, - 146, + 138, + 140, ], "type": "Numeric", "value": "30", @@ -27337,17 +27668,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 41, + "column": 39, "line": 4, }, "start": Object { - "column": 40, + "column": 38, "line": 4, }, }, "range": Array [ - 146, - 147, + 140, + 141, ], "type": "Punctuator", "value": ",", @@ -27355,7 +27686,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, + "column": 21, "line": 5, }, "start": Object { @@ -27364,26 +27695,26 @@ Object { }, }, "range": Array [ - 162, - 171, + 156, + 163, ], "type": "Keyword", - "value": "protected", + "value": "private", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 30, "line": 5, }, "start": Object { - "column": 24, + "column": 22, "line": 5, }, }, "range": Array [ + 164, 172, - 180, ], "type": "Identifier", "value": "readonly", @@ -27391,17 +27722,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 40, + "column": 38, "line": 5, }, "start": Object { - "column": 33, + "column": 31, "line": 5, }, }, "range": Array [ - 181, - 188, + 173, + 180, ], "type": "Identifier", "value": "student", @@ -27409,17 +27740,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 41, + "column": 39, "line": 5, }, "start": Object { - "column": 40, + "column": 38, "line": 5, }, }, "range": Array [ - 188, - 189, + 180, + 181, ], "type": "Punctuator", "value": ":", @@ -27427,17 +27758,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 49, + "column": 47, "line": 5, }, "start": Object { - "column": 42, + "column": 40, "line": 5, }, }, "range": Array [ - 190, - 197, + 182, + 189, ], "type": "Identifier", "value": "boolean", @@ -27445,17 +27776,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 51, + "column": 49, "line": 5, }, "start": Object { - "column": 50, + "column": 48, "line": 5, }, }, "range": Array [ - 198, - 199, + 190, + 191, ], "type": "Punctuator", "value": "=", @@ -27463,17 +27794,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 57, + "column": 55, "line": 5, }, "start": Object { - "column": 52, + "column": 50, "line": 5, }, }, "range": Array [ - 200, - 205, + 192, + 197, ], "type": "Boolean", "value": "false", @@ -27481,17 +27812,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 58, + "column": 56, "line": 5, }, "start": Object { - "column": 57, + "column": 55, "line": 5, }, }, "range": Array [ - 205, - 206, + 197, + 198, ], "type": "Punctuator", "value": ")", @@ -27499,17 +27830,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 60, + "column": 58, "line": 5, }, "start": Object { - "column": 59, + "column": 57, "line": 5, }, }, "range": Array [ - 207, - 208, + 199, + 200, ], "type": "Punctuator", "value": "{", @@ -27517,17 +27848,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 61, + "column": 59, "line": 5, }, "start": Object { - "column": 60, + "column": 58, "line": 5, }, }, "range": Array [ - 208, - 209, + 200, + 201, ], "type": "Punctuator", "value": "}", @@ -27544,8 +27875,8 @@ Object { }, }, "range": Array [ - 210, - 211, + 202, + 203, ], "type": "Punctuator", "value": "}", @@ -27555,7 +27886,7 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-public-parameter-properties.src 1`] = ` +exports[`typescript fixtures/basics/class-with-property-function.src 1`] = ` Object { "body": Array [ Object { @@ -27563,10 +27894,11 @@ Object { "body": Array [ Object { "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { - "column": 13, + "column": 5, "line": 2, }, "start": Object { @@ -27574,18 +27906,17 @@ Object { "line": 2, }, }, - "name": "constructor", + "name": "foo", "range": Array [ 14, - 25, + 17, ], "type": "Identifier", }, - "kind": "constructor", "loc": Object { "end": Object { - "column": 58, - "line": 5, + "column": 43, + "line": 2, }, "start": Object { "column": 2, @@ -27594,411 +27925,272 @@ Object { }, "range": Array [ 14, - 197, + 55, ], "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 17, + 32, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 58, - "line": 5, + "column": 20, + "line": 2, }, "start": Object { - "column": 56, - "line": 5, + "column": 7, + "line": 2, }, }, + "params": Array [], "range": Array [ - 195, - 197, + 19, + 32, ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 58, - "line": 5, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "params": Array [ - Object { - "accessibility": "public", + "returnType": Object { "loc": Object { "end": Object { - "column": 38, + "column": 20, "line": 2, }, "start": Object { - "column": 14, + "column": 10, "line": 2, }, }, - "parameter": Object { + "range": Array [ + 22, + 32, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 38, + "column": 20, "line": 2, }, "start": Object { - "column": 21, + "column": 13, "line": 2, }, }, - "name": "firstName", "range": Array [ - 33, - 50, + 25, + 32, ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 2, - }, - "start": Object { - "column": 30, - "line": 2, - }, - }, - "range": Array [ - 42, - 50, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 2, - }, - "start": Object { - "column": 32, - "line": 2, - }, - }, - "range": Array [ - 44, - 50, - ], - "type": "TSStringKeyword", - }, - }, + "type": "TSBooleanKeyword", }, - "range": Array [ - 26, - 50, - ], - "type": "TSParameterProperty", }, - Object { - "accessibility": "public", - "loc": Object { - "end": Object { - "column": 46, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, + "type": "TSFunctionType", + }, + }, + "value": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 2, }, - "parameter": Object { - "loc": Object { - "end": Object { - "column": 46, - "line": 3, - }, - "start": Object { - "column": 30, - "line": 3, - }, - }, - "name": "lastName", - "range": Array [ - 82, - 98, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 46, - "line": 3, - }, - "start": Object { - "column": 38, - "line": 3, - }, - }, - "range": Array [ - 90, - 98, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 46, - "line": 3, - }, - "start": Object { - "column": 40, - "line": 3, - }, - }, - "range": Array [ - 92, - 98, - ], - "type": "TSStringKeyword", - }, - }, + "start": Object { + "column": 38, + "line": 2, }, - "range": Array [ - 66, - 98, - ], - "readonly": true, - "type": "TSParameterProperty", }, - Object { - "accessibility": "public", - "loc": Object { - "end": Object { - "column": 37, - "line": 4, - }, - "start": Object { - "column": 14, - "line": 4, - }, + "range": Array [ + 50, + 54, + ], + "raw": "true", + "type": "Literal", + "value": true, + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 42, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 35, + 54, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, }, - "parameter": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 4, - }, - "start": Object { - "column": 21, - "line": 4, - }, - }, - "name": "age", - "range": Array [ - 121, - 132, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 4, - }, - "start": Object { - "column": 24, - "line": 4, - }, - }, - "range": Array [ - 124, - 132, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 4, - }, - "start": Object { - "column": 26, - "line": 4, - }, - }, - "range": Array [ - 126, - 132, - ], - "type": "TSNumberKeyword", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 37, - "line": 4, - }, - "start": Object { - "column": 21, - "line": 4, - }, - }, - "range": Array [ - 121, - 137, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 4, - }, - "start": Object { - "column": 35, - "line": 4, - }, - }, - "range": Array [ - 135, - 137, - ], - "raw": "30", - "type": "Literal", - "value": 30, - }, - "type": "AssignmentPattern", + "start": Object { + "column": 25, + "line": 2, }, - "range": Array [ - 114, - 137, - ], - "type": "TSParameterProperty", }, - Object { - "accessibility": "public", + "range": Array [ + 37, + 46, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 54, - "line": 5, + "column": 34, + "line": 2, }, "start": Object { - "column": 14, - "line": 5, - }, - }, - "parameter": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 46, - "line": 5, - }, - "start": Object { - "column": 30, - "line": 5, - }, - }, - "name": "student", - "range": Array [ - 169, - 185, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 46, - "line": 5, - }, - "start": Object { - "column": 37, - "line": 5, - }, - }, - "range": Array [ - 176, - 185, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 46, - "line": 5, - }, - "start": Object { - "column": 39, - "line": 5, - }, - }, - "range": Array [ - 178, - 185, - ], - "type": "TSBooleanKeyword", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 54, - "line": 5, - }, - "start": Object { - "column": 30, - "line": 5, - }, - }, - "range": Array [ - 169, - 193, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 54, - "line": 5, - }, - "start": Object { - "column": 49, - "line": 5, - }, - }, - "range": Array [ - 188, - 193, - ], - "raw": "false", - "type": "Literal", - "value": false, + "column": 27, + "line": 2, }, - "type": "AssignmentPattern", }, "range": Array [ - 153, - 193, + 39, + 46, ], - "readonly": true, - "type": "TSParameterProperty", + "type": "TSBooleanKeyword", + }, + }, + "type": "ArrowFunctionExpression", + }, + }, + Object { + "computed": false, + "declare": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 58, + 61, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 58, + 83, + ], + "static": false, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 61, + 69, ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 63, + 69, + ], + "type": "TSStringKeyword", + }, + }, + "value": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 3, + }, + }, + "name": "test", + "range": Array [ + 78, + 82, + ], + "type": "Identifier", + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 26, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "params": Array [], "range": Array [ - 25, - 197, + 72, + 82, ], - "type": "FunctionExpression", + "type": "ArrowFunctionExpression", }, }, ], "loc": Object { "end": Object { "column": 1, - "line": 6, + "line": 4, }, "start": Object { "column": 10, @@ -28007,7 +28199,7 @@ Object { }, "range": Array [ 10, - 199, + 85, ], "type": "ClassBody", }, @@ -28032,7 +28224,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 6, + "line": 4, }, "start": Object { "column": 0, @@ -28041,7 +28233,7 @@ Object { }, "range": Array [ 0, - 199, + 85, ], "superClass": null, "type": "ClassDeclaration", @@ -28049,8 +28241,8 @@ Object { ], "loc": Object { "end": Object { - "column": 1, - "line": 6, + "column": 0, + "line": 5, }, "start": Object { "column": 0, @@ -28059,7 +28251,7 @@ Object { }, "range": Array [ 0, - 199, + 86, ], "sourceType": "script", "tokens": Array [ @@ -28120,7 +28312,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 5, "line": 2, }, "start": Object { @@ -28130,277 +28322,277 @@ Object { }, "range": Array [ 14, - 25, + 17, ], "type": "Identifier", - "value": "constructor", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 6, "line": 2, }, "start": Object { - "column": 13, + "column": 5, "line": 2, }, }, "range": Array [ - 25, - 26, + 17, + 18, ], "type": "Punctuator", - "value": "(", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 8, "line": 2, }, "start": Object { - "column": 14, + "column": 7, "line": 2, }, }, "range": Array [ - 26, - 32, + 19, + 20, ], - "type": "Keyword", - "value": "public", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 9, "line": 2, }, "start": Object { - "column": 21, + "column": 8, "line": 2, }, }, "range": Array [ - 33, - 42, + 20, + 21, ], - "type": "Identifier", - "value": "firstName", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 12, "line": 2, }, "start": Object { - "column": 30, + "column": 10, "line": 2, }, }, "range": Array [ - 42, - 43, + 22, + 24, ], "type": "Punctuator", - "value": ":", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 38, + "column": 20, "line": 2, }, "start": Object { - "column": 32, + "column": 13, "line": 2, }, }, "range": Array [ - 44, - 50, + 25, + 32, ], "type": "Identifier", - "value": "string", + "value": "boolean", }, Object { "loc": Object { "end": Object { - "column": 39, + "column": 22, "line": 2, }, "start": Object { - "column": 38, + "column": 21, "line": 2, }, }, "range": Array [ - 50, - 51, + 33, + 34, ], "type": "Punctuator", - "value": ",", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 3, + "column": 24, + "line": 2, }, "start": Object { - "column": 14, - "line": 3, + "column": 23, + "line": 2, }, }, "range": Array [ - 66, - 72, + 35, + 36, ], - "type": "Keyword", - "value": "public", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 3, + "column": 25, + "line": 2, }, "start": Object { - "column": 21, - "line": 3, + "column": 24, + "line": 2, }, }, "range": Array [ - 73, - 81, + 36, + 37, ], - "type": "Identifier", - "value": "readonly", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 38, - "line": 3, + "column": 26, + "line": 2, }, "start": Object { - "column": 30, - "line": 3, + "column": 25, + "line": 2, }, }, "range": Array [ - 82, - 90, + 37, + 38, ], - "type": "Identifier", - "value": "lastName", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 39, - "line": 3, + "column": 34, + "line": 2, }, "start": Object { - "column": 38, - "line": 3, + "column": 27, + "line": 2, }, }, "range": Array [ - 90, - 91, + 39, + 46, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "boolean", }, Object { "loc": Object { "end": Object { - "column": 46, - "line": 3, + "column": 37, + "line": 2, }, "start": Object { - "column": 40, - "line": 3, + "column": 35, + "line": 2, }, }, "range": Array [ - 92, - 98, + 47, + 49, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 47, - "line": 3, + "column": 42, + "line": 2, }, "start": Object { - "column": 46, - "line": 3, + "column": 38, + "line": 2, }, }, "range": Array [ - 98, - 99, + 50, + 54, ], - "type": "Punctuator", - "value": ",", + "type": "Boolean", + "value": "true", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 4, + "column": 43, + "line": 2, }, "start": Object { - "column": 14, - "line": 4, + "column": 42, + "line": 2, }, }, "range": Array [ - 114, - 120, + 54, + 55, ], - "type": "Keyword", - "value": "public", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 4, + "column": 5, + "line": 3, }, "start": Object { - "column": 21, - "line": 4, + "column": 2, + "line": 3, }, }, "range": Array [ - 121, - 124, + 58, + 61, ], "type": "Identifier", - "value": "age", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 4, + "column": 6, + "line": 3, }, "start": Object { - "column": 24, - "line": 4, + "column": 5, + "line": 3, }, }, "range": Array [ - 124, - 125, + 61, + 62, ], "type": "Punctuator", "value": ":", @@ -28408,35 +28600,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 32, - "line": 4, + "column": 13, + "line": 3, }, "start": Object { - "column": 26, - "line": 4, + "column": 7, + "line": 3, }, }, "range": Array [ - 126, - 132, + 63, + 69, ], "type": "Identifier", - "value": "number", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 4, + "column": 15, + "line": 3, }, "start": Object { - "column": 33, - "line": 4, + "column": 14, + "line": 3, }, }, "range": Array [ - 133, - 134, + 70, + 71, ], "type": "Punctuator", "value": "=", @@ -28444,233 +28636,107 @@ Object { Object { "loc": Object { "end": Object { - "column": 37, - "line": 4, - }, - "start": Object { - "column": 35, - "line": 4, - }, - }, - "range": Array [ - 135, - 137, - ], - "type": "Numeric", - "value": "30", - }, - Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 4, + "column": 17, + "line": 3, }, "start": Object { - "column": 37, - "line": 4, + "column": 16, + "line": 3, }, }, "range": Array [ - 137, - 138, + 72, + 73, ], "type": "Punctuator", - "value": ",", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 5, + "column": 18, + "line": 3, }, "start": Object { - "column": 14, - "line": 5, + "column": 17, + "line": 3, }, }, "range": Array [ - 153, - 159, + 73, + 74, ], - "type": "Keyword", - "value": "public", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 5, - }, - "start": Object { "column": 21, - "line": 5, - }, - }, - "range": Array [ - 160, - 168, - ], - "type": "Identifier", - "value": "readonly", - }, - Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 5, - }, - "start": Object { - "column": 30, - "line": 5, - }, - }, - "range": Array [ - 169, - 176, - ], - "type": "Identifier", - "value": "student", - }, - Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 5, + "line": 3, }, "start": Object { - "column": 37, - "line": 5, + "column": 19, + "line": 3, }, }, "range": Array [ - 176, - 177, + 75, + 77, ], "type": "Punctuator", - "value": ":", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 46, - "line": 5, + "column": 26, + "line": 3, }, "start": Object { - "column": 39, - "line": 5, + "column": 22, + "line": 3, }, }, "range": Array [ - 178, - 185, + 78, + 82, ], "type": "Identifier", - "value": "boolean", - }, - Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 5, - }, - "start": Object { - "column": 47, - "line": 5, - }, - }, - "range": Array [ - 186, - 187, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 54, - "line": 5, - }, - "start": Object { - "column": 49, - "line": 5, - }, - }, - "range": Array [ - 188, - 193, - ], - "type": "Boolean", - "value": "false", - }, - Object { - "loc": Object { - "end": Object { - "column": 55, - "line": 5, - }, - "start": Object { - "column": 54, - "line": 5, - }, - }, - "range": Array [ - 193, - 194, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 57, - "line": 5, - }, - "start": Object { - "column": 56, - "line": 5, - }, - }, - "range": Array [ - 195, - 196, - ], - "type": "Punctuator", - "value": "{", + "value": "test", }, Object { "loc": Object { "end": Object { - "column": 58, - "line": 5, + "column": 27, + "line": 3, }, "start": Object { - "column": 57, - "line": 5, + "column": 26, + "line": 3, }, }, "range": Array [ - 196, - 197, + 82, + 83, ], "type": "Punctuator", - "value": "}", + "value": ";", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 6, + "line": 4, }, "start": Object { "column": 0, - "line": 6, + "line": 4, }, }, "range": Array [ - 198, - 199, + 84, + 85, ], "type": "Punctuator", "value": "}", @@ -28680,7 +28746,7 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-readonly-parameter-properties.src 1`] = ` +exports[`typescript fixtures/basics/class-with-property-values.src 1`] = ` Object { "body": Array [ Object { @@ -28688,10 +28754,11 @@ Object { "body": Array [ Object { "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { - "column": 13, + "column": 3, "line": 2, }, "start": Object { @@ -28699,18 +28766,17 @@ Object { "line": 2, }, }, - "name": "constructor", + "name": "a", "range": Array [ 14, - 25, + 15, ], "type": "Identifier", }, - "kind": "constructor", "loc": Object { "end": Object { - "column": 53, - "line": 3, + "column": 8, + "line": 2, }, "start": Object { "column": 2, @@ -28719,233 +28785,353 @@ Object { }, "range": Array [ 14, - 107, + 20, ], "static": false, - "type": "MethodDefinition", + "type": "ClassProperty", "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 53, - "line": 3, - }, - "start": Object { - "column": 51, - "line": 3, - }, + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, }, - "range": Array [ - 105, - 107, - ], - "type": "BlockStatement", }, - "expression": false, - "generator": false, - "id": null, + "range": Array [ + 18, + 19, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + }, + Object { + "computed": false, + "declare": false, + "key": Object { "loc": Object { "end": Object { - "column": 53, + "column": 3, "line": 3, }, "start": Object { - "column": 13, - "line": 2, + "column": 2, + "line": 3, }, }, - "params": Array [ + "name": "b", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 23, + 30, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "properties": Array [], + "range": Array [ + 27, + 29, + ], + "type": "ObjectExpression", + }, + }, + Object { + "computed": false, + "declare": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "name": "c", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 33, + 40, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 4, + }, + }, + "range": Array [ + 37, + 39, + ], + "type": "ArrayExpression", + }, + }, + Object { + "computed": false, + "declare": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "name": "d", + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 43, + 50, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "range": Array [ + 47, + 49, + ], + "raw": "\\"\\"", + "type": "Literal", + "value": "", + }, + }, + Object { + "computed": false, + "declare": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "name": "e", + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 53, + 80, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "arguments": Array [ Object { - "loc": Object { - "end": Object { - "column": 40, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "parameter": Object { - "loc": Object { - "end": Object { - "column": 40, - "line": 2, - }, - "start": Object { - "column": 23, - "line": 2, - }, - }, - "name": "firstName", - "range": Array [ - 35, - 52, - ], - "type": "Identifier", - "typeAnnotation": Object { + "elements": Array [ + Object { "loc": Object { "end": Object { - "column": 40, - "line": 2, + "column": 19, + "line": 6, }, "start": Object { - "column": 32, - "line": 2, + "column": 17, + "line": 6, }, }, + "properties": Array [], "range": Array [ - 44, - 52, + 68, + 70, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 40, - "line": 2, - }, - "start": Object { - "column": 34, - "line": 2, - }, - }, - "range": Array [ - 46, - 52, - ], - "type": "TSStringKeyword", - }, - }, - }, - "range": Array [ - 26, - 52, - ], - "readonly": true, - "type": "TSParameterProperty", - }, - Object { - "loc": Object { - "end": Object { - "column": 49, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, + "type": "ObjectExpression", }, - }, - "parameter": Object { - "left": Object { + Object { + "elements": Array [], "loc": Object { "end": Object { - "column": 39, - "line": 3, + "column": 23, + "line": 6, }, "start": Object { - "column": 23, - "line": 3, + "column": 21, + "line": 6, }, }, - "name": "lastName", "range": Array [ - 77, - 93, + 72, + 74, ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 3, - }, - "start": Object { - "column": 31, - "line": 3, - }, - }, - "range": Array [ - 85, - 93, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 3, - }, - "start": Object { - "column": 33, - "line": 3, - }, - }, - "range": Array [ - 87, - 93, - ], - "type": "TSStringKeyword", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 49, - "line": 3, - }, - "start": Object { - "column": 23, - "line": 3, - }, + "type": "ArrayExpression", }, - "range": Array [ - 77, - 103, - ], - "right": Object { + Object { "loc": Object { "end": Object { - "column": 49, - "line": 3, + "column": 26, + "line": 6, }, "start": Object { - "column": 42, - "line": 3, + "column": 25, + "line": 6, }, }, "range": Array [ - 96, - 103, + 76, + 77, ], - "raw": "'Smith'", + "raw": "2", "type": "Literal", - "value": "Smith", + "value": 2, + }, + ], + "loc": Object { + "end": Object { + "column": 27, + "line": 6, + }, + "start": Object { + "column": 16, + "line": 6, }, - "type": "AssignmentPattern", }, "range": Array [ - 68, - 103, + 67, + 78, ], - "readonly": true, - "type": "TSParameterProperty", + "type": "ArrayExpression", }, ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 6, + }, + "start": Object { + "column": 10, + "line": 6, + }, + }, + "name": "Array", + "range": Array [ + 61, + 66, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 6, + }, + "start": Object { + "column": 6, + "line": 6, + }, + }, "range": Array [ - 25, - 107, + 57, + 79, ], - "type": "FunctionExpression", + "type": "NewExpression", }, }, ], "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 7, }, "start": Object { "column": 10, @@ -28954,7 +29140,7 @@ Object { }, "range": Array [ 10, - 109, + 82, ], "type": "ClassBody", }, @@ -28979,7 +29165,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 7, }, "start": Object { "column": 0, @@ -28988,7 +29174,7 @@ Object { }, "range": Array [ 0, - 109, + 82, ], "superClass": null, "type": "ClassDeclaration", @@ -28996,8 +29182,8 @@ Object { ], "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 0, + "line": 8, }, "start": Object { "column": 0, @@ -29006,7 +29192,7 @@ Object { }, "range": Array [ 0, - 109, + 83, ], "sourceType": "script", "tokens": Array [ @@ -29067,7 +29253,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 3, "line": 2, }, "start": Object { @@ -29077,487 +29263,439 @@ Object { }, "range": Array [ 14, - 25, + 15, ], "type": "Identifier", - "value": "constructor", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 5, "line": 2, }, "start": Object { - "column": 13, + "column": 4, "line": 2, }, }, "range": Array [ - 25, - 26, + 16, + 17, ], "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 7, "line": 2, }, "start": Object { - "column": 14, + "column": 6, "line": 2, }, }, "range": Array [ - 26, - 34, + 18, + 19, ], - "type": "Identifier", - "value": "readonly", + "type": "Numeric", + "value": "2", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 8, "line": 2, }, "start": Object { - "column": 23, + "column": 7, "line": 2, }, }, "range": Array [ - 35, - 44, + 19, + 20, ], - "type": "Identifier", - "value": "firstName", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 2, + "column": 3, + "line": 3, }, "start": Object { - "column": 32, - "line": 2, + "column": 2, + "line": 3, }, }, "range": Array [ - 44, - 45, + 23, + 24, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 40, - "line": 2, + "column": 5, + "line": 3, }, "start": Object { - "column": 34, - "line": 2, + "column": 4, + "line": 3, }, }, "range": Array [ - 46, - 52, + 25, + 26, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 2, + "column": 7, + "line": 3, }, "start": Object { - "column": 40, - "line": 2, + "column": 6, + "line": 3, }, }, "range": Array [ - 52, - 53, + 27, + 28, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 8, "line": 3, }, "start": Object { - "column": 14, + "column": 7, "line": 3, }, }, "range": Array [ - 68, - 76, + 28, + 29, ], - "type": "Identifier", - "value": "readonly", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 9, "line": 3, }, "start": Object { - "column": 23, + "column": 8, "line": 3, }, }, "range": Array [ - 77, - 85, + 29, + 30, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 33, + 34, ], "type": "Identifier", - "value": "lastName", + "value": "c", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 3, + "column": 5, + "line": 4, }, "start": Object { - "column": 31, - "line": 3, + "column": 4, + "line": 4, }, }, "range": Array [ - 85, - 86, + 35, + 36, ], "type": "Punctuator", - "value": ":", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 39, - "line": 3, + "column": 7, + "line": 4, }, "start": Object { - "column": 33, - "line": 3, + "column": 6, + "line": 4, }, }, "range": Array [ - 87, - 93, + 37, + 38, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 3, + "column": 8, + "line": 4, }, "start": Object { - "column": 40, - "line": 3, + "column": 7, + "line": 4, }, }, "range": Array [ - 94, - 95, + 38, + 39, ], "type": "Punctuator", - "value": "=", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 49, - "line": 3, + "column": 9, + "line": 4, }, "start": Object { - "column": 42, - "line": 3, + "column": 8, + "line": 4, }, }, "range": Array [ - 96, - 103, + 39, + 40, ], - "type": "String", - "value": "'Smith'", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 50, - "line": 3, + "column": 3, + "line": 5, }, "start": Object { - "column": 49, - "line": 3, + "column": 2, + "line": 5, }, }, "range": Array [ - 103, - 104, + 43, + 44, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "d", }, Object { "loc": Object { "end": Object { - "column": 52, - "line": 3, + "column": 5, + "line": 5, }, "start": Object { - "column": 51, - "line": 3, + "column": 4, + "line": 5, }, }, "range": Array [ - 105, - 106, + 45, + 46, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 53, - "line": 3, + "column": 8, + "line": 5, }, "start": Object { - "column": 52, - "line": 3, + "column": 6, + "line": 5, }, }, "range": Array [ - 106, - 107, + 47, + 49, ], - "type": "Punctuator", - "value": "}", + "type": "String", + "value": "\\"\\"", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 9, + "line": 5, }, "start": Object { - "column": 0, - "line": 4, + "column": 8, + "line": 5, }, }, "range": Array [ - 108, - 109, + 49, + 50, ], "type": "Punctuator", - "value": "}", + "value": ";", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-with-readonly-property.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "accessibility": "public", - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 20, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 32, - 35, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 35, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 16, - 47, - ], - "readonly": true, - "static": false, - "type": "ClassProperty", - "value": Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 2, - }, - "start": Object { - "column": 26, - "line": 2, - }, - }, - "range": Array [ - 38, - 46, - ], - "raw": "'string'", - "type": "Literal", - "value": "string", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 3, + "line": 6, }, - "range": Array [ - 10, - 49, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, + "start": Object { + "column": 2, + "line": 6, }, - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", }, + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + "value": "e", + }, + Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 5, + "line": 6, }, "start": Object { - "column": 0, - "line": 1, + "column": 4, + "line": 6, }, }, "range": Array [ - 0, - 49, + 55, + 56, ], - "superClass": null, - "type": "ClassDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "=", }, - }, - "range": Array [ - 0, - 50, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 9, + "line": 6, }, "start": Object { - "column": 0, - "line": 1, + "column": 6, + "line": 6, }, }, "range": Array [ - 0, - 5, + 57, + 60, ], "type": "Keyword", - "value": "class", + "value": "new", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 15, + "line": 6, }, "start": Object { - "column": 6, - "line": 1, + "column": 10, + "line": 6, }, }, "range": Array [ - 6, - 9, + 61, + 66, ], "type": "Identifier", - "value": "Foo", + "value": "Array", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 16, + "line": 6, }, "start": Object { - "column": 10, - "line": 1, + "column": 15, + "line": 6, }, }, "range": Array [ - 10, - 11, + 66, + 67, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 6, + }, + "start": Object { + "column": 16, + "line": 6, + }, + }, + "range": Array [ + 67, + 68, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 6, + }, + "start": Object { + "column": 17, + "line": 6, + }, + }, + "range": Array [ + 68, + 69, ], "type": "Punctuator", "value": "{", @@ -29565,107 +29703,161 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 19, + "line": 6, }, "start": Object { - "column": 4, - "line": 2, + "column": 18, + "line": 6, }, }, "range": Array [ - 16, - 22, + 69, + 70, ], - "type": "Keyword", - "value": "public", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { + "column": 20, + "line": 6, + }, + "start": Object { "column": 19, - "line": 2, + "line": 6, + }, + }, + "range": Array [ + 70, + 71, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 6, }, "start": Object { - "column": 11, - "line": 2, + "column": 21, + "line": 6, }, }, "range": Array [ - 23, - 31, + 72, + 73, ], - "type": "Identifier", - "value": "readonly", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { "column": 23, - "line": 2, + "line": 6, }, "start": Object { - "column": 20, - "line": 2, + "column": 22, + "line": 6, }, }, "range": Array [ - 32, - 35, + 73, + 74, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 24, + "line": 6, }, "start": Object { - "column": 24, - "line": 2, + "column": 23, + "line": 6, }, }, "range": Array [ - 36, - 37, + 74, + 75, ], "type": "Punctuator", - "value": "=", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 2, + "column": 26, + "line": 6, + }, + "start": Object { + "column": 25, + "line": 6, + }, + }, + "range": Array [ + 76, + 77, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 6, }, "start": Object { "column": 26, - "line": 2, + "line": 6, }, }, "range": Array [ - 38, - 46, + 77, + 78, ], - "type": "String", - "value": "'string'", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 2, + "column": 28, + "line": 6, }, "start": Object { - "column": 34, - "line": 2, + "column": 27, + "line": 6, }, }, "range": Array [ - 46, - 47, + 78, + 79, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 6, + }, + "start": Object { + "column": 28, + "line": 6, + }, + }, + "range": Array [ + 79, + 80, ], "type": "Punctuator", "value": ";", @@ -29674,16 +29866,16 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 7, }, "start": Object { "column": 0, - "line": 3, + "line": 7, }, }, "range": Array [ - 48, - 49, + 81, + 82, ], "type": "Punctuator", "value": "}", @@ -29693,7 +29885,7 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-static-parameter-properties.src 1`] = ` +exports[`typescript fixtures/basics/class-with-protected-parameter-properties.src 1`] = ` Object { "body": Array [ Object { @@ -29704,35 +29896,35 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 15, + "column": 13, "line": 2, }, "start": Object { - "column": 4, + "column": 2, "line": 2, }, }, "name": "constructor", "range": Array [ - 16, - 27, + 14, + 25, ], "type": "Identifier", }, "kind": "constructor", "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 61, + "line": 5, }, "start": Object { - "column": 4, + "column": 2, "line": 2, }, }, "range": Array [ - 16, - 54, + 14, + 209, ], "static": false, "type": "MethodDefinition", @@ -29742,17 +29934,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 61, + "line": 5, }, "start": Object { - "column": 34, - "line": 2, + "column": 59, + "line": 5, }, }, "range": Array [ - 46, - 54, + 207, + 209, ], "type": "BlockStatement", }, @@ -29761,89 +29953,373 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 61, + "line": 5, }, "start": Object { - "column": 15, + "column": 13, "line": 2, }, }, "params": Array [ Object { + "accessibility": "protected", "loc": Object { "end": Object { - "column": 32, + "column": 41, "line": 2, }, "start": Object { - "column": 16, + "column": 14, "line": 2, }, }, "parameter": Object { "loc": Object { "end": Object { - "column": 32, + "column": 41, "line": 2, }, "start": Object { - "column": 23, + "column": 24, "line": 2, }, }, - "name": "a", + "name": "firstName", "range": Array [ - 35, - 44, + 36, + 53, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 32, + "column": 41, "line": 2, }, "start": Object { - "column": 24, + "column": 33, "line": 2, }, }, "range": Array [ - 36, - 44, + 45, + 53, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 32, + "column": 41, "line": 2, }, "start": Object { - "column": 26, + "column": 35, "line": 2, }, }, "range": Array [ - 38, - 44, + 47, + 53, ], "type": "TSStringKeyword", }, }, }, "range": Array [ - 28, - 44, + 26, + 53, ], - "static": true, + "type": "TSParameterProperty", + }, + Object { + "accessibility": "protected", + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 3, + }, + }, + "name": "lastName", + "range": Array [ + 88, + 104, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 41, + "line": 3, + }, + }, + "range": Array [ + 96, + 104, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 43, + "line": 3, + }, + }, + "range": Array [ + 98, + 104, + ], + "type": "TSStringKeyword", + }, + }, + }, + "range": Array [ + 69, + 104, + ], + "readonly": true, + "type": "TSParameterProperty", + }, + Object { + "accessibility": "protected", + "loc": Object { + "end": Object { + "column": 40, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "parameter": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 4, + }, + "start": Object { + "column": 24, + "line": 4, + }, + }, + "name": "age", + "range": Array [ + 130, + 141, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 4, + }, + "start": Object { + "column": 27, + "line": 4, + }, + }, + "range": Array [ + 133, + 141, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 4, + }, + "start": Object { + "column": 29, + "line": 4, + }, + }, + "range": Array [ + 135, + 141, + ], + "type": "TSNumberKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 40, + "line": 4, + }, + "start": Object { + "column": 24, + "line": 4, + }, + }, + "range": Array [ + 130, + 146, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 4, + }, + "start": Object { + "column": 38, + "line": 4, + }, + }, + "range": Array [ + 144, + 146, + ], + "raw": "30", + "type": "Literal", + "value": 30, + }, + "type": "AssignmentPattern", + }, + "range": Array [ + 120, + 146, + ], + "type": "TSParameterProperty", + }, + Object { + "accessibility": "protected", + "loc": Object { + "end": Object { + "column": 57, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "parameter": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 5, + }, + "start": Object { + "column": 33, + "line": 5, + }, + }, + "name": "student", + "range": Array [ + 181, + 197, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 5, + }, + "start": Object { + "column": 40, + "line": 5, + }, + }, + "range": Array [ + 188, + 197, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 5, + }, + "start": Object { + "column": 42, + "line": 5, + }, + }, + "range": Array [ + 190, + 197, + ], + "type": "TSBooleanKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 57, + "line": 5, + }, + "start": Object { + "column": 33, + "line": 5, + }, + }, + "range": Array [ + 181, + 205, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 5, + }, + "start": Object { + "column": 52, + "line": 5, + }, + }, + "range": Array [ + 200, + 205, + ], + "raw": "false", + "type": "Literal", + "value": false, + }, + "type": "AssignmentPattern", + }, + "range": Array [ + 162, + 205, + ], + "readonly": true, "type": "TSParameterProperty", }, ], "range": Array [ - 27, - 54, + 25, + 209, ], "type": "FunctionExpression", }, @@ -29852,7 +30328,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 6, }, "start": Object { "column": 10, @@ -29861,7 +30337,7 @@ Object { }, "range": Array [ 10, - 56, + 211, ], "type": "ClassBody", }, @@ -29886,7 +30362,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 6, }, "start": Object { "column": 0, @@ -29895,7 +30371,7 @@ Object { }, "range": Array [ 0, - 56, + 211, ], "superClass": null, "type": "ClassDeclaration", @@ -29903,8 +30379,8 @@ Object { ], "loc": Object { "end": Object { - "column": 0, - "line": 8, + "column": 1, + "line": 6, }, "start": Object { "column": 0, @@ -29913,7 +30389,7 @@ Object { }, "range": Array [ 0, - 59, + 211, ], "sourceType": "script", "tokens": Array [ @@ -29974,17 +30450,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 13, "line": 2, }, "start": Object { - "column": 4, + "column": 2, "line": 2, }, }, "range": Array [ - 16, - 27, + 14, + 25, ], "type": "Identifier", "value": "constructor", @@ -29992,17 +30468,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 14, "line": 2, }, "start": Object { - "column": 15, + "column": 13, "line": 2, }, }, "range": Array [ - 27, - 28, + 25, + 26, ], "type": "Punctuator", "value": "(", @@ -30010,53 +30486,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, + "column": 23, "line": 2, }, "start": Object { - "column": 16, + "column": 14, "line": 2, }, }, "range": Array [ - 28, - 34, + 26, + 35, ], "type": "Keyword", - "value": "static", + "value": "protected", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 33, "line": 2, }, "start": Object { - "column": 23, + "column": 24, "line": 2, }, }, "range": Array [ - 35, 36, + 45, ], "type": "Identifier", - "value": "a", + "value": "firstName", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 34, "line": 2, }, "start": Object { - "column": 24, + "column": 33, "line": 2, }, }, "range": Array [ - 36, - 37, + 45, + 46, ], "type": "Punctuator", "value": ":", @@ -30064,17 +30540,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 32, + "column": 41, "line": 2, }, "start": Object { - "column": 26, + "column": 35, "line": 2, }, }, "range": Array [ - 38, - 44, + 47, + 53, ], "type": "Identifier", "value": "string", @@ -30082,81 +30558,459 @@ Object { Object { "loc": Object { "end": Object { - "column": 33, + "column": 42, "line": 2, }, "start": Object { - "column": 32, + "column": 41, "line": 2, }, }, "range": Array [ - 44, - 45, + 53, + 54, ], "type": "Punctuator", - "value": ")", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 69, + 78, + ], + "type": "Keyword", + "value": "protected", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "range": Array [ + 79, + 87, + ], + "type": "Identifier", + "value": "readonly", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 3, + }, + }, + "range": Array [ + 88, + 96, + ], + "type": "Identifier", + "value": "lastName", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 3, + }, + "start": Object { + "column": 41, + "line": 3, + }, + }, + "range": Array [ + 96, + 97, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 43, + "line": 3, + }, + }, + "range": Array [ + 98, + 104, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 3, + }, + "start": Object { + "column": 49, + "line": 3, + }, + }, + "range": Array [ + 104, + 105, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "range": Array [ + 120, + 129, + ], + "type": "Keyword", + "value": "protected", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 24, + "line": 4, + }, + }, + "range": Array [ + 130, + 133, + ], + "type": "Identifier", + "value": "age", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 4, + }, + "start": Object { + "column": 27, + "line": 4, + }, + }, + "range": Array [ + 133, + 134, + ], + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { "column": 35, - "line": 2, + "line": 4, }, "start": Object { - "column": 34, - "line": 2, + "column": 29, + "line": 4, }, }, "range": Array [ - 46, - 47, + 135, + 141, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 4, + }, + "start": Object { + "column": 36, + "line": 4, + }, + }, + "range": Array [ + 142, + 143, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 40, "line": 4, }, "start": Object { - "column": 4, + "column": 38, "line": 4, }, }, "range": Array [ - 53, - 54, + 144, + 146, + ], + "type": "Numeric", + "value": "30", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 4, + }, + "start": Object { + "column": 40, + "line": 4, + }, + }, + "range": Array [ + 146, + 147, ], "type": "Punctuator", - "value": "}", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 1, + "column": 23, "line": 5, }, "start": Object { - "column": 0, + "column": 14, "line": 5, }, }, "range": Array [ - 55, - 56, + 162, + 171, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "protected", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-with-two-methods-computed-constructor.src 1`] = ` + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 5, + }, + "start": Object { + "column": 24, + "line": 5, + }, + }, + "range": Array [ + 172, + 180, + ], + "type": "Identifier", + "value": "readonly", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 5, + }, + "start": Object { + "column": 33, + "line": 5, + }, + }, + "range": Array [ + 181, + 188, + ], + "type": "Identifier", + "value": "student", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 5, + }, + "start": Object { + "column": 40, + "line": 5, + }, + }, + "range": Array [ + 188, + 189, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 5, + }, + "start": Object { + "column": 42, + "line": 5, + }, + }, + "range": Array [ + 190, + 197, + ], + "type": "Identifier", + "value": "boolean", + }, + Object { + "loc": Object { + "end": Object { + "column": 51, + "line": 5, + }, + "start": Object { + "column": 50, + "line": 5, + }, + }, + "range": Array [ + 198, + 199, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 5, + }, + "start": Object { + "column": 52, + "line": 5, + }, + }, + "range": Array [ + 200, + 205, + ], + "type": "Boolean", + "value": "false", + }, + Object { + "loc": Object { + "end": Object { + "column": 58, + "line": 5, + }, + "start": Object { + "column": 57, + "line": 5, + }, + }, + "range": Array [ + 205, + 206, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 60, + "line": 5, + }, + "start": Object { + "column": 59, + "line": 5, + }, + }, + "range": Array [ + 207, + 208, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 61, + "line": 5, + }, + "start": Object { + "column": 60, + "line": 5, + }, + }, + "range": Array [ + 208, + 209, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "range": Array [ + 210, + 211, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-public-parameter-properties.src 1`] = ` Object { "body": Array [ Object { @@ -30167,7 +31021,7 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 15, + "column": 13, "line": 2, }, "start": Object { @@ -30175,19 +31029,18 @@ Object { "line": 2, }, }, + "name": "constructor", "range": Array [ - 12, + 14, 25, ], - "raw": "\\"constructor\\"", - "type": "Literal", - "value": "constructor", + "type": "Identifier", }, "kind": "constructor", "loc": Object { "end": Object { - "column": 3, - "line": 3, + "column": 58, + "line": 5, }, "start": Object { "column": 2, @@ -30195,8 +31048,8 @@ Object { }, }, "range": Array [ - 12, - 44, + 14, + 197, ], "static": false, "type": "MethodDefinition", @@ -30206,17 +31059,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 3, - "line": 3, + "column": 58, + "line": 5, }, "start": Object { - "column": 29, - "line": 2, + "column": 56, + "line": 5, }, }, "range": Array [ - 39, - 44, + 195, + 197, ], "type": "BlockStatement", }, @@ -30225,298 +31078,398 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 3, - "line": 3, + "column": 58, + "line": 5, }, "start": Object { - "column": 15, + "column": 13, "line": 2, }, }, - "params": Array [], - "range": Array [ - 25, - 44, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 2, - }, - "start": Object { - "column": 20, - "line": 2, - }, - }, - "range": Array [ - 30, - 38, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "params": Array [ + Object { + "accessibility": "public", "loc": Object { "end": Object { - "column": 28, + "column": 38, "line": 2, }, "start": Object { - "column": 22, + "column": 14, "line": 2, }, }, - "range": Array [ - 32, - 38, - ], - "type": "TSNumberKeyword", - }, - }, - "type": "FunctionExpression", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 2, - }, - "start": Object { - "column": 15, - "line": 2, - }, - }, - "params": Array [ - Object { + "parameter": Object { "loc": Object { "end": Object { - "column": 17, + "column": 38, "line": 2, }, "start": Object { - "column": 16, + "column": 21, "line": 2, }, }, - "name": Object { + "name": "firstName", + "range": Array [ + 33, + 50, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 17, + "column": 38, "line": 2, }, "start": Object { - "column": 16, + "column": 30, "line": 2, }, }, - "name": "T", "range": Array [ - 26, - 27, + 42, + 50, ], - "type": "Identifier", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 32, + "line": 2, + }, + }, + "range": Array [ + 44, + 50, + ], + "type": "TSStringKeyword", + }, }, - "range": Array [ - 26, - 27, - ], - "type": "TSTypeParameter", }, - ], - "range": Array [ - 25, - 28, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - }, - Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 5, - }, - "start": Object { - "column": 3, - "line": 5, + "range": Array [ + 26, + 50, + ], + "type": "TSParameterProperty", }, - }, - "range": Array [ - 49, - 62, - ], - "raw": "\\"constructor\\"", - "type": "Literal", - "value": "constructor", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 3, - "line": 6, - }, - "start": Object { - "column": 2, - "line": 5, - }, - }, - "range": Array [ - 48, - 82, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 3, - "line": 6, + Object { + "accessibility": "public", + "loc": Object { + "end": Object { + "column": 46, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, }, - "start": Object { - "column": 31, - "line": 5, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 3, + }, + "start": Object { + "column": 30, + "line": 3, + }, + }, + "name": "lastName", + "range": Array [ + 82, + 98, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 3, + }, + "start": Object { + "column": 38, + "line": 3, + }, + }, + "range": Array [ + 90, + 98, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 3, + }, + "start": Object { + "column": 40, + "line": 3, + }, + }, + "range": Array [ + 92, + 98, + ], + "type": "TSStringKeyword", + }, + }, }, + "range": Array [ + 66, + 98, + ], + "readonly": true, + "type": "TSParameterProperty", }, - "range": Array [ - 77, - 82, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 3, - "line": 6, - }, - "start": Object { - "column": 17, - "line": 5, - }, - }, - "params": Array [], - "range": Array [ - 63, - 82, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 5, + Object { + "accessibility": "public", + "loc": Object { + "end": Object { + "column": 37, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, }, - "start": Object { - "column": 22, - "line": 5, + "parameter": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 4, + }, + "start": Object { + "column": 21, + "line": 4, + }, + }, + "name": "age", + "range": Array [ + 121, + 132, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 4, + }, + "start": Object { + "column": 24, + "line": 4, + }, + }, + "range": Array [ + 124, + 132, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 4, + }, + "start": Object { + "column": 26, + "line": 4, + }, + }, + "range": Array [ + 126, + 132, + ], + "type": "TSNumberKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 4, + }, + "start": Object { + "column": 21, + "line": 4, + }, + }, + "range": Array [ + 121, + 137, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 4, + }, + "start": Object { + "column": 35, + "line": 4, + }, + }, + "range": Array [ + 135, + 137, + ], + "raw": "30", + "type": "Literal", + "value": 30, + }, + "type": "AssignmentPattern", }, + "range": Array [ + 114, + 137, + ], + "type": "TSParameterProperty", }, - "range": Array [ - 68, - 76, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + Object { + "accessibility": "public", "loc": Object { "end": Object { - "column": 30, + "column": 54, "line": 5, }, "start": Object { - "column": 24, + "column": 14, "line": 5, }, }, - "range": Array [ - 70, - 76, - ], - "type": "TSNumberKeyword", - }, - }, - "type": "FunctionExpression", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 5, - }, - "start": Object { - "column": 17, - "line": 5, - }, - }, - "params": Array [ - Object { + "parameter": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 5, + }, + "start": Object { + "column": 30, + "line": 5, + }, + }, + "name": "student", + "range": Array [ + 169, + 185, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 5, + }, + "start": Object { + "column": 37, + "line": 5, + }, + }, + "range": Array [ + 176, + 185, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 5, + }, + "start": Object { + "column": 39, + "line": 5, + }, + }, + "range": Array [ + 178, + 185, + ], + "type": "TSBooleanKeyword", + }, + }, + }, "loc": Object { "end": Object { - "column": 19, + "column": 54, "line": 5, }, "start": Object { - "column": 18, + "column": 30, "line": 5, }, }, - "name": Object { + "range": Array [ + 169, + 193, + ], + "right": Object { "loc": Object { "end": Object { - "column": 19, + "column": 54, "line": 5, }, "start": Object { - "column": 18, + "column": 49, "line": 5, }, }, - "name": "T", "range": Array [ - 64, - 65, + 188, + 193, ], - "type": "Identifier", + "raw": "false", + "type": "Literal", + "value": false, }, - "range": Array [ - 64, - 65, - ], - "type": "TSTypeParameter", + "type": "AssignmentPattern", }, - ], - "range": Array [ - 63, - 66, - ], - "type": "TSTypeParameterDeclaration", - }, + "range": Array [ + 153, + 193, + ], + "readonly": true, + "type": "TSParameterProperty", + }, + ], + "range": Array [ + 25, + 197, + ], + "type": "FunctionExpression", }, }, ], "loc": Object { "end": Object { "column": 1, - "line": 7, + "line": 6, }, "start": Object { - "column": 8, + "column": 10, "line": 1, }, }, "range": Array [ - 8, - 84, + 10, + 199, ], "type": "ClassBody", }, "id": Object { "loc": Object { "end": Object { - "column": 7, + "column": 9, "line": 1, }, "start": Object { @@ -30524,17 +31477,17 @@ Object { "line": 1, }, }, - "name": "A", + "name": "Foo", "range": Array [ 6, - 7, + 9, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 7, + "line": 6, }, "start": Object { "column": 0, @@ -30543,33 +31496,16 @@ Object { }, "range": Array [ 0, - 84, + 199, ], "superClass": null, "type": "ClassDeclaration", }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 7, - }, - "start": Object { - "column": 1, - "line": 7, - }, - }, - "range": Array [ - 84, - 85, - ], - "type": "EmptyStatement", - }, ], "loc": Object { "end": Object { - "column": 0, - "line": 8, + "column": 1, + "line": 6, }, "start": Object { "column": 0, @@ -30578,7 +31514,7 @@ Object { }, "range": Array [ 0, - 86, + 199, ], "sourceType": "script", "tokens": Array [ @@ -30603,7 +31539,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 9, "line": 1, }, "start": Object { @@ -30613,25 +31549,25 @@ Object { }, "range": Array [ 6, - 7, + 9, ], "type": "Identifier", - "value": "A", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 11, "line": 1, }, "start": Object { - "column": 8, + "column": 10, "line": 1, }, }, "range": Array [ - 8, - 9, + 10, + 11, ], "type": "Punctuator", "value": "{", @@ -30639,7 +31575,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 13, "line": 2, }, "start": Object { @@ -30648,20 +31584,20 @@ Object { }, }, "range": Array [ - 12, + 14, 25, ], - "type": "String", - "value": "\\"constructor\\"", + "type": "Identifier", + "value": "constructor", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 14, "line": 2, }, "start": Object { - "column": 15, + "column": 13, "line": 2, }, }, @@ -30670,659 +31606,526 @@ Object { 26, ], "type": "Punctuator", - "value": "<", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 20, "line": 2, }, "start": Object { - "column": 16, + "column": 14, "line": 2, }, }, "range": Array [ 26, - 27, + 32, ], - "type": "Identifier", - "value": "T", + "type": "Keyword", + "value": "public", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 30, "line": 2, }, "start": Object { - "column": 17, + "column": 21, "line": 2, }, }, "range": Array [ - 27, - 28, + 33, + 42, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "firstName", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 31, "line": 2, }, "start": Object { - "column": 18, + "column": 30, "line": 2, }, }, "range": Array [ - 28, - 29, + 42, + 43, ], "type": "Punctuator", - "value": "(", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 38, "line": 2, }, "start": Object { - "column": 19, + "column": 32, "line": 2, }, }, "range": Array [ - 29, - 30, + 44, + 50, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 39, "line": 2, }, "start": Object { - "column": 20, + "column": 38, "line": 2, }, }, "range": Array [ - 30, - 31, + 50, + 51, ], "type": "Punctuator", - "value": ":", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 2, + "column": 20, + "line": 3, }, "start": Object { - "column": 22, - "line": 2, + "column": 14, + "line": 3, }, }, "range": Array [ - 32, - 38, + 66, + 72, ], - "type": "Identifier", - "value": "number", + "type": "Keyword", + "value": "public", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 2, + "column": 29, + "line": 3, }, "start": Object { - "column": 29, - "line": 2, + "column": 21, + "line": 3, }, }, "range": Array [ - 39, - 40, + 73, + 81, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "readonly", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 38, "line": 3, }, "start": Object { - "column": 2, + "column": 30, "line": 3, }, }, "range": Array [ - 43, - 44, + 82, + 90, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "lastName", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 5, + "column": 39, + "line": 3, }, "start": Object { - "column": 2, - "line": 5, + "column": 38, + "line": 3, }, }, "range": Array [ - 48, - 49, + 90, + 91, ], "type": "Punctuator", - "value": "[", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 5, + "column": 46, + "line": 3, }, "start": Object { - "column": 3, - "line": 5, + "column": 40, + "line": 3, }, }, "range": Array [ - 49, - 62, + 92, + 98, ], - "type": "String", - "value": "\\"constructor\\"", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 5, + "column": 47, + "line": 3, }, "start": Object { - "column": 16, - "line": 5, + "column": 46, + "line": 3, }, }, "range": Array [ - 62, - 63, + 98, + 99, ], "type": "Punctuator", - "value": "]", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 5, + "column": 20, + "line": 4, }, "start": Object { - "column": 17, - "line": 5, + "column": 14, + "line": 4, }, }, "range": Array [ - 63, - 64, + 114, + 120, ], - "type": "Punctuator", - "value": "<", + "type": "Keyword", + "value": "public", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 5, + "column": 24, + "line": 4, }, "start": Object { - "column": 18, - "line": 5, + "column": 21, + "line": 4, }, }, "range": Array [ - 64, - 65, + 121, + 124, ], "type": "Identifier", - "value": "T", + "value": "age", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 5, + "column": 25, + "line": 4, }, "start": Object { - "column": 19, - "line": 5, + "column": 24, + "line": 4, }, }, "range": Array [ - 65, - 66, + 124, + 125, ], "type": "Punctuator", - "value": ">", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 5, + "column": 32, + "line": 4, }, "start": Object { - "column": 20, - "line": 5, + "column": 26, + "line": 4, }, }, "range": Array [ - 66, - 67, + 126, + 132, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 5, + "column": 34, + "line": 4, }, "start": Object { - "column": 21, - "line": 5, + "column": 33, + "line": 4, }, }, "range": Array [ - 67, - 68, + 133, + 134, ], "type": "Punctuator", - "value": ")", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 5, + "column": 37, + "line": 4, }, "start": Object { - "column": 22, - "line": 5, + "column": 35, + "line": 4, }, }, "range": Array [ - 68, - 69, + 135, + 137, ], - "type": "Punctuator", - "value": ":", + "type": "Numeric", + "value": "30", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 5, + "column": 38, + "line": 4, }, "start": Object { - "column": 24, - "line": 5, + "column": 37, + "line": 4, }, }, "range": Array [ - 70, - 76, + 137, + 138, ], - "type": "Identifier", - "value": "number", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 20, "line": 5, }, "start": Object { - "column": 31, + "column": 14, "line": 5, }, }, "range": Array [ - 77, - 78, + 153, + 159, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "public", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 6, + "column": 29, + "line": 5, }, "start": Object { - "column": 2, - "line": 6, + "column": 21, + "line": 5, }, }, "range": Array [ - 81, - 82, + 160, + 168, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "readonly", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 7, + "column": 37, + "line": 5, }, "start": Object { - "column": 0, - "line": 7, + "column": 30, + "line": 5, }, }, "range": Array [ - 83, - 84, + 169, + 176, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "student", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 7, + "column": 38, + "line": 5, }, "start": Object { - "column": 1, - "line": 7, + "column": 37, + "line": 5, }, }, "range": Array [ - 84, - 85, + 176, + 177, ], "type": "Punctuator", - "value": ";", + "value": ":", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-with-type-parameter.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 17, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 46, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 39, + "line": 5, }, }, "range": Array [ - 0, - 17, + 178, + 185, ], - "superClass": null, - "type": "ClassDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - "range": Array [ - 10, - 11, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 9, - 12, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "boolean", }, - }, - "range": Array [ - 0, - 18, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 48, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 47, + "line": 5, }, }, "range": Array [ - 0, - 5, + 186, + 187, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 54, + "line": 5, }, "start": Object { - "column": 6, - "line": 1, + "column": 49, + "line": 5, }, }, "range": Array [ - 6, - 9, + 188, + 193, ], - "type": "Identifier", - "value": "Foo", + "type": "Boolean", + "value": "false", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 55, + "line": 5, }, "start": Object { - "column": 9, - "line": 1, + "column": 54, + "line": 5, }, }, "range": Array [ - 9, - 10, + 193, + 194, ], "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - "value": "T", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 57, + "line": 5, }, "start": Object { - "column": 11, - "line": 1, + "column": 56, + "line": 5, }, }, "range": Array [ - 11, - 12, + 195, + 196, ], "type": "Punctuator", - "value": ">", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 58, + "line": 5, }, "start": Object { - "column": 13, - "line": 1, + "column": 57, + "line": 5, }, }, "range": Array [ - 13, - 14, + 196, + 197, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 6, }, "start": Object { "column": 0, - "line": 3, + "line": 6, }, }, "range": Array [ - 16, - 17, + 198, + 199, ], "type": "Punctuator", "value": "}", @@ -31332,25 +32135,281 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-type-parameter-default.src 1`] = ` +exports[`typescript fixtures/basics/class-with-readonly-parameter-properties.src 1`] = ` Object { "body": Array [ Object { "body": Object { - "body": Array [], + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "constructor", + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 53, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 14, + 107, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 53, + "line": 3, + }, + "start": Object { + "column": 51, + "line": 3, + }, + }, + "range": Array [ + 105, + 107, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 53, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "name": "firstName", + "range": Array [ + 35, + 52, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 2, + }, + "start": Object { + "column": 32, + "line": 2, + }, + }, + "range": Array [ + 44, + 52, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 2, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 46, + 52, + ], + "type": "TSStringKeyword", + }, + }, + }, + "range": Array [ + 26, + 52, + ], + "readonly": true, + "type": "TSParameterProperty", + }, + Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "parameter": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 3, + }, + "start": Object { + "column": 23, + "line": 3, + }, + }, + "name": "lastName", + "range": Array [ + 77, + 93, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 3, + }, + "start": Object { + "column": 31, + "line": 3, + }, + }, + "range": Array [ + 85, + 93, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 3, + }, + }, + "range": Array [ + 87, + 93, + ], + "type": "TSStringKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 23, + "line": 3, + }, + }, + "range": Array [ + 77, + 103, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 42, + "line": 3, + }, + }, + "range": Array [ + 96, + 103, + ], + "raw": "'Smith'", + "type": "Literal", + "value": "Smith", + }, + "type": "AssignmentPattern", + }, + "range": Array [ + 68, + 103, + ], + "readonly": true, + "type": "TSParameterProperty", + }, + ], + "range": Array [ + 25, + 107, + ], + "type": "FunctionExpression", + }, + }, + ], "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 4, }, "start": Object { - "column": 19, + "column": 10, "line": 1, }, }, "range": Array [ - 19, - 23, + 10, + 109, ], "type": "ClassBody", }, @@ -31375,7 +32434,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 4, }, "start": Object { "column": 0, @@ -31384,104 +32443,15 @@ Object { }, "range": Array [ 0, - 23, + 109, ], "superClass": null, "type": "ClassDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "params": Array [ - Object { - "default": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 17, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "Bar", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - "range": Array [ - 10, - 17, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 9, - 18, - ], - "type": "TSTypeParameterDeclaration", - }, }, ], "loc": Object { "end": Object { - "column": 0, + "column": 1, "line": 4, }, "start": Object { @@ -31491,7 +32461,7 @@ Object { }, "range": Array [ 0, - 24, + 109, ], "sourceType": "script", "tokens": Array [ @@ -31534,366 +32504,287 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 11, "line": 1, }, "start": Object { - "column": 9, + "column": 10, "line": 1, }, }, "range": Array [ - 9, 10, + 11, ], "type": "Punctuator", - "value": "<", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 10, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 10, - 11, + 14, + 25, ], "type": "Identifier", - "value": "T", + "value": "constructor", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { - "column": 12, - "line": 1, + "column": 13, + "line": 2, }, }, "range": Array [ - 12, - 13, + 25, + 26, ], "type": "Punctuator", - "value": "=", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 22, + "line": 2, }, "start": Object { "column": 14, - "line": 1, + "line": 2, }, }, "range": Array [ - 14, - 17, + 26, + 34, ], "type": "Identifier", - "value": "Bar", + "value": "readonly", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 32, + "line": 2, }, "start": Object { - "column": 17, - "line": 1, + "column": 23, + "line": 2, }, }, "range": Array [ - 17, - 18, + 35, + 44, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "firstName", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 33, + "line": 2, }, "start": Object { - "column": 19, - "line": 1, + "column": 32, + "line": 2, }, }, "range": Array [ - 19, - 20, + 44, + 45, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 40, + "line": 2, }, "start": Object { - "column": 0, - "line": 3, + "column": 34, + "line": 2, }, }, "range": Array [ - 22, - 23, + 46, + 52, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "string", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-with-type-parameter-underscore.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 41, + "line": 2, }, - "range": Array [ - 13, - 15, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, + "start": Object { + "column": 40, + "line": 2, }, - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": ",", + }, + Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 22, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 14, + "line": 3, }, }, "range": Array [ - 0, - 15, + 68, + 76, ], - "superClass": null, - "type": "ClassDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, + "type": "Identifier", + "value": "readonly", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 3, + }, + "start": Object { + "column": 23, + "line": 3, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "__P", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - "range": Array [ - 8, - 11, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 7, - 12, - ], - "type": "TSTypeParameterDeclaration", }, + "range": Array [ + 77, + 85, + ], + "type": "Identifier", + "value": "lastName", }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 16, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 32, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 31, + "line": 3, }, }, "range": Array [ - 0, - 5, + 85, + 86, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 39, + "line": 3, }, "start": Object { - "column": 6, - "line": 1, + "column": 33, + "line": 3, }, }, "range": Array [ - 6, - 7, + 87, + 93, ], "type": "Identifier", - "value": "A", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 41, + "line": 3, }, "start": Object { - "column": 7, - "line": 1, + "column": 40, + "line": 3, }, }, "range": Array [ - 7, - 8, + 94, + 95, ], "type": "Punctuator", - "value": "<", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 49, + "line": 3, }, "start": Object { - "column": 8, - "line": 1, + "column": 42, + "line": 3, }, }, "range": Array [ - 8, - 11, + 96, + 103, ], - "type": "Identifier", - "value": "__P", + "type": "String", + "value": "'Smith'", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 50, + "line": 3, }, "start": Object { - "column": 11, - "line": 1, + "column": 49, + "line": 3, }, }, "range": Array [ - 11, - 12, + 103, + 104, ], "type": "Punctuator", - "value": ">", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 52, + "line": 3, }, "start": Object { - "column": 13, - "line": 1, + "column": 51, + "line": 3, }, }, "range": Array [ - 13, - 14, + 105, + 106, ], "type": "Punctuator", "value": "{", @@ -31901,1584 +32792,1554 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 53, + "line": 3, }, "start": Object { - "column": 14, - "line": 1, + "column": 52, + "line": 3, }, }, "range": Array [ - 14, - 15, + 106, + 107, ], "type": "Punctuator", "value": "}", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/const-assertions.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "x", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - "init": Object { - "expression": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 108, + 109, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-readonly-property.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "accessibility": "public", + "computed": false, + "declare": false, + "key": Object { "loc": Object { "end": Object { - "column": 10, + "column": 23, "line": 2, }, "start": Object { - "column": 8, + "column": 20, "line": 2, }, }, + "name": "foo", "range": Array [ - 21, - 23, + 32, + 35, ], - "raw": "10", - "type": "Literal", - "value": 10, + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 19, + "column": 35, "line": 2, }, "start": Object { - "column": 8, + "column": 4, "line": 2, }, }, "range": Array [ - 21, - 32, + 16, + 47, ], - "type": "TSAsExpression", - "typeAnnotation": Object { + "readonly": true, + "static": false, + "type": "ClassProperty", + "value": Object { "loc": Object { "end": Object { - "column": 19, + "column": 34, "line": 2, }, "start": Object { - "column": 14, + "column": 26, "line": 2, }, }, "range": Array [ - 27, - 32, + 38, + 46, ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "name": "const", - "range": Array [ - 27, - 32, - ], - "type": "Identifier", - }, + "raw": "'string'", + "type": "Literal", + "value": "string", }, }, - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, }, - "range": Array [ - 17, - 32, - ], - "type": "VariableDeclarator", + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 49, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 49, ], - "kind": "let", + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 50, + ], + "sourceType": "script", + "tokens": Array [ + Object { "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 5, + "line": 1, }, "start": Object { "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, "line": 2, }, }, "range": Array [ - 13, - 33, + 16, + 22, ], - "type": "VariableDeclaration", + "type": "Keyword", + "value": "public", }, Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, - "name": "y", - "range": Array [ - 67, - 68, - ], - "type": "Identifier", - }, - "init": Object { - "expression": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 5, - }, - "start": Object { - "column": 9, - "line": 5, - }, - }, - "range": Array [ - 72, - 74, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 5, - }, - "start": Object { - "column": 13, - "line": 5, - }, - }, - "range": Array [ - 76, - 78, - ], - "raw": "20", - "type": "Literal", - "value": 20, - }, - ], - "loc": Object { - "end": Object { - "column": 16, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 5, - }, - }, - "range": Array [ - 71, - 79, - ], - "type": "ArrayExpression", - }, - "loc": Object { - "end": Object { - "column": 25, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 5, - }, - }, - "range": Array [ - 71, - 88, - ], - "type": "TSAsExpression", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 5, - }, - "start": Object { - "column": 20, - "line": 5, - }, - }, - "range": Array [ - 83, - 88, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 5, - }, - "start": Object { - "column": 20, - "line": 5, - }, - }, - "name": "const", - "range": Array [ - 83, - 88, - ], - "type": "Identifier", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 25, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, - "range": Array [ - 67, - 88, - ], - "type": "VariableDeclarator", + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, }, + }, + "range": Array [ + 23, + 31, ], - "kind": "let", + "type": "Identifier", + "value": "readonly", + }, + Object { "loc": Object { "end": Object { - "column": 26, - "line": 5, + "column": 23, + "line": 2, }, "start": Object { - "column": 0, - "line": 5, + "column": 20, + "line": 2, }, }, "range": Array [ - 63, - 89, + 32, + 35, ], - "type": "VariableDeclaration", + "type": "Identifier", + "value": "foo", }, Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "name": "z", - "range": Array [ - 132, - 133, - ], - "type": "Identifier", - }, - "init": Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 8, - }, - "start": Object { - "column": 8, - "line": 8, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 8, - }, - "start": Object { - "column": 10, - "line": 8, - }, - }, - "name": "text", - "range": Array [ - 138, - 142, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 23, - "line": 8, - }, - "start": Object { - "column": 10, - "line": 8, - }, - }, - "method": false, - "range": Array [ - 138, - 151, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 8, - }, - "start": Object { - "column": 16, - "line": 8, - }, - }, - "range": Array [ - 144, - 151, - ], - "raw": "\\"hello\\"", - "type": "Literal", - "value": "hello", - }, - }, - ], - "range": Array [ - 136, - 153, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 34, - "line": 8, - }, - "start": Object { - "column": 8, - "line": 8, - }, - }, - "range": Array [ - 136, - 162, - ], - "type": "TSAsExpression", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 8, - }, - "start": Object { - "column": 29, - "line": 8, - }, - }, - "range": Array [ - 157, - 162, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 8, - }, - "start": Object { - "column": 29, - "line": 8, - }, - }, - "name": "const", - "range": Array [ - 157, - 162, - ], - "type": "Identifier", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 34, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "range": Array [ - 132, - 162, - ], - "type": "VariableDeclarator", + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, }, + }, + "range": Array [ + 36, + 37, ], - "kind": "let", + "type": "Punctuator", + "value": "=", + }, + Object { "loc": Object { "end": Object { - "column": 35, - "line": 8, + "column": 34, + "line": 2, }, "start": Object { - "column": 0, - "line": 8, + "column": 26, + "line": 2, }, }, "range": Array [ - 128, - 163, + 38, + 46, ], - "type": "VariableDeclaration", + "type": "String", + "value": "'string'", }, Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 11, - }, - "start": Object { - "column": 4, - "line": 11, - }, - }, - "name": "x", - "range": Array [ - 182, - 183, - ], - "type": "Identifier", - }, - "init": Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 11, - }, - "start": Object { - "column": 15, - "line": 11, - }, - }, - "range": Array [ - 193, - 195, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 11, - }, - "start": Object { - "column": 8, - "line": 11, - }, - }, - "range": Array [ - 186, - 195, - ], - "type": "TSTypeAssertion", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 11, - }, - "start": Object { - "column": 9, - "line": 11, - }, - }, - "range": Array [ - 187, - 192, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 11, - }, - "start": Object { - "column": 9, - "line": 11, - }, - }, - "name": "const", - "range": Array [ - 187, - 192, - ], - "type": "Identifier", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 11, - }, - "start": Object { - "column": 4, - "line": 11, - }, - }, - "range": Array [ - 182, - 195, - ], - "type": "VariableDeclarator", + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 34, + "line": 2, }, + }, + "range": Array [ + 46, + 47, ], - "kind": "let", + "type": "Punctuator", + "value": ";", + }, + Object { "loc": Object { "end": Object { - "column": 18, - "line": 11, + "column": 1, + "line": 3, }, "start": Object { "column": 0, - "line": 11, + "line": 3, }, }, "range": Array [ - 178, - 196, + 48, + 49, ], - "type": "VariableDeclaration", + "type": "Punctuator", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-static-parameter-properties.src 1`] = ` +Object { + "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 14, - }, - "start": Object { - "column": 4, - "line": 14, - }, - }, - "name": "y", - "range": Array [ - 230, - 231, - ], - "type": "Identifier", - }, - "init": Object { - "expression": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 14, - }, - "start": Object { - "column": 16, - "line": 14, - }, - }, - "range": Array [ - 242, - 244, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 14, - }, - "start": Object { - "column": 20, - "line": 14, - }, - }, - "range": Array [ - 246, - 248, - ], - "raw": "20", - "type": "Literal", - "value": 20, - }, - ], + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 23, - "line": 14, + "column": 15, + "line": 2, }, "start": Object { - "column": 15, - "line": 14, + "column": 4, + "line": 2, }, }, + "name": "constructor", "range": Array [ - 241, - 249, + 16, + 27, ], - "type": "ArrayExpression", + "type": "Identifier", }, + "kind": "constructor", "loc": Object { "end": Object { - "column": 23, - "line": 14, + "column": 5, + "line": 4, }, "start": Object { - "column": 8, - "line": 14, + "column": 4, + "line": 2, }, }, "range": Array [ - 234, - 249, + 16, + 54, ], - "type": "TSTypeAssertion", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 14, - }, - "start": Object { - "column": 9, - "line": 14, - }, - }, - "range": Array [ - 235, - 240, - ], - "type": "TSTypeReference", - "typeName": Object { + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 14, - "line": 14, + "column": 5, + "line": 4, }, "start": Object { - "column": 9, - "line": 14, + "column": 34, + "line": 2, }, }, - "name": "const", "range": Array [ - 235, - 240, + 46, + 54, ], - "type": "Identifier", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 23, - "line": 14, - }, - "start": Object { - "column": 4, - "line": 14, - }, - }, - "range": Array [ - 230, - 249, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "let", - "loc": Object { - "end": Object { - "column": 24, - "line": 14, - }, - "start": Object { - "column": 0, - "line": 14, - }, - }, - "range": Array [ - 226, - 250, - ], - "type": "VariableDeclaration", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 17, - }, - "start": Object { - "column": 4, - "line": 17, + "type": "BlockStatement", }, - }, - "name": "z", - "range": Array [ - 293, - 294, - ], - "type": "Identifier", - }, - "init": Object { - "expression": Object { + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 32, - "line": 17, + "column": 5, + "line": 4, }, "start": Object { "column": 15, - "line": 17, + "line": 2, }, }, - "properties": Array [ + "params": Array [ Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 17, - }, - "start": Object { - "column": 17, - "line": 17, - }, - }, - "name": "text", - "range": Array [ - 306, - 310, - ], - "type": "Identifier", - }, - "kind": "init", "loc": Object { "end": Object { - "column": 30, - "line": 17, + "column": 32, + "line": 2, }, "start": Object { - "column": 17, - "line": 17, + "column": 16, + "line": 2, }, }, - "method": false, - "range": Array [ - 306, - 319, - ], - "shorthand": false, - "type": "Property", - "value": Object { + "parameter": Object { "loc": Object { "end": Object { - "column": 30, - "line": 17, + "column": 32, + "line": 2, }, "start": Object { "column": 23, - "line": 17, + "line": 2, }, }, + "name": "a", "range": Array [ - 312, - 319, + 35, + 44, ], - "raw": "\\"hello\\"", - "type": "Literal", - "value": "hello", + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 36, + 44, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 38, + 44, + ], + "type": "TSStringKeyword", + }, + }, }, + "range": Array [ + 28, + 44, + ], + "static": true, + "type": "TSParameterProperty", }, ], "range": Array [ - 304, - 321, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 32, - "line": 17, - }, - "start": Object { - "column": 8, - "line": 17, - }, - }, - "range": Array [ - 297, - 321, - ], - "type": "TSTypeAssertion", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 17, - }, - "start": Object { - "column": 9, - "line": 17, - }, - }, - "range": Array [ - 298, - 303, + 27, + 54, ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 17, - }, - "start": Object { - "column": 9, - "line": 17, - }, - }, - "name": "const", - "range": Array [ - 298, - 303, - ], - "type": "Identifier", - }, + "type": "FunctionExpression", }, }, - "loc": Object { - "end": Object { - "column": 32, - "line": 17, - }, - "start": Object { - "column": 4, - "line": 17, - }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 10, + "line": 1, }, - "range": Array [ - 293, - 321, - ], - "type": "VariableDeclarator", }, - ], - "kind": "let", + "range": Array [ + 10, + 56, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 33, - "line": 17, + "column": 1, + "line": 5, }, "start": Object { "column": 0, - "line": 17, + "line": 1, }, }, "range": Array [ - 289, - 322, + 0, + 56, ], - "type": "VariableDeclaration", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 18, + "line": 8, }, "start": Object { "column": 0, - "line": 2, + "line": 1, }, }, "range": Array [ - 13, - 323, + 0, + 59, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, - "line": 2, + "column": 5, + "line": 1, }, "start": Object { "column": 0, - "line": 2, + "line": 1, }, }, "range": Array [ - 13, - 16, + 0, + 5, ], "type": "Keyword", - "value": "let", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 9, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 6, + "line": 1, }, }, "range": Array [ - 17, - 18, + 6, + 9, ], "type": "Identifier", - "value": "x", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 11, + "line": 1, }, "start": Object { - "column": 6, - "line": 2, + "column": 10, + "line": 1, }, }, "range": Array [ - 19, - 20, + 10, + 11, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 15, "line": 2, }, "start": Object { - "column": 8, + "column": 4, "line": 2, }, }, "range": Array [ - 21, - 23, + 16, + 27, ], - "type": "Numeric", - "value": "10", + "type": "Identifier", + "value": "constructor", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 16, "line": 2, }, "start": Object { - "column": 11, + "column": 15, "line": 2, }, }, "range": Array [ - 24, - 26, + 27, + 28, ], - "type": "Identifier", - "value": "as", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 22, "line": 2, }, "start": Object { - "column": 14, + "column": 16, "line": 2, }, }, "range": Array [ - 27, - 32, + 28, + 34, ], "type": "Keyword", - "value": "const", + "value": "static", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 24, "line": 2, }, "start": Object { - "column": 19, + "column": 23, "line": 2, }, }, "range": Array [ - 32, - 33, + 35, + 36, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 5, + "column": 25, + "line": 2, }, "start": Object { - "column": 0, - "line": 5, + "column": 24, + "line": 2, }, }, "range": Array [ - 63, - 66, + 36, + 37, ], - "type": "Keyword", - "value": "let", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 5, + "column": 32, + "line": 2, }, "start": Object { - "column": 4, - "line": 5, + "column": 26, + "line": 2, }, }, "range": Array [ - 67, - 68, + 38, + 44, ], "type": "Identifier", - "value": "y", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 5, + "column": 33, + "line": 2, }, "start": Object { - "column": 6, - "line": 5, + "column": 32, + "line": 2, }, }, "range": Array [ - 69, - 70, + 44, + 45, ], "type": "Punctuator", - "value": "=", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 35, + "line": 2, }, "start": Object { - "column": 8, - "line": 5, + "column": 34, + "line": 2, }, }, "range": Array [ - 71, - 72, + 46, + 47, ], "type": "Punctuator", - "value": "[", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 5, + "column": 5, + "line": 4, }, "start": Object { - "column": 9, - "line": 5, + "column": 4, + "line": 4, }, }, "range": Array [ - 72, - 74, + 53, + 54, ], - "type": "Numeric", - "value": "10", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 1, "line": 5, }, "start": Object { - "column": 11, + "column": 0, "line": 5, }, }, "range": Array [ - 74, - 75, + 55, + 56, ], "type": "Punctuator", - "value": ",", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-two-methods-computed-constructor.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 5, + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 12, + 25, + ], + "raw": "\\"constructor\\"", + "type": "Literal", + "value": "constructor", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 12, + 44, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "range": Array [ + 39, + 44, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 25, + 44, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 30, + 38, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "TSNumberKeyword", + }, + }, + "type": "FunctionExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "T", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + }, + "range": Array [ + 26, + 27, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 25, + 28, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + }, + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "range": Array [ + 49, + 62, + ], + "raw": "\\"constructor\\"", + "type": "Literal", + "value": "constructor", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 48, + 82, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 31, + "line": 5, + }, + }, + "range": Array [ + 77, + 82, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "params": Array [], + "range": Array [ + 63, + 82, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 5, + }, + "start": Object { + "column": 22, + "line": 5, + }, + }, + "range": Array [ + 68, + 76, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 5, + }, + "start": Object { + "column": 24, + "line": 5, + }, + }, + "range": Array [ + 70, + 76, + ], + "type": "TSNumberKeyword", + }, + }, + "type": "FunctionExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 18, + "line": 5, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 18, + "line": 5, + }, + }, + "name": "T", + "range": Array [ + 64, + 65, + ], + "type": "Identifier", + }, + "range": Array [ + 64, + 65, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 63, + 66, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 1, + }, }, - "start": Object { - "column": 13, - "line": 5, + "range": Array [ + 8, + 84, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", }, - "range": Array [ - 76, - 78, - ], - "type": "Numeric", - "value": "20", - }, - Object { "loc": Object { "end": Object { - "column": 16, - "line": 5, + "column": 1, + "line": 7, }, "start": Object { - "column": 15, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 78, - 79, + 0, + 84, ], - "type": "Punctuator", - "value": "]", + "superClass": null, + "type": "ClassDeclaration", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 5, + "column": 2, + "line": 7, }, "start": Object { - "column": 17, - "line": 5, + "column": 1, + "line": 7, }, }, "range": Array [ - 80, - 82, + 84, + 85, ], - "type": "Identifier", - "value": "as", + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 86, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 25, - "line": 5, + "column": 5, + "line": 1, }, "start": Object { - "column": 20, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 83, - 88, + 0, + 5, ], "type": "Keyword", - "value": "const", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 5, + "column": 7, + "line": 1, }, "start": Object { - "column": 25, - "line": 5, + "column": 6, + "line": 1, }, }, "range": Array [ - 88, - 89, + 6, + 7, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 8, + "column": 9, + "line": 1, }, "start": Object { - "column": 0, - "line": 8, + "column": 8, + "line": 1, }, }, "range": Array [ - 128, - 131, + 8, + 9, ], - "type": "Keyword", - "value": "let", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 8, + "column": 15, + "line": 2, }, "start": Object { - "column": 4, - "line": 8, + "column": 2, + "line": 2, }, }, "range": Array [ - 132, - 133, + 12, + 25, ], - "type": "Identifier", - "value": "z", + "type": "String", + "value": "\\"constructor\\"", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 8, + "column": 16, + "line": 2, }, "start": Object { - "column": 6, - "line": 8, + "column": 15, + "line": 2, }, }, "range": Array [ - 134, - 135, + 25, + 26, ], "type": "Punctuator", - "value": "=", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 8, + "column": 17, + "line": 2, }, "start": Object { - "column": 8, - "line": 8, + "column": 16, + "line": 2, }, }, "range": Array [ - 136, - 137, + 26, + 27, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 8, + "column": 18, + "line": 2, }, "start": Object { - "column": 10, - "line": 8, + "column": 17, + "line": 2, }, }, "range": Array [ - 138, - 142, + 27, + 28, ], - "type": "Identifier", - "value": "text", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 8, + "column": 19, + "line": 2, }, "start": Object { - "column": 14, - "line": 8, + "column": 18, + "line": 2, }, }, "range": Array [ - 142, - 143, + 28, + 29, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 8, + "column": 20, + "line": 2, }, "start": Object { - "column": 16, - "line": 8, + "column": 19, + "line": 2, }, }, "range": Array [ - 144, - 151, + 29, + 30, ], - "type": "String", - "value": "\\"hello\\"", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 8, + "column": 21, + "line": 2, }, "start": Object { - "column": 24, - "line": 8, + "column": 20, + "line": 2, }, }, "range": Array [ - 152, - 153, + 30, + 31, ], "type": "Punctuator", - "value": "}", + "value": ":", }, Object { "loc": Object { "end": Object { "column": 28, - "line": 8, + "line": 2, }, "start": Object { - "column": 26, - "line": 8, + "column": 22, + "line": 2, }, }, "range": Array [ - 154, - 156, + 32, + 38, ], "type": "Identifier", - "value": "as", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 8, + "column": 30, + "line": 2, }, "start": Object { "column": 29, - "line": 8, + "line": 2, }, }, "range": Array [ - 157, - 162, + 39, + 40, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 8, + "column": 3, + "line": 3, }, "start": Object { - "column": 34, - "line": 8, + "column": 2, + "line": 3, }, }, "range": Array [ - 162, - 163, + 43, + 44, ], "type": "Punctuator", - "value": ";", + "value": "}", }, Object { "loc": Object { "end": Object { "column": 3, - "line": 11, + "line": 5, }, "start": Object { - "column": 0, - "line": 11, + "column": 2, + "line": 5, }, }, "range": Array [ - 178, - 181, + 48, + 49, ], - "type": "Keyword", - "value": "let", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 11, + "column": 16, + "line": 5, }, "start": Object { - "column": 4, - "line": 11, + "column": 3, + "line": 5, }, }, "range": Array [ - 182, - 183, + 49, + 62, ], - "type": "Identifier", - "value": "x", + "type": "String", + "value": "\\"constructor\\"", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 11, + "column": 17, + "line": 5, }, "start": Object { - "column": 6, - "line": 11, + "column": 16, + "line": 5, }, }, "range": Array [ - 184, - 185, + 62, + 63, ], "type": "Punctuator", - "value": "=", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 11, + "column": 18, + "line": 5, }, "start": Object { - "column": 8, - "line": 11, + "column": 17, + "line": 5, }, }, "range": Array [ - 186, - 187, + 63, + 64, ], "type": "Punctuator", "value": "<", @@ -33486,35 +34347,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, - "line": 11, + "column": 19, + "line": 5, }, "start": Object { - "column": 9, - "line": 11, + "column": 18, + "line": 5, }, }, "range": Array [ - 187, - 192, + 64, + 65, ], - "type": "Keyword", - "value": "const", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 11, + "column": 20, + "line": 5, }, "start": Object { - "column": 14, - "line": 11, + "column": 19, + "line": 5, }, }, "range": Array [ - 192, - 193, + 65, + 66, ], "type": "Punctuator", "value": ">", @@ -33522,611 +34383,857 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, - "line": 11, + "column": 21, + "line": 5, }, "start": Object { - "column": 15, - "line": 11, + "column": 20, + "line": 5, }, }, "range": Array [ - 193, - 195, + 66, + 67, ], - "type": "Numeric", - "value": "10", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 11, + "column": 22, + "line": 5, }, "start": Object { - "column": 17, - "line": 11, + "column": 21, + "line": 5, }, }, "range": Array [ - 195, - 196, + 67, + 68, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 14, + "column": 23, + "line": 5, }, "start": Object { - "column": 0, - "line": 14, + "column": 22, + "line": 5, }, }, "range": Array [ - 226, - 229, + 68, + 69, ], - "type": "Keyword", - "value": "let", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 14, + "column": 30, + "line": 5, }, "start": Object { - "column": 4, - "line": 14, + "column": 24, + "line": 5, }, }, "range": Array [ - 230, - 231, + 70, + 76, ], "type": "Identifier", - "value": "y", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 14, + "column": 32, + "line": 5, }, "start": Object { - "column": 6, - "line": 14, + "column": 31, + "line": 5, }, }, "range": Array [ - 232, - 233, + 77, + 78, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 14, + "column": 3, + "line": 6, }, "start": Object { - "column": 8, - "line": 14, + "column": 2, + "line": 6, }, }, "range": Array [ - 234, - 235, + 81, + 82, ], "type": "Punctuator", - "value": "<", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 14, + "column": 1, + "line": 7, }, "start": Object { - "column": 9, - "line": 14, + "column": 0, + "line": 7, }, }, "range": Array [ - 235, - 240, + 83, + 84, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 14, + "column": 2, + "line": 7, }, "start": Object { - "column": 14, - "line": 14, + "column": 1, + "line": 7, }, }, "range": Array [ - 240, - 241, + 84, + 85, ], "type": "Punctuator", - "value": ">", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-type-parameter.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 17, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 16, - "line": 14, + "column": 1, + "line": 3, }, "start": Object { - "column": 15, - "line": 14, + "column": 0, + "line": 1, }, }, "range": Array [ - 241, - 242, + 0, + 17, ], - "type": "Punctuator", - "value": "[", + "superClass": null, + "type": "ClassDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 10, + 11, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 9, + 12, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 18, - "line": 14, + "column": 5, + "line": 1, }, "start": Object { - "column": 16, - "line": 14, + "column": 0, + "line": 1, }, }, "range": Array [ - 242, - 244, + 0, + 5, ], - "type": "Numeric", - "value": "10", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 14, + "column": 9, + "line": 1, }, "start": Object { - "column": 18, - "line": 14, + "column": 6, + "line": 1, }, }, "range": Array [ - 244, - 245, + 6, + 9, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 14, + "column": 10, + "line": 1, }, "start": Object { - "column": 20, - "line": 14, + "column": 9, + "line": 1, }, }, "range": Array [ - 246, - 248, + 9, + 10, ], - "type": "Numeric", - "value": "20", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 14, + "column": 11, + "line": 1, }, "start": Object { - "column": 22, - "line": 14, + "column": 10, + "line": 1, }, }, "range": Array [ - 248, - 249, + 10, + 11, ], - "type": "Punctuator", - "value": "]", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 14, + "column": 12, + "line": 1, }, "start": Object { - "column": 23, - "line": 14, + "column": 11, + "line": 1, }, }, "range": Array [ - 249, - 250, + 11, + 12, ], "type": "Punctuator", - "value": ";", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 17, + "column": 14, + "line": 1, }, "start": Object { - "column": 0, - "line": 17, + "column": 13, + "line": 1, }, }, "range": Array [ - 289, - 292, + 13, + 14, ], - "type": "Keyword", - "value": "let", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 17, + "column": 1, + "line": 3, }, "start": Object { - "column": 4, - "line": 17, + "column": 0, + "line": 3, }, }, "range": Array [ - 293, - 294, + 16, + 17, ], - "type": "Identifier", - "value": "z", + "type": "Punctuator", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-type-parameter-default.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 23, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 7, - "line": 17, + "column": 1, + "line": 3, }, "start": Object { - "column": 6, - "line": 17, + "column": 0, + "line": 1, }, }, "range": Array [ - 295, - 296, + 0, + 23, ], - "type": "Punctuator", - "value": "=", + "superClass": null, + "type": "ClassDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "params": Array [ + Object { + "default": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 10, + 17, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 9, + 18, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 9, - "line": 17, + "column": 5, + "line": 1, }, "start": Object { - "column": 8, - "line": 17, + "column": 0, + "line": 1, }, }, "range": Array [ - 297, - 298, + 0, + 5, ], - "type": "Punctuator", - "value": "<", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 17, + "column": 9, + "line": 1, }, "start": Object { - "column": 9, - "line": 17, + "column": 6, + "line": 1, }, }, "range": Array [ - 298, - 303, + 6, + 9, ], - "type": "Keyword", - "value": "const", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 17, + "column": 10, + "line": 1, }, "start": Object { - "column": 14, - "line": 17, + "column": 9, + "line": 1, }, }, "range": Array [ - 303, - 304, + 9, + 10, ], "type": "Punctuator", - "value": ">", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 17, + "column": 11, + "line": 1, }, "start": Object { - "column": 15, - "line": 17, + "column": 10, + "line": 1, }, }, "range": Array [ - 304, - 305, + 10, + 11, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 17, + "column": 13, + "line": 1, }, "start": Object { - "column": 17, - "line": 17, + "column": 12, + "line": 1, }, }, "range": Array [ - 306, - 310, + 12, + 13, ], - "type": "Identifier", - "value": "text", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 17, + "column": 17, + "line": 1, }, "start": Object { - "column": 21, - "line": 17, + "column": 14, + "line": 1, }, }, "range": Array [ - 310, - 311, + 14, + 17, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "Bar", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 17, + "column": 18, + "line": 1, }, "start": Object { - "column": 23, - "line": 17, + "column": 17, + "line": 1, }, }, "range": Array [ - 312, - 319, + 17, + 18, ], - "type": "String", - "value": "\\"hello\\"", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 17, + "column": 20, + "line": 1, }, "start": Object { - "column": 31, - "line": 17, + "column": 19, + "line": 1, }, }, "range": Array [ - 320, - 321, + 19, + 20, ], "type": "Punctuator", - "value": "}", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 17, + "column": 1, + "line": 3, }, "start": Object { - "column": 32, - "line": 17, + "column": 0, + "line": 3, }, }, "range": Array [ - 321, - 322, + 22, + 23, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/const-enum.src 1`] = ` +exports[`typescript fixtures/basics/class-with-type-parameter-underscore.src 1`] = ` Object { "body": Array [ Object { - "const": true, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "type": "ClassBody", + }, "id": Object { "loc": Object { "end": Object { - "column": 14, + "column": 7, "line": 1, }, "start": Object { - "column": 11, + "column": 6, "line": 1, }, }, - "name": "Foo", + "name": "A", "range": Array [ - 11, - 14, + 6, + 7, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 15, + "line": 1, }, "start": Object { "column": 0, "line": 1, }, }, - "members": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", + "range": Array [ + 0, + 15, + ], + "superClass": null, + "type": "ClassDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, }, - "initializer": Object { + "start": Object { + "column": 7, + "line": 1, + }, + }, + "params": Array [ + Object { "loc": Object { "end": Object { "column": 11, - "line": 2, + "line": 1, }, "start": Object { - "column": 10, - "line": 2, + "column": 8, + "line": 1, }, }, - "range": Array [ - 27, - 28, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 21, - 28, - ], - "type": "TSEnumMember", - }, - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, + "name": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, }, + "name": "__P", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", }, - "name": "bar", "range": Array [ - 34, - 37, + 8, + 11, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, + "type": "TSTypeParameter", }, - "range": Array [ - 34, - 37, - ], - "type": "TSEnumMember", - }, - ], - "range": Array [ - 0, - 39, - ], - "type": "TSEnumDeclaration", + ], + "range": Array [ + 7, + 12, + ], + "type": "TSTypeParameterDeclaration", + }, }, ], "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -34135,7 +35242,7 @@ Object { }, "range": Array [ 0, - 39, + 16, ], "sourceType": "script", "tokens": Array [ @@ -34155,12 +35262,12 @@ Object { 5, ], "type": "Keyword", - "value": "const", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 7, "line": 1, }, "start": Object { @@ -34170,151 +35277,97 @@ Object { }, "range": Array [ 6, - 10, - ], - "type": "Keyword", - "value": "enum", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 14, + 7, ], "type": "Identifier", - "value": "Foo", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 8, "line": 1, }, "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 16, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, + "line": 1, }, }, "range": Array [ - 25, - 26, + 7, + 8, ], "type": "Punctuator", - "value": "=", + "value": "<", }, Object { "loc": Object { "end": Object { "column": 11, - "line": 2, + "line": 1, }, "start": Object { - "column": 10, - "line": 2, + "column": 8, + "line": 1, }, }, "range": Array [ - 27, - 28, + 8, + 11, ], - "type": "Numeric", - "value": "1", + "type": "Identifier", + "value": "__P", }, Object { "loc": Object { "end": Object { "column": 12, - "line": 2, + "line": 1, }, "start": Object { "column": 11, - "line": 2, + "line": 1, }, }, "range": Array [ - 28, - 29, + 11, + 12, ], "type": "Punctuator", - "value": ",", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 14, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 13, + "line": 1, }, }, "range": Array [ - 34, - 37, + 13, + 14, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 15, + "line": 1, }, "start": Object { - "column": 0, - "line": 4, + "column": 14, + "line": 1, }, }, "range": Array [ - 38, - 39, + 14, + 15, ], "type": "Punctuator", "value": "}", @@ -34324,37 +35377,16 @@ Object { } `; -exports[`typescript fixtures/basics/declare-class-with-optional-method.src 1`] = ` +exports[`typescript fixtures/basics/const-assertions.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "bar", - "optional": true, - "range": Array [ - 24, - 27, - ], - "type": "Identifier", - }, - "kind": "method", + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { - "column": 16, + "column": 5, "line": 2, }, "start": Object { @@ -34362,21 +35394,18 @@ Object { "line": 2, }, }, + "name": "x", "range": Array [ - 24, - 36, + 17, + 18, ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": null, - "expression": false, - "generator": false, - "id": null, + "type": "Identifier", + }, + "init": Object { + "expression": Object { "loc": Object { "end": Object { - "column": 16, + "column": 10, "line": 2, }, "start": Object { @@ -34384,243 +35413,991 @@ Object { "line": 2, }, }, - "params": Array [], "range": Array [ - 28, - 36, + 21, + 23, ], - "returnType": Object { + "raw": "10", + "type": "Literal", + "value": 10, + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 21, + 32, + ], + "type": "TSAsExpression", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 27, + 32, + ], + "type": "TSTypeReference", + "typeName": Object { "loc": Object { "end": Object { - "column": 15, + "column": 19, "line": 2, }, "start": Object { - "column": 10, + "column": 14, "line": 2, }, }, + "name": "const", "range": Array [ - 30, - 35, + 27, + 32, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "type": "Identifier", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 17, + 32, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 13, + 33, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "name": "y", + "range": Array [ + 67, + 68, + ], + "type": "Identifier", + }, + "init": Object { + "expression": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "range": Array [ + 72, + 74, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + Object { "loc": Object { "end": Object { "column": 15, - "line": 2, + "line": 5, }, "start": Object { - "column": 12, - "line": 2, + "column": 13, + "line": 5, }, }, "range": Array [ - 32, - 35, + 76, + 78, ], - "type": "TSAnyKeyword", + "raw": "20", + "type": "Literal", + "value": 20, + }, + ], + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, }, }, - "type": "FunctionExpression", + "range": Array [ + 71, + 79, + ], + "type": "ArrayExpression", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 71, + 88, + ], + "type": "TSAsExpression", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 5, + }, + "start": Object { + "column": 20, + "line": 5, + }, + }, + "range": Array [ + 83, + 88, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 5, + }, + "start": Object { + "column": 20, + "line": 5, + }, + }, + "name": "const", + "range": Array [ + 83, + 88, + ], + "type": "Identifier", + }, }, }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 38, - ], - "type": "ClassBody", - }, - "declare": true, - "id": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, + "loc": Object { + "end": Object { + "column": 25, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, }, + "range": Array [ + 67, + 88, + ], + "type": "VariableDeclarator", }, - "name": "Foo", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 26, + "line": 5, }, "start": Object { "column": 0, - "line": 1, + "line": 5, }, }, "range": Array [ - 0, - 38, + 63, + 89, ], - "superClass": null, - "type": "ClassDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "VariableDeclaration", }, - }, - "range": Array [ - 0, - 38, - ], - "sourceType": "script", - "tokens": Array [ Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "name": "z", + "range": Array [ + 132, + 133, + ], + "type": "Identifier", + }, + "init": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 8, + }, + "start": Object { + "column": 8, + "line": 8, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 8, + }, + "start": Object { + "column": 10, + "line": 8, + }, + }, + "name": "text", + "range": Array [ + 138, + 142, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 23, + "line": 8, + }, + "start": Object { + "column": 10, + "line": 8, + }, + }, + "method": false, + "range": Array [ + 138, + 151, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 8, + }, + "start": Object { + "column": 16, + "line": 8, + }, + }, + "range": Array [ + 144, + 151, + ], + "raw": "\\"hello\\"", + "type": "Literal", + "value": "hello", + }, + }, + ], + "range": Array [ + 136, + 153, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 34, + "line": 8, + }, + "start": Object { + "column": 8, + "line": 8, + }, + }, + "range": Array [ + 136, + 162, + ], + "type": "TSAsExpression", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 8, + }, + "start": Object { + "column": 29, + "line": 8, + }, + }, + "range": Array [ + 157, + 162, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 8, + }, + "start": Object { + "column": 29, + "line": 8, + }, + }, + "name": "const", + "range": Array [ + 157, + 162, + ], + "type": "Identifier", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 34, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 132, + 162, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 35, + "line": 8, }, "start": Object { "column": 0, - "line": 1, + "line": 8, }, }, "range": Array [ - 0, - 7, + 128, + 163, ], - "type": "Identifier", - "value": "declare", + "type": "VariableDeclaration", }, Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 11, + }, + "start": Object { + "column": 4, + "line": 11, + }, + }, + "name": "x", + "range": Array [ + 182, + 183, + ], + "type": "Identifier", + }, + "init": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 11, + }, + "start": Object { + "column": 15, + "line": 11, + }, + }, + "range": Array [ + 193, + 195, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 11, + }, + "start": Object { + "column": 8, + "line": 11, + }, + }, + "range": Array [ + 186, + 195, + ], + "type": "TSTypeAssertion", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 11, + }, + "start": Object { + "column": 9, + "line": 11, + }, + }, + "range": Array [ + 187, + 192, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 11, + }, + "start": Object { + "column": 9, + "line": 11, + }, + }, + "name": "const", + "range": Array [ + 187, + 192, + ], + "type": "Identifier", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 11, + }, + "start": Object { + "column": 4, + "line": 11, + }, + }, + "range": Array [ + 182, + 195, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 18, + "line": 11, }, "start": Object { - "column": 8, - "line": 1, + "column": 0, + "line": 11, }, }, "range": Array [ - 8, - 13, + 178, + 196, ], - "type": "Keyword", - "value": "class", + "type": "VariableDeclaration", }, Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 14, + }, + "start": Object { + "column": 4, + "line": 14, + }, + }, + "name": "y", + "range": Array [ + 230, + 231, + ], + "type": "Identifier", + }, + "init": Object { + "expression": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 14, + }, + "start": Object { + "column": 16, + "line": 14, + }, + }, + "range": Array [ + 242, + 244, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 14, + }, + "start": Object { + "column": 20, + "line": 14, + }, + }, + "range": Array [ + 246, + 248, + ], + "raw": "20", + "type": "Literal", + "value": 20, + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 14, + }, + "start": Object { + "column": 15, + "line": 14, + }, + }, + "range": Array [ + 241, + 249, + ], + "type": "ArrayExpression", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 14, + }, + "start": Object { + "column": 8, + "line": 14, + }, + }, + "range": Array [ + 234, + 249, + ], + "type": "TSTypeAssertion", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 14, + }, + "start": Object { + "column": 9, + "line": 14, + }, + }, + "range": Array [ + 235, + 240, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 14, + }, + "start": Object { + "column": 9, + "line": 14, + }, + }, + "name": "const", + "range": Array [ + 235, + 240, + ], + "type": "Identifier", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 14, + }, + "start": Object { + "column": 4, + "line": 14, + }, + }, + "range": Array [ + 230, + 249, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 24, + "line": 14, }, "start": Object { - "column": 14, - "line": 1, + "column": 0, + "line": 14, }, }, "range": Array [ - 14, - 17, + 226, + 250, ], - "type": "Identifier", - "value": "Foo", + "type": "VariableDeclaration", }, Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 17, + }, + "start": Object { + "column": 4, + "line": 17, + }, + }, + "name": "z", + "range": Array [ + 293, + 294, + ], + "type": "Identifier", + }, + "init": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 17, + }, + "start": Object { + "column": 15, + "line": 17, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 17, + }, + "start": Object { + "column": 17, + "line": 17, + }, + }, + "name": "text", + "range": Array [ + 306, + 310, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 30, + "line": 17, + }, + "start": Object { + "column": 17, + "line": 17, + }, + }, + "method": false, + "range": Array [ + 306, + 319, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 17, + }, + "start": Object { + "column": 23, + "line": 17, + }, + }, + "range": Array [ + 312, + 319, + ], + "raw": "\\"hello\\"", + "type": "Literal", + "value": "hello", + }, + }, + ], + "range": Array [ + 304, + 321, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 17, + }, + "start": Object { + "column": 8, + "line": 17, + }, + }, + "range": Array [ + 297, + 321, + ], + "type": "TSTypeAssertion", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 17, + }, + "start": Object { + "column": 9, + "line": 17, + }, + }, + "range": Array [ + 298, + 303, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 17, + }, + "start": Object { + "column": 9, + "line": 17, + }, + }, + "name": "const", + "range": Array [ + 298, + 303, + ], + "type": "Identifier", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 17, + }, + "start": Object { + "column": 4, + "line": 17, + }, + }, + "range": Array [ + 293, + 321, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 33, + "line": 17, }, "start": Object { - "column": 18, - "line": 1, + "column": 0, + "line": 17, }, }, "range": Array [ - 18, - 19, + 289, + 322, ], - "type": "Punctuator", - "value": "{", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 18, + }, + "start": Object { + "column": 0, + "line": 2, }, + }, + "range": Array [ + 13, + 323, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 7, + "column": 3, "line": 2, }, "start": Object { - "column": 4, + "column": 0, "line": 2, }, }, "range": Array [ - 24, - 27, + 13, + 16, ], - "type": "Identifier", - "value": "bar", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 5, "line": 2, }, "start": Object { - "column": 7, + "column": 4, "line": 2, }, }, "range": Array [ - 27, - 28, + 17, + 18, ], - "type": "Punctuator", - "value": "?", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 2, }, "start": Object { - "column": 8, + "column": 6, "line": 2, }, }, "range": Array [ - 28, - 29, + 19, + 20, ], "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { @@ -34629,67 +36406,67 @@ Object { "line": 2, }, "start": Object { - "column": 9, + "column": 8, "line": 2, }, }, "range": Array [ - 29, - 30, + 21, + 23, ], - "type": "Punctuator", - "value": ")", + "type": "Numeric", + "value": "10", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 13, "line": 2, }, "start": Object { - "column": 10, + "column": 11, "line": 2, }, }, "range": Array [ - 30, - 31, + 24, + 26, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "as", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 19, "line": 2, }, "start": Object { - "column": 12, + "column": 14, "line": 2, }, }, "range": Array [ + 27, 32, - 35, ], - "type": "Identifier", - "value": "any", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 20, "line": 2, }, "start": Object { - "column": 15, + "column": 19, "line": 2, }, }, "range": Array [ - 35, - 36, + 32, + 33, ], "type": "Punctuator", "value": ";", @@ -34697,628 +36474,593 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 3, + "line": 5, }, "start": Object { "column": 0, - "line": 3, + "line": 5, }, }, "range": Array [ - 37, - 38, + 63, + 66, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 67, + 68, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "range": Array [ + 69, + 70, ], "type": "Punctuator", - "value": "}", + "value": "=", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/declare-function.src 1`] = ` -Object { - "body": Array [ Object { - "async": false, - "declare": true, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, }, - "name": "foo", - "range": Array [ - 17, - 20, - ], - "type": "Identifier", }, + "range": Array [ + 71, + 72, + ], + "type": "Punctuator", + "value": "[", + }, + Object { "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 11, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 9, + "line": 5, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 21, - 32, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 32, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 32, - ], - "type": "TSStringKeyword", - }, - }, + "range": Array [ + 72, + 74, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, }, + }, + "range": Array [ + 74, + 75, ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 13, + "line": 5, + }, + }, "range": Array [ - 0, - 42, + 76, + 78, ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, + "type": "Numeric", + "value": "20", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, }, - "range": Array [ - 33, - 41, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "range": Array [ - 35, - 41, - ], - "type": "TSStringKeyword", + "start": Object { + "column": 15, + "line": 5, }, }, - "type": "TSDeclareFunction", + "range": Array [ + 78, + 79, + ], + "type": "Punctuator", + "value": "]", }, - ], - "loc": Object { - "end": Object { - "column": 42, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "range": Array [ + 80, + 82, + ], + "type": "Identifier", + "value": "as", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 5, + }, + "start": Object { + "column": 20, + "line": 5, + }, + }, + "range": Array [ + 83, + 88, + ], + "type": "Keyword", + "value": "const", }, - }, - "range": Array [ - 0, - 42, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 26, + "line": 5, + }, + "start": Object { + "column": 25, + "line": 5, + }, + }, + "range": Array [ + 88, + 89, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 8, }, "start": Object { "column": 0, - "line": 1, + "line": 8, }, }, "range": Array [ - 0, - 7, + 128, + 131, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 132, + 133, ], "type": "Identifier", - "value": "declare", + "value": "z", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 7, + "line": 8, + }, + "start": Object { + "column": 6, + "line": 8, + }, + }, + "range": Array [ + 134, + 135, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 8, }, "start": Object { "column": 8, - "line": 1, + "line": 8, }, }, "range": Array [ - 8, - 16, + 136, + 137, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 14, + "line": 8, }, "start": Object { - "column": 17, - "line": 1, + "column": 10, + "line": 8, }, }, "range": Array [ - 17, - 20, + 138, + 142, ], "type": "Identifier", - "value": "foo", + "value": "text", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 15, + "line": 8, }, "start": Object { - "column": 20, - "line": 1, + "column": 14, + "line": 8, }, }, "range": Array [ - 20, - 21, + 142, + 143, ], "type": "Punctuator", - "value": "(", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 23, + "line": 8, }, "start": Object { - "column": 21, - "line": 1, + "column": 16, + "line": 8, }, }, "range": Array [ - 21, - 24, + 144, + 151, ], - "type": "Identifier", - "value": "bar", + "type": "String", + "value": "\\"hello\\"", }, Object { "loc": Object { "end": Object { "column": 25, - "line": 1, + "line": 8, }, "start": Object { "column": 24, - "line": 1, + "line": 8, }, }, "range": Array [ - 24, - 25, + 152, + 153, ], "type": "Punctuator", - "value": ":", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 1, + "column": 28, + "line": 8, }, "start": Object { "column": 26, - "line": 1, + "line": 8, }, }, "range": Array [ - 26, - 32, + 154, + 156, ], "type": "Identifier", - "value": "string", + "value": "as", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 1, + "column": 34, + "line": 8, }, "start": Object { - "column": 32, - "line": 1, + "column": 29, + "line": 8, }, }, "range": Array [ - 32, - 33, + 157, + 162, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 1, + "column": 35, + "line": 8, }, "start": Object { - "column": 33, - "line": 1, + "column": 34, + "line": 8, }, }, "range": Array [ - 33, - 34, + 162, + 163, ], "type": "Punctuator", - "value": ":", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 1, + "column": 3, + "line": 11, }, "start": Object { - "column": 35, - "line": 1, + "column": 0, + "line": 11, }, }, "range": Array [ - 35, - 41, + 178, + 181, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 11, + }, + "start": Object { + "column": 4, + "line": 11, + }, + }, + "range": Array [ + 182, + 183, ], "type": "Identifier", - "value": "string", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 7, + "line": 11, }, "start": Object { - "column": 41, - "line": 1, + "column": 6, + "line": 11, }, }, "range": Array [ - 41, - 42, + 184, + 185, ], "type": "Punctuator", - "value": ";", + "value": "=", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/destructuring-assignment.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 3, - 6, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 3, - 11, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 3, - 6, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "range": Array [ - 3, - 11, - ], - "right": Object { - "elements": Array [], - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 11, - ], - "type": "ArrayExpression", - }, - "type": "AssignmentPattern", - }, - }, - ], - "range": Array [ - 1, - 13, - ], - "type": "ObjectPattern", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 9, + "line": 11, }, - "operator": "=", - "range": Array [ - 1, - 19, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 16, - 19, - ], - "type": "Identifier", + "start": Object { + "column": 8, + "line": 11, }, - "type": "AssignmentExpression", }, + "range": Array [ + 186, + 187, + ], + "type": "Punctuator", + "value": "<", + }, + Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 14, + "line": 11, }, "start": Object { - "column": 0, - "line": 1, + "column": 9, + "line": 11, }, }, "range": Array [ - 0, - 21, + 187, + 192, ], - "type": "ExpressionStatement", + "type": "Keyword", + "value": "const", }, - ], - "loc": Object { - "end": Object { - "column": 21, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 11, + }, + "start": Object { + "column": 14, + "line": 11, + }, + }, + "range": Array [ + 192, + 193, + ], + "type": "Punctuator", + "value": ">", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 11, + }, + "start": Object { + "column": 15, + "line": 11, + }, + }, + "range": Array [ + 193, + 195, + ], + "type": "Numeric", + "value": "10", }, - }, - "range": Array [ - 0, - 21, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, - "line": 1, + "column": 18, + "line": 11, }, "start": Object { - "column": 0, - "line": 1, + "column": 17, + "line": 11, }, }, "range": Array [ - 0, - 1, + 195, + 196, ], "type": "Punctuator", - "value": "(", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 1, + "column": 3, + "line": 14, }, "start": Object { - "column": 1, - "line": 1, + "column": 0, + "line": 14, }, }, "range": Array [ - 1, - 2, + 226, + 229, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 5, + "line": 14, }, "start": Object { - "column": 3, - "line": 1, + "column": 4, + "line": 14, }, }, "range": Array [ - 3, - 6, + 230, + 231, ], "type": "Identifier", - "value": "foo", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 7, + "line": 14, }, "start": Object { - "column": 7, - "line": 1, + "column": 6, + "line": 14, }, }, "range": Array [ - 7, - 8, + 232, + 233, ], "type": "Punctuator", "value": "=", @@ -35326,1216 +37068,287 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 9, + "line": 14, }, "start": Object { - "column": 9, - "line": 1, + "column": 8, + "line": 14, }, }, "range": Array [ - 9, - 10, + 234, + 235, ], "type": "Punctuator", - "value": "[", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 14, + "line": 14, }, "start": Object { - "column": 10, - "line": 1, + "column": 9, + "line": 14, }, }, "range": Array [ - 10, - 11, + 235, + 240, ], - "type": "Punctuator", - "value": "]", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 15, + "line": 14, }, "start": Object { - "column": 12, - "line": 1, + "column": 14, + "line": 14, }, }, "range": Array [ - 12, - 13, + 240, + 241, ], "type": "Punctuator", - "value": "}", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 16, + "line": 14, }, "start": Object { - "column": 14, - "line": 1, + "column": 15, + "line": 14, }, }, "range": Array [ - 14, - 15, + 241, + 242, ], "type": "Punctuator", - "value": "=", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 18, + "line": 14, }, "start": Object { "column": 16, - "line": 1, + "line": 14, }, }, "range": Array [ - 16, - 19, + 242, + 244, ], - "type": "Identifier", - "value": "bar", + "type": "Numeric", + "value": "10", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 19, + "line": 14, }, "start": Object { - "column": 19, - "line": 1, + "column": 18, + "line": 14, }, }, "range": Array [ - 19, - 20, + 244, + 245, ], "type": "Punctuator", - "value": ")", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 22, + "line": 14, }, "start": Object { "column": 20, - "line": 1, + "line": 14, }, }, "range": Array [ - 20, - 21, + 246, + 248, + ], + "type": "Numeric", + "value": "20", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 14, + }, + "start": Object { + "column": 22, + "line": 14, + }, + }, + "range": Array [ + 248, + 249, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 14, + }, + "start": Object { + "column": 23, + "line": 14, + }, + }, + "range": Array [ + 249, + 250, ], "type": "Punctuator", "value": ";", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/destructuring-assignment-nested.src 1`] = ` -Object { - "body": Array [ - Object { - "expression": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 81, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 3, - 6, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 79, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 3, - 79, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 73, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 10, - 13, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 71, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 10, - 71, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 66, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "baz", - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 64, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 17, - 64, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "left": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 28, - 31, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 28, - 42, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "left": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 34, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 34, - 35, - ], - "type": "Identifier", - }, - ], - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "range": Array [ - 33, - 36, - ], - "type": "ArrayPattern", - }, - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "range": Array [ - 33, - 42, - ], - "right": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 40, - "line": 1, - }, - }, - "range": Array [ - 40, - 41, - ], - "raw": "3", - "type": "Literal", - "value": 3, - }, - ], - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 39, - "line": 1, - }, - }, - "range": Array [ - 39, - 42, - ], - "type": "ArrayExpression", - }, - "type": "AssignmentPattern", - }, - }, - ], - "range": Array [ - 26, - 44, - ], - "type": "ObjectPattern", - }, - "loc": Object { - "end": Object { - "column": 58, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 58, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 58, - "line": 1, - }, - "start": Object { - "column": 47, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 52, - "line": 1, - }, - "start": Object { - "column": 49, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 49, - 52, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 57, - "line": 1, - }, - "start": Object { - "column": 49, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 49, - 57, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 56, - "line": 1, - }, - "start": Object { - "column": 55, - "line": 1, - }, - }, - "range": Array [ - 55, - 56, - ], - "raw": "2", - "type": "Literal", - "value": 2, - }, - ], - "loc": Object { - "end": Object { - "column": 57, - "line": 1, - }, - "start": Object { - "column": 54, - "line": 1, - }, - }, - "range": Array [ - 54, - 57, - ], - "type": "ArrayExpression", - }, - }, - ], - "range": Array [ - 47, - 58, - ], - "type": "ObjectExpression", - }, - "type": "AssignmentPattern", - }, - ], - "loc": Object { - "end": Object { - "column": 59, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 59, - ], - "type": "ArrayPattern", - }, - "loc": Object { - "end": Object { - "column": 64, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 64, - ], - "right": Object { - "elements": Array [], - "loc": Object { - "end": Object { - "column": 64, - "line": 1, - }, - "start": Object { - "column": 62, - "line": 1, - }, - }, - "range": Array [ - 62, - 64, - ], - "type": "ArrayExpression", - }, - "type": "AssignmentPattern", - }, - }, - ], - "range": Array [ - 15, - 66, - ], - "type": "ObjectPattern", - }, - "loc": Object { - "end": Object { - "column": 71, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 71, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 71, - "line": 1, - }, - "start": Object { - "column": 69, - "line": 1, - }, - }, - "properties": Array [], - "range": Array [ - 69, - 71, - ], - "type": "ObjectExpression", - }, - "type": "AssignmentPattern", - }, - }, - ], - "range": Array [ - 8, - 73, - ], - "type": "ObjectPattern", - }, - "loc": Object { - "end": Object { - "column": 79, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 79, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 79, - "line": 1, - }, - "start": Object { - "column": 76, - "line": 1, - }, - }, - "properties": Array [], - "range": Array [ - 76, - 79, - ], - "type": "ObjectExpression", - }, - "type": "AssignmentPattern", - }, - }, - ], - "range": Array [ - 1, - 81, - ], - "type": "ObjectPattern", - }, - "loc": Object { - "end": Object { - "column": 127, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "operator": "=", - "range": Array [ - 1, - 127, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 127, - "line": 1, - }, - "start": Object { - "column": 84, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 89, - "line": 1, - }, - "start": Object { - "column": 86, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 86, - 89, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 126, - "line": 1, - }, - "start": Object { - "column": 86, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 86, - 126, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 126, - "line": 1, - }, - "start": Object { - "column": 91, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 96, - "line": 1, - }, - "start": Object { - "column": 93, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 93, - 96, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 124, - "line": 1, - }, - "start": Object { - "column": 93, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 93, - 124, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 124, - "line": 1, - }, - "start": Object { - "column": 98, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 103, - "line": 1, - }, - "start": Object { - "column": 100, - "line": 1, - }, - }, - "name": "baz", - "range": Array [ - 100, - 103, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 122, - "line": 1, - }, - "start": Object { - "column": 100, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 100, - 122, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 107, - "line": 1, - }, - "start": Object { - "column": 106, - "line": 1, - }, - }, - "range": Array [ - 106, - 107, - ], - "raw": "2", - "type": "Literal", - "value": 2, - }, - Object { - "loc": Object { - "end": Object { - "column": 121, - "line": 1, - }, - "start": Object { - "column": 109, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 114, - "line": 1, - }, - "start": Object { - "column": 111, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 111, - 114, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 119, - "line": 1, - }, - "start": Object { - "column": 111, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 111, - 119, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 118, - "line": 1, - }, - "start": Object { - "column": 117, - "line": 1, - }, - }, - "range": Array [ - 117, - 118, - ], - "raw": "3", - "type": "Literal", - "value": 3, - }, - ], - "loc": Object { - "end": Object { - "column": 119, - "line": 1, - }, - "start": Object { - "column": 116, - "line": 1, - }, - }, - "range": Array [ - 116, - 119, - ], - "type": "ArrayExpression", - }, - }, - ], - "range": Array [ - 109, - 121, - ], - "type": "ObjectExpression", - }, - ], - "loc": Object { - "end": Object { - "column": 122, - "line": 1, - }, - "start": Object { - "column": 105, - "line": 1, - }, - }, - "range": Array [ - 105, - 122, - ], - "type": "ArrayExpression", - }, - }, - ], - "range": Array [ - 98, - 124, - ], - "type": "ObjectExpression", - }, - }, - ], - "range": Array [ - 91, - 126, - ], - "type": "ObjectExpression", - }, - }, - ], - "range": Array [ - 84, - 127, - ], - "type": "ObjectExpression", - }, - "type": "AssignmentExpression", - }, - "loc": Object { - "end": Object { - "column": 129, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 129, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 130, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, - "line": 1, + "column": 3, + "line": 17, }, "start": Object { "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 1, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, + "line": 17, }, }, "range": Array [ - 1, - 2, + 289, + 292, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 5, + "line": 17, }, "start": Object { - "column": 3, - "line": 1, + "column": 4, + "line": 17, }, }, "range": Array [ - 3, - 6, + 293, + 294, ], "type": "Identifier", - "value": "foo", + "value": "z", }, Object { "loc": Object { "end": Object { "column": 7, - "line": 1, + "line": 17, }, "start": Object { "column": 6, - "line": 1, + "line": 17, }, }, "range": Array [ - 6, - 7, + 295, + 296, ], "type": "Punctuator", - "value": ":", + "value": "=", }, Object { "loc": Object { "end": Object { "column": 9, - "line": 1, + "line": 17, }, "start": Object { "column": 8, - "line": 1, + "line": 17, }, }, "range": Array [ - 8, - 9, + 297, + 298, ], "type": "Punctuator", - "value": "{", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 14, + "line": 17, }, "start": Object { - "column": 10, - "line": 1, + "column": 9, + "line": 17, }, }, "range": Array [ - 10, - 13, + 298, + 303, ], - "type": "Identifier", - "value": "bar", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 15, + "line": 17, }, "start": Object { - "column": 13, - "line": 1, + "column": 14, + "line": 17, }, }, "range": Array [ - 13, - 14, + 303, + 304, ], "type": "Punctuator", - "value": ":", + "value": ">", }, Object { "loc": Object { "end": Object { "column": 16, - "line": 1, + "line": 17, }, "start": Object { "column": 15, - "line": 1, + "line": 17, }, }, "range": Array [ - 15, - 16, + 304, + 305, ], "type": "Punctuator", "value": "{", @@ -36543,35 +37356,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 21, + "line": 17, }, "start": Object { "column": 17, - "line": 1, + "line": 17, }, }, "range": Array [ - 17, - 20, + 306, + 310, ], "type": "Identifier", - "value": "baz", + "value": "text", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 22, + "line": 17, }, "start": Object { - "column": 20, - "line": 1, + "column": 21, + "line": 17, }, }, "range": Array [ - 20, - 21, + 310, + 311, ], "type": "Punctuator", "value": ":", @@ -36579,683 +37392,984 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 30, + "line": 17, }, "start": Object { - "column": 22, - "line": 1, + "column": 23, + "line": 17, }, }, "range": Array [ - 22, - 23, + 312, + 319, ], - "type": "Punctuator", - "value": "[", + "type": "String", + "value": "\\"hello\\"", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 32, + "line": 17, }, "start": Object { - "column": 23, - "line": 1, + "column": 31, + "line": 17, }, }, "range": Array [ - 23, - 24, + 320, + 321, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 33, + "line": 17, }, "start": Object { - "column": 24, - "line": 1, + "column": 32, + "line": 17, }, }, "range": Array [ - 24, - 25, + 321, + 322, ], "type": "Punctuator", - "value": ",", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/const-enum.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, + "const": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, }, + "name": "Foo", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", }, - "range": Array [ - 26, - 27, - ], - "type": "Punctuator", - "value": "{", - }, - Object { "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { - "column": 28, + "column": 0, "line": 1, }, }, + "members": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "initializer": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 28, + ], + "type": "TSEnumMember", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 34, + 37, + ], + "type": "TSEnumMember", + }, + ], "range": Array [ - 28, - 31, + 0, + 39, ], - "type": "Identifier", - "value": "foo", + "type": "TSEnumDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 39, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 32, + "column": 5, "line": 1, }, "start": Object { - "column": 31, + "column": 0, "line": 1, }, }, "range": Array [ - 31, - 32, + 0, + 5, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 34, + "column": 10, "line": 1, }, "start": Object { - "column": 33, + "column": 6, "line": 1, }, }, "range": Array [ - 33, - 34, + 6, + 10, ], - "type": "Punctuator", - "value": "[", + "type": "Keyword", + "value": "enum", }, Object { "loc": Object { "end": Object { - "column": 35, + "column": 14, "line": 1, }, "start": Object { - "column": 34, + "column": 11, "line": 1, }, }, "range": Array [ - 34, - 35, + 11, + 14, ], "type": "Identifier", - "value": "x", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 36, + "column": 16, "line": 1, }, "start": Object { - "column": 35, + "column": 15, "line": 1, }, }, "range": Array [ - 35, - 36, + 15, + 16, ], "type": "Punctuator", - "value": "]", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 37, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 37, - 38, + 21, + 24, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 40, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { - "column": 39, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ - 39, - 40, + 25, + 26, ], "type": "Punctuator", - "value": "[", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 40, - "line": 1, + "column": 10, + "line": 2, }, }, "range": Array [ - 40, - 41, + 27, + 28, ], "type": "Numeric", - "value": "3", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 12, + "line": 2, }, "start": Object { - "column": 41, - "line": 1, + "column": 11, + "line": 2, }, }, "range": Array [ - 41, - 42, + 28, + 29, ], "type": "Punctuator", - "value": "]", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 44, - "line": 1, + "column": 7, + "line": 3, }, "start": Object { - "column": 43, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 43, - 44, + 34, + 37, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 46, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { - "column": 45, - "line": 1, + "column": 0, + "line": 4, }, }, "range": Array [ - 45, - 46, + 38, + 39, ], "type": "Punctuator", - "value": "=", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/declare-class-with-optional-method.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 1, - }, - "start": Object { - "column": 47, - "line": 1, + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "bar", + "optional": true, + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 24, + 36, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": null, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 28, + 36, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 30, + 35, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 32, + 35, + ], + "type": "TSAnyKeyword", + }, + }, + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 1, + }, }, + "range": Array [ + 18, + 38, + ], + "type": "ClassBody", }, - "range": Array [ - 47, - 48, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 52, - "line": 1, - }, - "start": Object { - "column": 49, - "line": 1, + "declare": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, }, + "name": "Foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", }, - "range": Array [ - 49, - 52, - ], - "type": "Identifier", - "value": "foo", - }, - Object { "loc": Object { "end": Object { - "column": 53, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 52, + "column": 0, "line": 1, }, }, "range": Array [ - 52, - 53, + 0, + 38, ], - "type": "Punctuator", - "value": ":", + "superClass": null, + "type": "ClassDeclaration", }, - Object { - "loc": Object { - "end": Object { - "column": 55, - "line": 1, - }, - "start": Object { - "column": 54, - "line": 1, - }, - }, - "range": Array [ - 54, - 55, - ], - "type": "Punctuator", - "value": "[", + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 38, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 56, + "column": 7, "line": 1, }, "start": Object { - "column": 55, + "column": 0, "line": 1, }, }, "range": Array [ - 55, - 56, + 0, + 7, ], - "type": "Numeric", - "value": "2", + "type": "Identifier", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 57, + "column": 13, "line": 1, }, "start": Object { - "column": 56, + "column": 8, "line": 1, }, }, "range": Array [ - 56, - 57, + 8, + 13, ], - "type": "Punctuator", - "value": "]", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 58, + "column": 17, "line": 1, }, "start": Object { - "column": 57, + "column": 14, "line": 1, }, }, "range": Array [ - 57, - 58, + 14, + 17, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 59, + "column": 19, "line": 1, }, "start": Object { - "column": 58, + "column": 18, "line": 1, }, }, "range": Array [ - 58, - 59, + 18, + 19, ], "type": "Punctuator", - "value": "]", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 61, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 60, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 60, - 61, + 24, + 27, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 63, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 62, - "line": 1, + "column": 7, + "line": 2, }, }, "range": Array [ - 62, - 63, + 27, + 28, ], "type": "Punctuator", - "value": "[", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 64, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { - "column": 63, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ - 63, - 64, + 28, + 29, ], "type": "Punctuator", - "value": "]", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 66, - "line": 1, + "column": 10, + "line": 2, }, "start": Object { - "column": 65, - "line": 1, + "column": 9, + "line": 2, }, }, "range": Array [ - 65, - 66, + 29, + 30, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 68, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 67, - "line": 1, + "column": 10, + "line": 2, }, }, "range": Array [ - 67, - 68, + 30, + 31, ], "type": "Punctuator", - "value": "=", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 70, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 69, - "line": 1, + "column": 12, + "line": 2, }, }, "range": Array [ - 69, - 70, + 32, + 35, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "any", }, Object { "loc": Object { "end": Object { - "column": 71, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 70, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ - 70, - 71, + 35, + 36, ], "type": "Punctuator", - "value": "}", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 73, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 72, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 72, - 73, + 37, + 38, ], "type": "Punctuator", "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/declare-function.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 75, - "line": 1, - }, - "start": Object { - "column": 74, - "line": 1, + "async": false, + "declare": true, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, }, + "name": "foo", + "range": Array [ + 17, + 20, + ], + "type": "Identifier", }, - "range": Array [ - 74, - 75, - ], - "type": "Punctuator", - "value": "=", - }, - Object { "loc": Object { "end": Object { - "column": 77, + "column": 42, "line": 1, }, "start": Object { - "column": 76, + "column": 0, "line": 1, }, }, - "range": Array [ - 76, - 77, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 79, - "line": 1, - }, - "start": Object { - "column": 78, - "line": 1, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 21, + 32, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 32, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 32, + ], + "type": "TSStringKeyword", + }, + }, }, - }, + ], "range": Array [ - 78, - 79, + 0, + 42, ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 81, - "line": 1, + "returnType": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, }, - "start": Object { - "column": 80, - "line": 1, + "range": Array [ + 33, + 41, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 41, + ], + "type": "TSStringKeyword", }, }, - "range": Array [ - 80, - 81, - ], - "type": "Punctuator", - "value": "}", + "type": "TSDeclareFunction", + }, + ], + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 42, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 83, + "column": 7, "line": 1, }, "start": Object { - "column": 82, + "column": 0, "line": 1, }, }, "range": Array [ - 82, - 83, + 0, + 7, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 85, + "column": 16, "line": 1, }, "start": Object { - "column": 84, + "column": 8, "line": 1, }, }, "range": Array [ - 84, - 85, + 8, + 16, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 89, + "column": 20, "line": 1, }, "start": Object { - "column": 86, + "column": 17, "line": 1, }, }, "range": Array [ - 86, - 89, + 17, + 20, ], "type": "Identifier", "value": "foo", @@ -37263,53 +38377,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 90, - "line": 1, - }, - "start": Object { - "column": 89, - "line": 1, - }, - }, - "range": Array [ - 89, - 90, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 92, + "column": 21, "line": 1, }, "start": Object { - "column": 91, + "column": 20, "line": 1, }, }, "range": Array [ - 91, - 92, + 20, + 21, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 96, + "column": 24, "line": 1, }, "start": Object { - "column": 93, + "column": 21, "line": 1, }, }, "range": Array [ - 93, - 96, + 21, + 24, ], "type": "Identifier", "value": "bar", @@ -37317,17 +38413,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 97, + "column": 25, "line": 1, }, "start": Object { - "column": 96, + "column": 24, "line": 1, }, }, "range": Array [ - 96, - 97, + 24, + 25, ], "type": "Punctuator", "value": ":", @@ -37335,53 +38431,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 99, + "column": 32, "line": 1, }, "start": Object { - "column": 98, + "column": 26, "line": 1, }, }, "range": Array [ - 98, - 99, + 26, + 32, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 103, + "column": 33, "line": 1, }, "start": Object { - "column": 100, + "column": 32, "line": 1, }, }, "range": Array [ - 100, - 103, + 32, + 33, ], - "type": "Identifier", - "value": "baz", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 104, + "column": 34, "line": 1, }, "start": Object { - "column": 103, + "column": 33, "line": 1, }, }, "range": Array [ - 103, - 104, + 33, + 34, ], "type": "Punctuator", "value": ":", @@ -37389,297 +38485,45 @@ Object { Object { "loc": Object { "end": Object { - "column": 106, + "column": 41, "line": 1, }, "start": Object { - "column": 105, + "column": 35, "line": 1, }, }, "range": Array [ - 105, - 106, + 35, + 41, ], - "type": "Punctuator", - "value": "[", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 107, + "column": 42, "line": 1, }, "start": Object { - "column": 106, + "column": 41, "line": 1, }, }, "range": Array [ - 106, - 107, + 41, + 42, ], - "type": "Numeric", - "value": "2", - }, - Object { - "loc": Object { - "end": Object { - "column": 108, - "line": 1, - }, - "start": Object { - "column": 107, - "line": 1, - }, - }, - "range": Array [ - 107, - 108, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 110, - "line": 1, - }, - "start": Object { - "column": 109, - "line": 1, - }, - }, - "range": Array [ - 109, - 110, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 114, - "line": 1, - }, - "start": Object { - "column": 111, - "line": 1, - }, - }, - "range": Array [ - 111, - 114, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 115, - "line": 1, - }, - "start": Object { - "column": 114, - "line": 1, - }, - }, - "range": Array [ - 114, - 115, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 117, - "line": 1, - }, - "start": Object { - "column": 116, - "line": 1, - }, - }, - "range": Array [ - 116, - 117, - ], - "type": "Punctuator", - "value": "[", - }, - Object { - "loc": Object { - "end": Object { - "column": 118, - "line": 1, - }, - "start": Object { - "column": 117, - "line": 1, - }, - }, - "range": Array [ - 117, - 118, - ], - "type": "Numeric", - "value": "3", - }, - Object { - "loc": Object { - "end": Object { - "column": 119, - "line": 1, - }, - "start": Object { - "column": 118, - "line": 1, - }, - }, - "range": Array [ - 118, - 119, - ], - "type": "Punctuator", - "value": "]", - }, - Object { - "loc": Object { - "end": Object { - "column": 121, - "line": 1, - }, - "start": Object { - "column": 120, - "line": 1, - }, - }, - "range": Array [ - 120, - 121, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 122, - "line": 1, - }, - "start": Object { - "column": 121, - "line": 1, - }, - }, - "range": Array [ - 121, - 122, - ], - "type": "Punctuator", - "value": "]", - }, - Object { - "loc": Object { - "end": Object { - "column": 124, - "line": 1, - }, - "start": Object { - "column": 123, - "line": 1, - }, - }, - "range": Array [ - 123, - 124, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 126, - "line": 1, - }, - "start": Object { - "column": 125, - "line": 1, - }, - }, - "range": Array [ - 125, - 126, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 127, - "line": 1, - }, - "start": Object { - "column": 126, - "line": 1, - }, - }, - "range": Array [ - 126, - 127, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 128, - "line": 1, - }, - "start": Object { - "column": 127, - "line": 1, - }, - }, - "range": Array [ - 127, - 128, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 129, - "line": 1, - }, - "start": Object { - "column": 128, - "line": 1, - }, - }, - "range": Array [ - 128, - 129, - ], - "type": "Punctuator", - "value": ";", + "type": "Punctuator", + "value": ";", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/destructuring-assignment-object.src 1`] = ` +exports[`typescript fixtures/basics/destructuring-assignment.src 1`] = ` Object { "body": Array [ Object { @@ -37768,6 +38612,7 @@ Object { 11, ], "right": Object { + "elements": Array [], "loc": Object { "end": Object { "column": 11, @@ -37778,12 +38623,11 @@ Object { "line": 1, }, }, - "properties": Array [], "range": Array [ 9, 11, ], - "type": "ObjectExpression", + "type": "ArrayExpression", }, "type": "AssignmentPattern", }, @@ -37849,8 +38693,8 @@ Object { ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { "column": 0, @@ -37859,7 +38703,7 @@ Object { }, "range": Array [ 0, - 22, + 21, ], "sourceType": "script", "tokens": Array [ @@ -37951,7 +38795,7 @@ Object { 10, ], "type": "Punctuator", - "value": "{", + "value": "[", }, Object { "loc": Object { @@ -37969,7 +38813,7 @@ Object { 11, ], "type": "Punctuator", - "value": "}", + "value": "]", }, Object { "loc": Object { @@ -38066,234 +38910,952 @@ Object { } `; -exports[`typescript fixtures/basics/destructuring-assignment-property.src 1`] = ` +exports[`typescript fixtures/basics/destructuring-assignment-nested.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "range": Array [ - 33, - 37, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 81, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, }, - }, - "name": "Foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 3, + 6, + ], + "type": "Identifier", }, - "start": Object { - "column": 13, - "line": 1, + "kind": "init", + "loc": Object { + "end": Object { + "column": 79, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { + "method": false, + "range": Array [ + 3, + 79, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { "loc": Object { "end": Object { - "column": 18, + "column": 73, "line": 1, }, "start": Object { - "column": 15, + "column": 8, "line": 1, }, }, - "name": "foo", + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 71, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 10, + 71, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 66, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 64, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 17, + 64, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 28, + 31, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 28, + 42, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 36, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 42, + ], + "right": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 41, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + ], + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 42, + ], + "type": "ArrayExpression", + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 26, + 44, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 58, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 58, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 58, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 52, + "line": 1, + }, + "start": Object { + "column": 49, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 49, + 52, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 57, + "line": 1, + }, + "start": Object { + "column": 49, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 49, + 57, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 55, + "line": 1, + }, + }, + "range": Array [ + 55, + 56, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + ], + "loc": Object { + "end": Object { + "column": 57, + "line": 1, + }, + "start": Object { + "column": 54, + "line": 1, + }, + }, + "range": Array [ + 54, + 57, + ], + "type": "ArrayExpression", + }, + }, + ], + "range": Array [ + 47, + 58, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentPattern", + }, + ], + "loc": Object { + "end": Object { + "column": 59, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 59, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 64, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 64, + ], + "right": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 64, + "line": 1, + }, + "start": Object { + "column": 62, + "line": 1, + }, + }, + "range": Array [ + 62, + 64, + ], + "type": "ArrayExpression", + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 15, + 66, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 71, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 71, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 71, + "line": 1, + }, + "start": Object { + "column": 69, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 69, + 71, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentPattern", + }, + }, + ], "range": Array [ - 15, - 18, + 8, + 73, ], - "type": "Identifier", + "type": "ObjectPattern", }, - "kind": "init", "loc": Object { "end": Object { - "column": 23, + "column": 79, "line": 1, }, "start": Object { - "column": 15, + "column": 8, "line": 1, }, }, - "method": false, "range": Array [ - 15, - 23, + 8, + 79, ], - "shorthand": true, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, + "right": Object { "loc": Object { "end": Object { - "column": 23, + "column": 79, "line": 1, }, "start": Object { - "column": 15, + "column": 76, "line": 1, }, }, + "properties": Array [], "range": Array [ - 15, - 23, + 76, + 79, ], - "right": Object { - "elements": Array [], - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 23, - ], - "type": "ArrayExpression", - }, - "type": "AssignmentPattern", + "type": "ObjectExpression", }, + "type": "AssignmentPattern", }, - ], - "range": Array [ - 13, - 25, - ], - "type": "ObjectPattern", + }, + ], + "range": Array [ + 1, + 81, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 127, + "line": 1, }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 1, + 127, + ], + "right": Object { "loc": Object { "end": Object { - "column": 31, + "column": 127, "line": 1, }, "start": Object { - "column": 13, + "column": 84, "line": 1, }, }, - "range": Array [ - 13, - 31, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 89, + "line": 1, + }, + "start": Object { + "column": 86, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 86, + 89, + ], + "type": "Identifier", }, - "start": Object { - "column": 28, - "line": 1, + "kind": "init", + "loc": Object { + "end": Object { + "column": 126, + "line": 1, + }, + "start": Object { + "column": 86, + "line": 1, + }, }, - }, - "name": "bar", - "range": Array [ - 28, - 31, - ], - "type": "Identifier", - }, - "type": "AssignmentPattern", - }, - ], - "range": Array [ - 0, - 37, - ], - "type": "FunctionDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 38, + "method": false, + "range": Array [ + 86, + 126, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 126, + "line": 1, + }, + "start": Object { + "column": 91, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 96, + "line": 1, + }, + "start": Object { + "column": 93, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 93, + 96, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 124, + "line": 1, + }, + "start": Object { + "column": 93, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 93, + 124, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 124, + "line": 1, + }, + "start": Object { + "column": 98, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 103, + "line": 1, + }, + "start": Object { + "column": 100, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 100, + 103, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 122, + "line": 1, + }, + "start": Object { + "column": 100, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 100, + 122, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 107, + "line": 1, + }, + "start": Object { + "column": 106, + "line": 1, + }, + }, + "range": Array [ + 106, + 107, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + Object { + "loc": Object { + "end": Object { + "column": 121, + "line": 1, + }, + "start": Object { + "column": 109, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 114, + "line": 1, + }, + "start": Object { + "column": 111, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 111, + 114, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 119, + "line": 1, + }, + "start": Object { + "column": 111, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 111, + 119, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 118, + "line": 1, + }, + "start": Object { + "column": 117, + "line": 1, + }, + }, + "range": Array [ + 117, + 118, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + ], + "loc": Object { + "end": Object { + "column": 119, + "line": 1, + }, + "start": Object { + "column": 116, + "line": 1, + }, + }, + "range": Array [ + 116, + 119, + ], + "type": "ArrayExpression", + }, + }, + ], + "range": Array [ + 109, + 121, + ], + "type": "ObjectExpression", + }, + ], + "loc": Object { + "end": Object { + "column": 122, + "line": 1, + }, + "start": Object { + "column": 105, + "line": 1, + }, + }, + "range": Array [ + 105, + 122, + ], + "type": "ArrayExpression", + }, + }, + ], + "range": Array [ + 98, + 124, + ], + "type": "ObjectExpression", + }, + }, + ], + "range": Array [ + 91, + 126, + ], + "type": "ObjectExpression", + }, + }, + ], + "range": Array [ + 84, + 127, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 129, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 129, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 130, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 1, "line": 1, }, "start": Object { @@ -38303,28 +39865,82 @@ Object { }, "range": Array [ 0, - 8, + 1, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 6, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, "line": 1, }, "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { "column": 9, "line": 1, }, + "start": Object { + "column": 8, + "line": 1, + }, }, "range": Array [ + 8, 9, - 12, ], - "type": "Identifier", - "value": "Foo", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { @@ -38333,16 +39949,16 @@ Object { "line": 1, }, "start": Object { - "column": 12, + "column": 10, "line": 1, }, }, "range": Array [ - 12, + 10, 13, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { @@ -38360,12 +39976,12 @@ Object { 14, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 16, "line": 1, }, "start": Object { @@ -38375,10 +39991,10 @@ Object { }, "range": Array [ 15, - 18, + 16, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { @@ -38387,34 +40003,34 @@ Object { "line": 1, }, "start": Object { - "column": 19, + "column": 17, "line": 1, }, }, "range": Array [ - 19, + 17, 20, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 21, "line": 1, }, "start": Object { - "column": 21, + "column": 20, "line": 1, }, }, "range": Array [ + 20, 21, - 22, ], "type": "Punctuator", - "value": "[", + "value": ":", }, Object { "loc": Object { @@ -38432,7 +40048,25 @@ Object { 23, ], "type": "Punctuator", - "value": "]", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + "value": "a", }, Object { "loc": Object { @@ -38450,7 +40084,7 @@ Object { 25, ], "type": "Punctuator", - "value": "}", + "value": ",", }, Object { "loc": Object { @@ -38468,7 +40102,7 @@ Object { 27, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { @@ -38486,7 +40120,7 @@ Object { 31, ], "type": "Identifier", - "value": "bar", + "value": "foo", }, Object { "loc": Object { @@ -38504,7 +40138,7 @@ Object { 32, ], "type": "Punctuator", - "value": ")", + "value": ":", }, Object { "loc": Object { @@ -38522,284 +40156,184 @@ Object { 34, ], "type": "Punctuator", - "value": "{", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 35, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, }, }, "range": Array [ + 35, 36, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ 37, + 38, ], "type": "Punctuator", - "value": "}", + "value": "=", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/directive-in-module.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "directive": "use strict", - "expression": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 15, - 27, - ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 15, - 28, - ], - "type": "ExpressionStatement", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "name": "a", - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 3, - }, - }, - "range": Array [ - 39, - 40, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "range": Array [ - 35, - 40, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "range": Array [ - 31, - 41, - ], - "type": "VariableDeclaration", - }, - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 4, - }, - "start": Object { - "column": 2, - "line": 4, - }, - }, - "range": Array [ - 44, - 56, - ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 4, - }, - "start": Object { - "column": 2, - "line": 4, - }, - }, - "range": Array [ - 44, - 57, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 11, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, }, - "range": Array [ - 11, - 59, - ], - "type": "TSModuleBlock", }, - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, }, - "name": "foo", - "range": Array [ - 7, - 10, - ], - "type": "Identifier", }, + "range": Array [ + 40, + 41, + ], + "type": "Numeric", + "value": "3", + }, + Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 42, + "line": 1, }, "start": Object { - "column": 0, + "column": 41, "line": 1, }, }, "range": Array [ - 0, - 59, + 41, + 42, ], - "type": "TSModuleDeclaration", + "type": "Punctuator", + "value": "]", }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 6, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": "}", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 45, + "line": 1, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": "=", }, - }, - "range": Array [ - 0, - 60, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 48, "line": 1, }, "start": Object { - "column": 0, + "column": 47, "line": 1, }, }, "range": Array [ - 0, - 6, + 47, + 48, ], - "type": "Identifier", - "value": "module", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 52, "line": 1, }, "start": Object { - "column": 7, + "column": 49, "line": 1, }, }, "range": Array [ - 7, - 10, + 49, + 52, ], "type": "Identifier", "value": "foo", @@ -38807,107 +40341,125 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 53, "line": 1, }, "start": Object { - "column": 11, + "column": 52, "line": 1, }, }, "range": Array [ - 11, - 12, + 52, + 53, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 55, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 54, + "line": 1, }, }, "range": Array [ - 15, - 27, + 54, + 55, ], - "type": "String", - "value": "\\"use strict\\"", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 56, + "line": 1, }, "start": Object { - "column": 14, - "line": 2, + "column": 55, + "line": 1, }, }, "range": Array [ - 27, - 28, + 55, + 56, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 1, + }, + "start": Object { + "column": 56, + "line": 1, + }, + }, + "range": Array [ + 56, + 57, ], "type": "Punctuator", - "value": ";", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 58, + "line": 1, }, "start": Object { - "column": 2, - "line": 3, + "column": 57, + "line": 1, }, }, "range": Array [ - 31, - 34, + 57, + 58, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 59, + "line": 1, }, "start": Object { - "column": 6, - "line": 3, + "column": 58, + "line": 1, }, }, "range": Array [ - 35, - 36, + 58, + 59, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 3, + "column": 61, + "line": 1, }, "start": Object { - "column": 8, - "line": 3, + "column": 60, + "line": 1, }, }, "range": Array [ - 37, - 38, + 60, + 61, ], "type": "Punctuator", "value": "=", @@ -38915,369 +40467,233 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, - "line": 3, + "column": 63, + "line": 1, }, "start": Object { - "column": 10, - "line": 3, + "column": 62, + "line": 1, }, }, "range": Array [ - 39, - 40, + 62, + 63, ], - "type": "Numeric", - "value": "1", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 3, + "column": 64, + "line": 1, }, "start": Object { - "column": 11, - "line": 3, + "column": 63, + "line": 1, }, }, "range": Array [ - 40, - 41, + 63, + 64, ], "type": "Punctuator", - "value": ";", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 4, + "column": 66, + "line": 1, }, "start": Object { - "column": 2, - "line": 4, + "column": 65, + "line": 1, }, }, "range": Array [ - 44, - 56, + 65, + 66, ], - "type": "String", - "value": "\\"use strict\\"", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 4, + "column": 68, + "line": 1, }, "start": Object { - "column": 14, - "line": 4, + "column": 67, + "line": 1, }, }, "range": Array [ - 56, - 57, + 67, + 68, ], "type": "Punctuator", - "value": ";", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 70, + "line": 1, }, "start": Object { - "column": 0, - "line": 5, + "column": 69, + "line": 1, }, }, "range": Array [ - 58, - 59, + 69, + 70, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 71, + "line": 1, + }, + "start": Object { + "column": 70, + "line": 1, + }, + }, + "range": Array [ + 70, + 71, ], "type": "Punctuator", "value": "}", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/directive-in-namespace.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "directive": "use strict", - "expression": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 18, - 30, - ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 18, - 31, - ], - "type": "ExpressionStatement", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "name": "a", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 3, - }, - }, - "range": Array [ - 42, - 43, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "range": Array [ - 38, - 43, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "range": Array [ - 34, - 44, - ], - "type": "VariableDeclaration", - }, - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 4, - }, - "start": Object { - "column": 2, - "line": 4, - }, - }, - "range": Array [ - 47, - 59, - ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 4, - }, - "start": Object { - "column": 2, - "line": 4, - }, - }, - "range": Array [ - 47, - 60, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 14, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 73, + "line": 1, }, - "range": Array [ - 14, - 62, - ], - "type": "TSModuleBlock", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, + "start": Object { + "column": 72, + "line": 1, }, - "name": "foo", - "range": Array [ - 10, - 13, - ], - "type": "Identifier", }, + "range": Array [ + 72, + 73, + ], + "type": "Punctuator", + "value": "}", + }, + Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 75, + "line": 1, }, "start": Object { - "column": 0, + "column": 74, "line": 1, }, }, "range": Array [ - 0, - 62, + 74, + 75, ], - "type": "TSModuleDeclaration", + "type": "Punctuator", + "value": "=", }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 6, + Object { + "loc": Object { + "end": Object { + "column": 77, + "line": 1, + }, + "start": Object { + "column": 76, + "line": 1, + }, + }, + "range": Array [ + 76, + 77, + ], + "type": "Punctuator", + "value": "{", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 79, + "line": 1, + }, + "start": Object { + "column": 78, + "line": 1, + }, + }, + "range": Array [ + 78, + 79, + ], + "type": "Punctuator", + "value": "}", }, - }, - "range": Array [ - 0, - 63, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 9, + "column": 81, "line": 1, }, "start": Object { - "column": 0, + "column": 80, "line": 1, }, }, "range": Array [ - 0, - 9, + 80, + 81, ], - "type": "Identifier", - "value": "namespace", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 83, "line": 1, }, "start": Object { - "column": 10, + "column": 82, "line": 1, }, }, "range": Array [ - 10, - 13, + 82, + 83, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 85, "line": 1, }, "start": Object { - "column": 14, + "column": 84, "line": 1, }, }, "range": Array [ - 14, - 15, + 84, + 85, ], "type": "Punctuator", "value": "{", @@ -39285,461 +40701,431 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 89, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 86, + "line": 1, }, }, "range": Array [ - 18, - 30, + 86, + 89, ], - "type": "String", - "value": "\\"use strict\\"", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 90, + "line": 1, }, "start": Object { - "column": 14, - "line": 2, + "column": 89, + "line": 1, }, }, "range": Array [ - 30, - 31, + 89, + 90, ], "type": "Punctuator", - "value": ";", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 92, + "line": 1, }, "start": Object { - "column": 2, - "line": 3, + "column": 91, + "line": 1, }, }, "range": Array [ - 34, - 37, + 91, + 92, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 96, + "line": 1, }, "start": Object { - "column": 6, - "line": 3, + "column": 93, + "line": 1, }, }, "range": Array [ - 38, - 39, + 93, + 96, ], "type": "Identifier", - "value": "a", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 3, + "column": 97, + "line": 1, }, "start": Object { - "column": 8, - "line": 3, + "column": 96, + "line": 1, }, }, "range": Array [ - 40, - 41, + 96, + 97, ], "type": "Punctuator", - "value": "=", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 3, + "column": 99, + "line": 1, }, "start": Object { - "column": 10, - "line": 3, + "column": 98, + "line": 1, }, }, "range": Array [ - 42, - 43, + 98, + 99, ], - "type": "Numeric", - "value": "1", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 3, + "column": 103, + "line": 1, }, "start": Object { - "column": 11, - "line": 3, + "column": 100, + "line": 1, }, }, "range": Array [ - 43, - 44, + 100, + 103, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 4, + "column": 104, + "line": 1, }, "start": Object { - "column": 2, - "line": 4, + "column": 103, + "line": 1, }, }, "range": Array [ - 47, - 59, + 103, + 104, ], - "type": "String", - "value": "\\"use strict\\"", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 4, + "column": 106, + "line": 1, }, "start": Object { - "column": 14, - "line": 4, + "column": 105, + "line": 1, }, }, "range": Array [ - 59, - 60, + 105, + 106, ], "type": "Punctuator", - "value": ";", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 107, + "line": 1, }, "start": Object { - "column": 0, - "line": 5, + "column": 106, + "line": 1, }, }, "range": Array [ - 61, - 62, + 106, + 107, ], - "type": "Punctuator", - "value": "}", + "type": "Numeric", + "value": "2", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/export-as-namespace.src 1`] = ` -Object { - "body": Array [ Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 108, + "line": 1, + }, + "start": Object { + "column": 107, + "line": 1, }, - "name": "a", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", }, + "range": Array [ + 107, + 108, + ], + "type": "Punctuator", + "value": ",", + }, + Object { "loc": Object { "end": Object { - "column": 22, + "column": 110, "line": 1, }, "start": Object { - "column": 0, + "column": 109, "line": 1, }, }, "range": Array [ - 0, - 22, + 109, + 110, ], - "type": "TSNamespaceExportDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "{", }, - }, - "range": Array [ - 0, - 23, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 114, "line": 1, }, "start": Object { - "column": 0, + "column": 111, "line": 1, }, }, "range": Array [ - 0, - 6, + 111, + 114, ], - "type": "Keyword", - "value": "export", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 115, "line": 1, }, "start": Object { - "column": 7, + "column": 114, "line": 1, }, }, "range": Array [ - 7, - 9, + 114, + 115, ], - "type": "Identifier", - "value": "as", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 117, "line": 1, }, "start": Object { - "column": 10, + "column": 116, "line": 1, }, }, "range": Array [ - 10, - 19, + 116, + 117, ], - "type": "Identifier", - "value": "namespace", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 118, "line": 1, }, "start": Object { - "column": 20, + "column": 117, "line": 1, }, }, "range": Array [ - 20, - 21, + 117, + 118, ], - "type": "Identifier", - "value": "a", + "type": "Numeric", + "value": "3", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 119, "line": 1, }, "start": Object { - "column": 21, + "column": 118, "line": 1, }, }, "range": Array [ - 21, - 22, + 118, + 119, ], "type": "Punctuator", - "value": ";", + "value": "]", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/export-assignment.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 121, + "line": 1, + }, + "start": Object { + "column": 120, + "line": 1, }, - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", }, + "range": Array [ + 120, + 121, + ], + "type": "Punctuator", + "value": "}", + }, + Object { "loc": Object { "end": Object { - "column": 13, + "column": 122, "line": 1, }, "start": Object { - "column": 0, + "column": 121, "line": 1, }, }, "range": Array [ - 0, - 13, + 121, + 122, ], - "type": "TSExportAssignment", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, + "type": "Punctuator", + "value": "]", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 124, + "line": 1, + }, + "start": Object { + "column": 123, + "line": 1, + }, + }, + "range": Array [ + 123, + 124, + ], + "type": "Punctuator", + "value": "}", }, - }, - "range": Array [ - 0, - 14, - ], - "sourceType": "module", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 126, "line": 1, }, "start": Object { - "column": 0, + "column": 125, "line": 1, }, }, "range": Array [ - 0, - 6, + 125, + 126, ], - "type": "Keyword", - "value": "export", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 127, "line": 1, }, "start": Object { - "column": 7, + "column": 126, "line": 1, }, }, "range": Array [ - 7, - 8, + 126, + 127, ], "type": "Punctuator", - "value": "=", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 128, "line": 1, }, "start": Object { - "column": 9, + "column": 127, "line": 1, }, }, "range": Array [ - 9, - 12, + 127, + 128, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 129, "line": 1, }, "start": Object { - "column": 12, + "column": 128, "line": 1, }, }, "range": Array [ - 12, - 13, + 128, + 129, ], "type": "Punctuator", "value": ";", @@ -39749,142 +41135,161 @@ Object { } `; -exports[`typescript fixtures/basics/export-declare-const-named-enum.src 1`] = ` +exports[`typescript fixtures/basics/destructuring-assignment-object.src 1`] = ` Object { "body": Array [ Object { - "declaration": Object { - "const": true, - "declare": true, - "id": Object { + "expression": Object { + "left": Object { "loc": Object { "end": Object { - "column": 29, + "column": 13, "line": 1, }, "start": Object { - "column": 26, + "column": 1, "line": 1, }, }, - "name": "Foo", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "members": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, }, + "name": "foo", + "range": Array [ + 3, + 6, + ], + "type": "Identifier", }, - "name": "foo", - "range": Array [ - 36, - 39, - ], - "type": "Identifier", - }, - "initializer": Object { + "kind": "init", "loc": Object { "end": Object { "column": 11, - "line": 2, + "line": 1, }, "start": Object { - "column": 10, - "line": 2, + "column": 3, + "line": 1, }, }, + "method": false, "range": Array [ - 42, - 43, + 3, + 11, ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 36, - 43, - ], - "type": "TSEnumMember", - }, - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 3, + 6, + ], + "type": "Identifier", }, - "start": Object { - "column": 4, - "line": 3, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, }, - }, - "name": "bar", - "range": Array [ - 49, - 52, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, + "range": Array [ + 3, + 11, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 9, + 11, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentPattern", }, }, - "range": Array [ - 49, - 52, - ], - "type": "TSEnumMember", + ], + "range": Array [ + 1, + 13, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, }, - ], + "start": Object { + "column": 1, + "line": 1, + }, + }, + "operator": "=", "range": Array [ - 7, - 54, + 1, + 19, ], - "type": "TSEnumDeclaration", + "right": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", }, "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 21, + "line": 1, }, "start": Object { "column": 0, @@ -39893,17 +41298,15 @@ Object { }, "range": Array [ 0, - 54, + 21, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { "column": 0, - "line": 5, + "line": 2, }, "start": Object { "column": 0, @@ -39912,14 +41315,14 @@ Object { }, "range": Array [ 0, - 55, + 22, ], - "sourceType": "module", + "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 1, "line": 1, }, "start": Object { @@ -39929,133 +41332,133 @@ Object { }, "range": Array [ 0, - 6, + 1, ], - "type": "Keyword", - "value": "export", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 2, "line": 1, }, "start": Object { - "column": 7, + "column": 1, "line": 1, }, }, "range": Array [ - 7, - 14, + 1, + 2, ], - "type": "Identifier", - "value": "declare", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 6, "line": 1, }, "start": Object { - "column": 15, + "column": 3, "line": 1, }, }, "range": Array [ - 15, - 20, + 3, + 6, ], - "type": "Keyword", - "value": "const", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 8, "line": 1, }, "start": Object { - "column": 21, + "column": 7, "line": 1, }, }, "range": Array [ - 21, - 25, + 7, + 8, ], - "type": "Keyword", - "value": "enum", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 10, "line": 1, }, "start": Object { - "column": 26, + "column": 9, "line": 1, }, }, "range": Array [ - 26, - 29, + 9, + 10, ], - "type": "Identifier", - "value": "Foo", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 11, "line": 1, }, "start": Object { - "column": 30, + "column": 10, "line": 1, }, }, "range": Array [ - 30, - 31, + 10, + 11, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 13, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 12, + "line": 1, }, }, "range": Array [ - 36, - 39, + 12, + 13, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 15, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 14, + "line": 1, }, }, "range": Array [ - 40, - 41, + 14, + 15, ], "type": "Punctuator", "value": "=", @@ -40063,234 +41466,274 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 19, + "line": 1, }, "start": Object { - "column": 10, - "line": 2, + "column": 16, + "line": 1, }, }, "range": Array [ - 42, - 43, + 16, + 19, ], - "type": "Numeric", - "value": "1", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 2, + "column": 20, + "line": 1, }, "start": Object { - "column": 11, - "line": 2, + "column": 19, + "line": 1, }, }, "range": Array [ - 43, - 44, + 19, + 20, ], "type": "Punctuator", - "value": ",", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 21, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 20, + "line": 1, }, }, "range": Array [ - 49, - 52, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 4, - }, - }, - "range": Array [ - 53, - 54, + 20, + 21, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/export-declare-named-enum.src 1`] = ` +exports[`typescript fixtures/basics/destructuring-assignment-property.src 1`] = ` Object { "body": Array [ Object { - "declaration": Object { - "declare": true, - "id": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 1, }, - "name": "Foo", - "range": Array [ - 20, - 23, - ], - "type": "Identifier", }, + "range": Array [ + 33, + 37, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 12, + "line": 1, }, "start": Object { - "column": 7, + "column": 9, "line": 1, }, }, - "members": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 30, - 33, - ], - "type": "Identifier", - }, - "initializer": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 36, - 37, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, + "name": "Foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "left": Object { "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 25, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 13, + "line": 1, }, }, - "range": Array [ - 30, - 37, - ], - "type": "TSEnumMember", - }, - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", }, - "start": Object { - "column": 4, - "line": 3, + "kind": "init", + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 15, + 23, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 23, + ], + "right": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 23, + ], + "type": "ArrayExpression", + }, + "type": "AssignmentPattern", }, }, - "name": "bar", - "range": Array [ - 43, - 46, - ], - "type": "Identifier", + ], + "range": Array [ + 13, + 25, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, }, + }, + "range": Array [ + 13, + 31, + ], + "right": Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 31, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 28, + "line": 1, }, }, + "name": "bar", "range": Array [ - 43, - 46, + 28, + 31, ], - "type": "TSEnumMember", + "type": "Identifier", }, - ], - "range": Array [ - 7, - 48, - ], - "type": "TSEnumDeclaration", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "AssignmentPattern", }, - }, + ], "range": Array [ 0, - 48, + 37, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 5, + "line": 4, }, "start": Object { "column": 0, @@ -40299,14 +41742,14 @@ Object { }, "range": Array [ 0, - 49, + 38, ], - "sourceType": "module", + "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 8, "line": 1, }, "start": Object { @@ -40316,79 +41759,61 @@ Object { }, "range": Array [ 0, - 6, + 8, ], "type": "Keyword", - "value": "export", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 12, "line": 1, }, "start": Object { - "column": 7, + "column": 9, "line": 1, }, }, "range": Array [ - 7, - 14, + 9, + 12, ], "type": "Identifier", - "value": "declare", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 19, - ], - "type": "Keyword", - "value": "enum", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 13, "line": 1, }, "start": Object { - "column": 20, + "column": 12, "line": 1, }, }, "range": Array [ - 20, - 23, + 12, + 13, ], - "type": "Identifier", - "value": "Foo", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 14, "line": 1, }, "start": Object { - "column": 24, + "column": 13, "line": 1, }, }, "range": Array [ - 24, - 25, + 13, + 14, ], "type": "Punctuator", "value": "{", @@ -40396,17 +41821,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 18, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 15, + "line": 1, }, }, "range": Array [ - 30, - 33, + 15, + 18, ], "type": "Identifier", "value": "foo", @@ -40414,17 +41839,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 20, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 19, + "line": 1, }, }, "range": Array [ - 34, - 35, + 19, + 20, ], "type": "Punctuator", "value": "=", @@ -40432,330 +41857,125 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 36, - 37, - ], - "type": "Numeric", - "value": "1", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "range": Array [ - 37, - 38, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 43, - 46, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 4, - }, - }, - "range": Array [ - 47, - 48, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/export-default-class-with-generic.src 1`] = ` -Object { - "body": Array [ - Object { - "declaration": Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 28, - ], - "type": "ClassBody", - }, - "id": null, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 28, - ], - "superClass": null, - "type": "ClassDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - "range": Array [ - 21, - 22, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 20, - 23, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 28, - ], - "type": "ExportDefaultDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 29, - ], - "sourceType": "module", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 6, + "column": 22, "line": 1, }, "start": Object { - "column": 0, + "column": 21, "line": 1, }, }, "range": Array [ - 0, - 6, + 21, + 22, ], - "type": "Keyword", - "value": "export", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 23, "line": 1, }, "start": Object { - "column": 7, + "column": 22, "line": 1, }, }, "range": Array [ - 7, - 14, + 22, + 23, ], - "type": "Keyword", - "value": "default", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 25, "line": 1, }, "start": Object { - "column": 15, + "column": 24, "line": 1, }, }, "range": Array [ - 15, - 20, + 24, + 25, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 27, "line": 1, }, "start": Object { - "column": 20, + "column": 26, "line": 1, }, }, "range": Array [ - 20, - 21, + 26, + 27, ], "type": "Punctuator", - "value": "<", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 31, "line": 1, }, "start": Object { - "column": 21, + "column": 28, "line": 1, }, }, "range": Array [ - 21, - 22, + 28, + 31, ], "type": "Identifier", - "value": "T", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 32, "line": 1, }, "start": Object { - "column": 22, + "column": 31, "line": 1, }, }, "range": Array [ - 22, - 23, + 31, + 32, ], "type": "Punctuator", - "value": ">", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 34, "line": 1, }, "start": Object { - "column": 24, + "column": 33, "line": 1, }, }, "range": Array [ - 24, - 25, + 33, + 34, ], "type": "Punctuator", "value": "{", @@ -40772,8 +41992,8 @@ Object { }, }, "range": Array [ - 27, - 28, + 36, + 37, ], "type": "Punctuator", "value": "}", @@ -40783,140 +42003,198 @@ Object { } `; -exports[`typescript fixtures/basics/export-default-class-with-multiple-generics.src 1`] = ` +exports[`typescript fixtures/basics/directive-in-module.src 1`] = ` Object { "body": Array [ Object { - "declaration": Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "range": Array [ - 27, - 31, - ], - "type": "ClassBody", - }, - "id": null, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 31, - ], - "superClass": null, - "type": "ClassDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "params": Array [ - Object { + "body": Object { + "body": Array [ + Object { + "directive": "use strict", + "expression": Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, + "column": 2, + "line": 2, }, }, - "name": Object { + "range": Array [ + 15, + 27, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 15, + 28, + ], + "type": "ExpressionStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "name": "a", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 39, + 40, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 11, + "line": 3, }, "start": Object { - "column": 21, - "line": 1, + "column": 6, + "line": 3, }, }, - "name": "T", "range": Array [ - 21, - 22, + 35, + 40, ], - "type": "Identifier", + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, }, - "range": Array [ - 21, - 22, - ], - "type": "TSTypeParameter", }, - Object { + "range": Array [ + 31, + 41, + ], + "type": "VariableDeclaration", + }, + Object { + "expression": Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 14, + "line": 4, }, "start": Object { - "column": 24, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, + "column": 2, + "line": 4, }, - "name": "U", - "range": Array [ - 24, - 25, - ], - "type": "Identifier", }, "range": Array [ - 24, - 25, + 44, + 56, ], - "type": "TSTypeParameter", + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", }, - ], - "range": Array [ - 20, - 26, - ], - "type": "TSTypeParameterDeclaration", + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 44, + 57, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 59, + ], + "type": "TSModuleBlock", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, }, + "name": "foo", + "range": Array [ + 7, + 10, + ], + "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { "column": 0, @@ -40925,15 +42203,15 @@ Object { }, "range": Array [ 0, - 31, + 59, ], - "type": "ExportDefaultDeclaration", + "type": "TSModuleDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 6, }, "start": Object { "column": 0, @@ -40942,9 +42220,9 @@ Object { }, "range": Array [ 0, - 32, + 60, ], - "sourceType": "module", + "sourceType": "script", "tokens": Array [ Object { "loc": Object { @@ -40961,13 +42239,13 @@ Object { 0, 6, ], - "type": "Keyword", - "value": "export", + "type": "Identifier", + "value": "module", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 10, "line": 1, }, "start": Object { @@ -40977,151 +42255,205 @@ Object { }, "range": Array [ 7, - 14, + 10, ], - "type": "Keyword", - "value": "default", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 12, "line": 1, }, "start": Object { - "column": 15, + "column": 11, "line": 1, }, }, "range": Array [ - 15, - 20, + 11, + 12, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { - "column": 20, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 20, - 21, + 15, + 27, ], - "type": "Punctuator", - "value": "<", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, + "column": 14, + "line": 2, }, }, "range": Array [ - 21, - 22, + 27, + 28, ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 22, - "line": 1, + "column": 2, + "line": 3, }, }, "range": Array [ - 22, - 23, + 31, + 34, ], - "type": "Punctuator", - "value": ",", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 7, + "line": 3, }, "start": Object { - "column": 24, - "line": 1, + "column": 6, + "line": 3, }, }, "range": Array [ - 24, - 25, - ], + 35, + 36, + ], "type": "Identifier", - "value": "U", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 9, + "line": 3, }, "start": Object { - "column": 25, - "line": 1, + "column": 8, + "line": 3, }, }, "range": Array [ - 25, - 26, + 37, + 38, ], "type": "Punctuator", - "value": ">", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 11, + "line": 3, }, "start": Object { - "column": 27, - "line": 1, + "column": 10, + "line": 3, }, }, "range": Array [ - 27, - 28, + 39, + 40, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 40, + 41, ], "type": "Punctuator", - "value": "{", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 44, + 56, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { "column": 0, - "line": 3, + "line": 5, }, }, "range": Array [ - 30, - 31, + 58, + 59, ], "type": "Punctuator", "value": "}", @@ -41131,122 +42463,198 @@ Object { } `; -exports[`typescript fixtures/basics/export-named-class-with-generic.src 1`] = ` +exports[`typescript fixtures/basics/directive-in-namespace.src 1`] = ` Object { "body": Array [ Object { - "declaration": Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 24, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 24, - ], - "superClass": null, - "type": "ClassDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "params": Array [ - Object { + "body": Object { + "body": Array [ + Object { + "directive": "use strict", + "expression": Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { - "column": 17, - "line": 1, + "column": 2, + "line": 2, }, }, - "name": Object { + "range": Array [ + 18, + 30, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 18, + 31, + ], + "type": "ExpressionStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "name": "a", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 42, + 43, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 11, + "line": 3, }, "start": Object { - "column": 17, - "line": 1, + "column": 6, + "line": 3, }, }, - "name": "T", "range": Array [ - 17, - 18, + 38, + 43, ], - "type": "Identifier", + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 34, + 44, + ], + "type": "VariableDeclaration", + }, + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, }, "range": Array [ - 17, - 18, + 47, + 59, ], - "type": "TSTypeParameter", + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", }, - ], - "range": Array [ - 16, - 19, - ], - "type": "TSTypeParameterDeclaration", + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 47, + 60, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 62, + ], + "type": "TSModuleBlock", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, }, + "name": "foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { "column": 0, @@ -41255,17 +42663,15 @@ Object { }, "range": Array [ 0, - 24, + 62, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", + "type": "TSModuleDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 6, }, "start": Object { "column": 0, @@ -41274,14 +42680,14 @@ Object { }, "range": Array [ 0, - 25, + 63, ], - "sourceType": "module", + "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 9, "line": 1, }, "start": Object { @@ -41291,133 +42697,223 @@ Object { }, "range": Array [ 0, - 6, + 9, ], - "type": "Keyword", - "value": "export", + "type": "Identifier", + "value": "namespace", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 13, "line": 1, }, "start": Object { - "column": 7, + "column": 10, "line": 1, }, }, "range": Array [ - 7, - 12, + 10, + 13, ], - "type": "Keyword", - "value": "class", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 15, "line": 1, }, "start": Object { - "column": 13, + "column": 14, "line": 1, }, }, "range": Array [ - 13, - 16, + 14, + 15, ], - "type": "Identifier", - "value": "Foo", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { - "column": 16, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 16, - 17, + 18, + 30, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, ], "type": "Punctuator", - "value": "<", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 17, - "line": 1, + "column": 2, + "line": 3, }, }, "range": Array [ - 17, - 18, + 34, + 37, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 38, + 39, ], "type": "Identifier", - "value": "T", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 9, + "line": 3, }, "start": Object { - "column": 18, - "line": 1, + "column": 8, + "line": 3, }, }, "range": Array [ - 18, - 19, + 40, + 41, ], "type": "Punctuator", - "value": ">", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 11, + "line": 3, }, "start": Object { - "column": 20, - "line": 1, + "column": 10, + "line": 3, }, }, "range": Array [ - 20, - 21, + 42, + 43, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 43, + 44, ], "type": "Punctuator", - "value": "{", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 47, + 59, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { "column": 0, - "line": 3, + "line": 5, }, }, "range": Array [ - 23, - 24, + 61, + 62, ], "type": "Punctuator", "value": "}", @@ -41427,157 +42923,32 @@ Object { } `; -exports[`typescript fixtures/basics/export-named-class-with-multiple-generics.src 1`] = ` +exports[`typescript fixtures/basics/export-as-namespace.src 1`] = ` Object { "body": Array [ Object { - "declaration": Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 27, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, + "id": Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 21, + "line": 1, }, "start": Object { - "column": 7, + "column": 20, "line": 1, }, }, + "name": "a", "range": Array [ - 7, - 27, + 20, + 21, ], - "superClass": null, - "type": "ClassDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - "range": Array [ - 17, - 18, - ], - "type": "TSTypeParameter", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "name": "U", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "range": Array [ - 20, - 21, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 16, - 22, - ], - "type": "TSTypeParameterDeclaration", - }, + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 22, + "line": 1, }, "start": Object { "column": 0, @@ -41586,17 +42957,15 @@ Object { }, "range": Array [ 0, - 27, + 22, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", + "type": "TSNamespaceExportDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 2, }, "start": Object { "column": 0, @@ -41605,9 +42974,9 @@ Object { }, "range": Array [ 0, - 28, + 23, ], - "sourceType": "module", + "sourceType": "script", "tokens": Array [ Object { "loc": Object { @@ -41630,7 +42999,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 9, "line": 1, }, "start": Object { @@ -41640,180 +43009,224 @@ Object { }, "range": Array [ 7, - 12, + 9, ], - "type": "Keyword", - "value": "class", + "type": "Identifier", + "value": "as", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 19, "line": 1, }, "start": Object { - "column": 13, + "column": 10, "line": 1, }, }, "range": Array [ - 13, - 16, + 10, + 19, ], "type": "Identifier", - "value": "Foo", + "value": "namespace", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 21, "line": 1, }, "start": Object { - "column": 16, + "column": 20, "line": 1, }, }, "range": Array [ - 16, - 17, + 20, + 21, ], - "type": "Punctuator", - "value": "<", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 22, "line": 1, }, "start": Object { - "column": 17, + "column": 21, "line": 1, }, }, "range": Array [ - 17, - 18, + 21, + 22, ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/export-assignment.src 1`] = ` +Object { + "body": Array [ Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 19, + "column": 13, "line": 1, }, "start": Object { - "column": 18, + "column": 0, "line": 1, }, }, "range": Array [ - 18, - 19, + 0, + 13, ], - "type": "Punctuator", - "value": ",", + "type": "TSExportAssignment", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 14, + ], + "sourceType": "module", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 21, + "column": 6, "line": 1, }, "start": Object { - "column": 20, + "column": 0, "line": 1, }, }, "range": Array [ - 20, - 21, + 0, + 6, ], - "type": "Identifier", - "value": "U", + "type": "Keyword", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 8, "line": 1, }, "start": Object { - "column": 21, + "column": 7, "line": 1, }, }, "range": Array [ - 21, - 22, + 7, + 8, ], "type": "Punctuator", - "value": ">", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 12, "line": 1, }, "start": Object { - "column": 23, + "column": 9, "line": 1, }, }, "range": Array [ - 23, - 24, + 9, + 12, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 13, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 12, + "line": 1, }, }, "range": Array [ - 26, - 27, + 12, + 13, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/export-named-enum.src 1`] = ` +exports[`typescript fixtures/basics/export-declare-const-named-enum.src 1`] = ` Object { "body": Array [ Object { "declaration": Object { + "const": true, + "declare": true, "id": Object { "loc": Object { "end": Object { - "column": 15, + "column": 29, "line": 1, }, "start": Object { - "column": 12, + "column": 26, "line": 1, }, }, "name": "Foo", "range": Array [ - 12, - 15, + 26, + 29, ], "type": "Identifier", }, @@ -41842,8 +43255,8 @@ Object { }, "name": "foo", "range": Array [ - 22, - 25, + 36, + 39, ], "type": "Identifier", }, @@ -41859,8 +43272,8 @@ Object { }, }, "range": Array [ - 28, - 29, + 42, + 43, ], "raw": "1", "type": "Literal", @@ -41877,8 +43290,8 @@ Object { }, }, "range": Array [ - 22, - 29, + 36, + 43, ], "type": "TSEnumMember", }, @@ -41896,8 +43309,8 @@ Object { }, "name": "bar", "range": Array [ - 35, - 38, + 49, + 52, ], "type": "Identifier", }, @@ -41912,15 +43325,15 @@ Object { }, }, "range": Array [ - 35, - 38, + 49, + 52, ], "type": "TSEnumMember", }, ], "range": Array [ 7, - 40, + 54, ], "type": "TSEnumDeclaration", }, @@ -41936,7 +43349,7 @@ Object { }, "range": Array [ 0, - 40, + 54, ], "source": null, "specifiers": Array [], @@ -41945,8 +43358,8 @@ Object { ], "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 0, + "line": 5, }, "start": Object { "column": 0, @@ -41955,7 +43368,7 @@ Object { }, "range": Array [ 0, - 40, + 55, ], "sourceType": "module", "tokens": Array [ @@ -41980,7 +43393,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 14, "line": 1, }, "start": Object { @@ -41990,7 +43403,43 @@ Object { }, "range": Array [ 7, - 11, + 14, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 20, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 25, ], "type": "Keyword", "value": "enum", @@ -41998,17 +43447,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 29, "line": 1, }, "start": Object { - "column": 12, + "column": 26, "line": 1, }, }, "range": Array [ - 12, - 15, + 26, + 29, ], "type": "Identifier", "value": "Foo", @@ -42016,17 +43465,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 31, "line": 1, }, "start": Object { - "column": 16, + "column": 30, "line": 1, }, }, "range": Array [ - 16, - 17, + 30, + 31, ], "type": "Punctuator", "value": "{", @@ -42043,8 +43492,8 @@ Object { }, }, "range": Array [ - 22, - 25, + 36, + 39, ], "type": "Identifier", "value": "foo", @@ -42061,8 +43510,8 @@ Object { }, }, "range": Array [ - 26, - 27, + 40, + 41, ], "type": "Punctuator", "value": "=", @@ -42079,8 +43528,8 @@ Object { }, }, "range": Array [ - 28, - 29, + 42, + 43, ], "type": "Numeric", "value": "1", @@ -42097,8 +43546,8 @@ Object { }, }, "range": Array [ - 29, - 30, + 43, + 44, ], "type": "Punctuator", "value": ",", @@ -42115,8 +43564,8 @@ Object { }, }, "range": Array [ - 35, - 38, + 49, + 52, ], "type": "Identifier", "value": "bar", @@ -42133,8 +43582,8 @@ Object { }, }, "range": Array [ - 39, - 40, + 53, + 54, ], "type": "Punctuator", "value": "}", @@ -42144,102 +43593,141 @@ Object { } `; -exports[`typescript fixtures/basics/export-type-alias-declaration.src 1`] = ` +exports[`typescript fixtures/basics/export-declare-named-enum.src 1`] = ` Object { "body": Array [ Object { "declaration": Object { + "declare": true, "id": Object { "loc": Object { "end": Object { - "column": 21, + "column": 23, "line": 1, }, "start": Object { - "column": 12, + "column": 20, "line": 1, }, }, - "name": "TestAlias", + "name": "Foo", "range": Array [ - 12, - 21, + 20, + 23, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 40, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { "column": 7, "line": 1, }, }, - "range": Array [ - 7, - 40, - ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 39, - ], - "type": "TSUnionType", - "types": Array [ - Object { + "members": Array [ + Object { + "id": Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 24, - "line": 1, - }, + "column": 4, + "line": 2, + }, }, + "name": "foo", "range": Array [ - 24, 30, + 33, ], - "type": "TSStringKeyword", + "type": "Identifier", }, - Object { + "initializer": Object { "loc": Object { "end": Object { - "column": 39, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 33, - "line": 1, + "column": 10, + "line": 2, }, }, "range": Array [ - 33, - 39, + 36, + 37, ], - "type": "TSNumberKeyword", + "raw": "1", + "type": "Literal", + "value": 1, }, - ], - }, + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 30, + 37, + ], + "type": "TSEnumMember", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 43, + 46, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 43, + 46, + ], + "type": "TSEnumMember", + }, + ], + "range": Array [ + 7, + 48, + ], + "type": "TSEnumDeclaration", }, "loc": Object { "end": Object { - "column": 40, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { "column": 0, @@ -42248,7 +43736,7 @@ Object { }, "range": Array [ 0, - 40, + 48, ], "source": null, "specifiers": Array [], @@ -42257,8 +43745,8 @@ Object { ], "loc": Object { "end": Object { - "column": 40, - "line": 1, + "column": 0, + "line": 5, }, "start": Object { "column": 0, @@ -42267,7 +43755,7 @@ Object { }, "range": Array [ 0, - 40, + 49, ], "sourceType": "module", "tokens": Array [ @@ -42292,7 +43780,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 14, "line": 1, }, "start": Object { @@ -42302,28 +43790,28 @@ Object { }, "range": Array [ 7, - 11, + 14, ], "type": "Identifier", - "value": "type", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 19, "line": 1, }, "start": Object { - "column": 12, + "column": 15, "line": 1, }, }, "range": Array [ - 12, - 21, + 15, + 19, ], - "type": "Identifier", - "value": "TestAlias", + "type": "Keyword", + "value": "enum", }, Object { "loc": Object { @@ -42332,21 +43820,21 @@ Object { "line": 1, }, "start": Object { - "column": 22, + "column": 20, "line": 1, }, }, "range": Array [ - 22, + 20, 23, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 25, "line": 1, }, "start": Object { @@ -42356,201 +43844,222 @@ Object { }, "range": Array [ 24, + 25, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ 30, + 33, ], "type": "Identifier", - "value": "string", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { - "column": 31, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ - 31, - 32, + 34, + 35, ], "type": "Punctuator", - "value": "|", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 39, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 33, - "line": 1, + "column": 10, + "line": 2, }, }, "range": Array [ - 33, - 39, + 36, + 37, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 43, + 46, ], "type": "Identifier", - "value": "number", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 40, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { - "column": 39, - "line": 1, + "column": 0, + "line": 4, }, }, "range": Array [ - 39, - 40, + 47, + 48, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/export-type-class-declaration.src 1`] = ` +exports[`typescript fixtures/basics/export-default-class-with-generic.src 1`] = ` Object { "body": Array [ Object { "declaration": Object { - "id": Object { + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 12, + "column": 24, "line": 1, }, }, - "name": "TestClassProps", "range": Array [ - 12, - 26, + 24, + 28, ], - "type": "Identifier", + "type": "ClassBody", }, + "id": null, "loc": Object { "end": Object { - "column": 2, + "column": 1, "line": 3, }, "start": Object { - "column": 7, + "column": 15, "line": 1, }, }, "range": Array [ - 7, - 51, + 15, + 28, ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { + "superClass": null, + "type": "ClassDeclaration", + "typeParameters": Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 23, + "line": 1, }, "start": Object { - "column": 29, + "column": 20, "line": 1, }, }, - "members": Array [ + "params": Array [ Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "count", - "range": Array [ - 35, - 40, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 22, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 21, + "line": 1, }, }, - "range": Array [ - 35, - 48, - ], - "type": "TSPropertySignature", - "typeAnnotation": Object { + "name": Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 22, + "line": 1, }, "start": Object { - "column": 9, - "line": 2, + "column": 21, + "line": 1, }, }, + "name": "T", "range": Array [ - 40, - 48, + 21, + 22, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "range": Array [ - 42, - 48, - ], - "type": "TSNumberKeyword", - }, + "type": "Identifier", }, + "range": Array [ + 21, + 22, + ], + "type": "TSTypeParameter", }, ], "range": Array [ - 29, - 50, + 20, + 23, ], - "type": "TSTypeLiteral", + "type": "TSTypeParameterDeclaration", }, }, "loc": Object { "end": Object { - "column": 2, + "column": 1, "line": 3, }, "start": Object { @@ -42560,17 +44069,15 @@ Object { }, "range": Array [ 0, - 51, + 28, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", + "type": "ExportDefaultDeclaration", }, ], "loc": Object { "end": Object { - "column": 2, - "line": 3, + "column": 0, + "line": 4, }, "start": Object { "column": 0, @@ -42579,7 +44086,7 @@ Object { }, "range": Array [ 0, - 51, + 29, ], "sourceType": "module", "tokens": Array [ @@ -42604,7 +44111,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 14, "line": 1, }, "start": Object { @@ -42614,118 +44121,100 @@ Object { }, "range": Array [ 7, - 11, + 14, ], - "type": "Identifier", - "value": "type", + "type": "Keyword", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 20, "line": 1, }, "start": Object { - "column": 12, + "column": 15, "line": 1, }, }, "range": Array [ - 12, - 26, + 15, + 20, ], - "type": "Identifier", - "value": "TestClassProps", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 21, "line": 1, }, "start": Object { - "column": 27, + "column": 20, "line": 1, }, }, "range": Array [ - 27, - 28, + 20, + 21, ], "type": "Punctuator", - "value": "=", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 22, "line": 1, }, "start": Object { - "column": 29, + "column": 21, "line": 1, }, }, "range": Array [ - 29, - 30, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 35, - 40, + 21, + 22, ], "type": "Identifier", - "value": "count", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 9, - "line": 2, + "column": 22, + "line": 1, }, }, "range": Array [ - 40, - 41, + 22, + 23, ], "type": "Punctuator", - "value": ":", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 25, + "line": 1, }, "start": Object { - "column": 11, - "line": 2, + "column": 24, + "line": 1, }, }, "range": Array [ - 42, - 48, + 24, + 25, ], - "type": "Identifier", - "value": "number", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { @@ -42739,81 +44228,65 @@ Object { }, }, "range": Array [ - 49, - 50, + 27, + 28, ], "type": "Punctuator", "value": "}", }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 3, - }, - "start": Object { - "column": 1, - "line": 3, - }, - }, - "range": Array [ - 50, - 51, - ], - "type": "Punctuator", - "value": ";", - }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/export-type-function-declaration.src 1`] = ` +exports[`typescript fixtures/basics/export-default-class-with-multiple-generics.src 1`] = ` Object { "body": Array [ Object { "declaration": Object { - "id": Object { + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 12, + "column": 27, "line": 1, }, }, - "name": "TestCallback", "range": Array [ - 12, - 24, + 27, + 31, ], - "type": "Identifier", + "type": "ClassBody", }, + "id": null, "loc": Object { "end": Object { - "column": 47, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 7, + "column": 15, "line": 1, }, }, "range": Array [ - 7, - 47, + 15, + 31, ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { + "superClass": null, + "type": "ClassDeclaration", + "typeParameters": Object { "loc": Object { "end": Object { - "column": 46, + "column": 26, "line": 1, }, "start": Object { - "column": 27, + "column": 20, "line": 1, }, }, @@ -42821,101 +44294,85 @@ Object { Object { "loc": Object { "end": Object { - "column": 37, + "column": 22, "line": 1, }, "start": Object { - "column": 28, + "column": 21, "line": 1, }, }, - "name": "a", - "range": Array [ - 28, - 37, - ], - "type": "Identifier", - "typeAnnotation": Object { + "name": Object { "loc": Object { "end": Object { - "column": 37, + "column": 22, "line": 1, }, "start": Object { - "column": 29, + "column": 21, "line": 1, }, }, + "name": "T", "range": Array [ - 29, - 37, + 21, + 22, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, - "range": Array [ - 31, - 37, - ], - "type": "TSNumberKeyword", - }, - }, - }, - ], - "range": Array [ - 27, - 46, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 46, - "line": 1, - }, - "start": Object { - "column": 39, - "line": 1, + "type": "Identifier", }, + "range": Array [ + 21, + 22, + ], + "type": "TSTypeParameter", }, - "range": Array [ - 39, - 46, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + Object { "loc": Object { "end": Object { - "column": 46, + "column": 25, "line": 1, }, "start": Object { - "column": 42, + "column": 24, "line": 1, }, }, + "name": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "name": "U", + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + }, "range": Array [ - 42, - 46, + 24, + 25, ], - "type": "TSVoidKeyword", + "type": "TSTypeParameter", }, - }, - "type": "TSFunctionType", + ], + "range": Array [ + 20, + 26, + ], + "type": "TSTypeParameterDeclaration", }, }, "loc": Object { "end": Object { - "column": 47, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { "column": 0, @@ -42924,17 +44381,15 @@ Object { }, "range": Array [ 0, - 47, + 31, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", + "type": "ExportDefaultDeclaration", }, ], "loc": Object { "end": Object { - "column": 47, - "line": 1, + "column": 0, + "line": 4, }, "start": Object { "column": 0, @@ -42943,7 +44398,7 @@ Object { }, "range": Array [ 0, - 47, + 32, ], "sourceType": "module", "tokens": Array [ @@ -42968,7 +44423,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 14, "line": 1, }, "start": Object { @@ -42978,28 +44433,100 @@ Object { }, "range": Array [ 7, - 11, + 14, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 20, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, ], "type": "Identifier", - "value": "type", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 23, "line": 1, }, "start": Object { - "column": 12, + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, "line": 1, }, }, "range": Array [ - 12, 24, + 25, ], "type": "Identifier", - "value": "TestCallback", + "value": "U", }, Object { "loc": Object { @@ -43017,7 +44544,7 @@ Object { 26, ], "type": "Punctuator", - "value": "=", + "value": ">", }, Object { "loc": Object { @@ -43035,367 +44562,477 @@ Object { 28, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/export-named-class-with-generic.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 24, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 24, + ], + "superClass": null, + "type": "ClassDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "range": Array [ + 17, + 18, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 16, + 19, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, "line": 1, }, "start": Object { - "column": 28, + "column": 0, "line": 1, }, }, "range": Array [ - 28, - 29, + 0, + 6, ], - "type": "Identifier", - "value": "a", + "type": "Keyword", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 12, "line": 1, }, "start": Object { - "column": 29, + "column": 7, "line": 1, }, }, "range": Array [ - 29, - 30, + 7, + 12, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 37, + "column": 16, "line": 1, }, "start": Object { - "column": 31, + "column": 13, "line": 1, }, }, "range": Array [ - 31, - 37, + 13, + 16, ], "type": "Identifier", - "value": "number", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 38, + "column": 17, "line": 1, }, "start": Object { - "column": 37, + "column": 16, "line": 1, }, }, "range": Array [ - 37, - 38, + 16, + 17, ], "type": "Punctuator", - "value": ")", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 41, + "column": 18, "line": 1, }, "start": Object { - "column": 39, + "column": 17, "line": 1, }, }, "range": Array [ - 39, - 41, + 17, + 18, ], - "type": "Punctuator", - "value": "=>", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 46, + "column": 19, "line": 1, }, "start": Object { - "column": 42, + "column": 18, "line": 1, }, }, "range": Array [ - 42, - 46, + 18, + 19, ], - "type": "Keyword", - "value": "void", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 47, + "column": 21, "line": 1, }, "start": Object { - "column": 46, + "column": 20, "line": 1, }, }, "range": Array [ - 46, - 47, + 20, + 21, ], "type": "Punctuator", - "value": ";", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/function-anonymus-with-type-parameters.src 1`] = ` +exports[`typescript fixtures/basics/export-named-class-with-multiple-generics.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 23, + "line": 1, }, - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", }, - "init": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "name": "a", - "range": Array [ - 45, - 46, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 38, - 47, - ], - "type": "ReturnStatement", - }, - ], + "range": Array [ + 23, + 27, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 27, + ], + "superClass": null, + "type": "ClassDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 18, + "line": 1, }, "start": Object { - "column": 34, + "column": 17, "line": 1, }, }, - "range": Array [ - 34, - 49, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "params": Array [ - Object { + "name": Object { "loc": Object { "end": Object { - "column": 32, + "column": 18, "line": 1, }, "start": Object { - "column": 23, + "column": 17, "line": 1, }, }, - "name": "a", + "name": "T", "range": Array [ - 23, - 32, + 17, + 18, ], "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 32, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 32, - ], - "type": "TSStringKeyword", - }, - }, }, - ], - "range": Array [ - 10, - 49, - ], - "type": "FunctionExpression", - "typeParameters": Object { + "range": Array [ + 17, + 18, + ], + "type": "TSTypeParameter", + }, + Object { "loc": Object { "end": Object { - "column": 22, + "column": 21, "line": 1, }, "start": Object { - "column": 19, + "column": 20, "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, + "name": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, }, - "name": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", + "start": Object { + "column": 20, + "line": 1, }, - "range": Array [ - 20, - 21, - ], - "type": "TSTypeParameter", }, - ], + "name": "U", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, "range": Array [ - 19, - 22, + 20, + 21, ], - "type": "TSTypeParameterDeclaration", - }, - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 1, + "type": "TSTypeParameter", }, - }, + ], "range": Array [ - 4, - 49, + 16, + 22, ], - "type": "VariableDeclarator", + "type": "TSTypeParameterDeclaration", }, - ], - "kind": "var", + }, "loc": Object { "end": Object { - "column": 2, + "column": 1, "line": 3, }, "start": Object { @@ -43405,9 +45042,11 @@ Object { }, "range": Array [ 0, - 50, + 27, ], - "type": "VariableDeclaration", + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", }, ], "loc": Object { @@ -43422,14 +45061,14 @@ Object { }, "range": Array [ 0, - 51, + 28, ], - "sourceType": "script", + "sourceType": "module", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 6, "line": 1, }, "start": Object { @@ -43439,46 +45078,64 @@ Object { }, "range": Array [ 0, - 3, + 6, ], "type": "Keyword", - "value": "var", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 12, "line": 1, }, "start": Object { - "column": 4, + "column": 7, "line": 1, }, }, "range": Array [ - 4, 7, + 12, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 16, ], "type": "Identifier", - "value": "obj", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 17, "line": 1, }, "start": Object { - "column": 8, + "column": 16, "line": 1, }, }, "range": Array [ - 8, - 9, + 16, + 17, ], "type": "Punctuator", - "value": "=", + "value": "<", }, Object { "loc": Object { @@ -43487,34 +45144,34 @@ Object { "line": 1, }, "start": Object { - "column": 10, + "column": 17, "line": 1, }, }, "range": Array [ - 10, + 17, 18, ], - "type": "Keyword", - "value": "function", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 19, "line": 1, }, "start": Object { - "column": 19, + "column": 18, "line": 1, }, }, "range": Array [ + 18, 19, - 20, ], "type": "Punctuator", - "value": "<", + "value": ",", }, Object { "loc": Object { @@ -43532,7 +45189,7 @@ Object { 21, ], "type": "Identifier", - "value": "T", + "value": "U", }, Object { "loc": Object { @@ -43555,107 +45212,277 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, + "column": 24, "line": 1, }, "start": Object { - "column": 22, + "column": 23, "line": 1, }, }, "range": Array [ - 22, 23, + 24, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 23, + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/export-named-enum.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "members": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "initializer": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 22, + 29, + ], + "type": "TSEnumMember", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 35, + 38, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 35, + 38, + ], + "type": "TSEnumMember", + }, + ], + "range": Array [ + 7, + 40, + ], + "type": "TSEnumDeclaration", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, "line": 1, }, }, "range": Array [ - 23, - 24, + 0, + 40, ], - "type": "Identifier", - "value": "a", + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 40, + ], + "sourceType": "module", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 25, + "column": 6, "line": 1, }, "start": Object { - "column": 24, + "column": 0, "line": 1, }, }, "range": Array [ - 24, - 25, + 0, + 6, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 11, "line": 1, }, "start": Object { - "column": 26, + "column": 7, "line": 1, }, }, "range": Array [ - 26, - 32, + 7, + 11, ], - "type": "Identifier", - "value": "string", + "type": "Keyword", + "value": "enum", }, Object { "loc": Object { "end": Object { - "column": 33, + "column": 15, "line": 1, }, "start": Object { - "column": 32, + "column": 12, "line": 1, }, }, "range": Array [ - 32, - 33, + 12, + 15, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 35, + "column": 17, "line": 1, }, "start": Object { - "column": 34, + "column": 16, "line": 1, }, }, "range": Array [ - 34, - 35, + 16, + 17, ], "type": "Punctuator", "value": "{", @@ -43663,38 +45490,38 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 7, "line": 2, }, "start": Object { - "column": 2, + "column": 4, "line": 2, }, }, "range": Array [ - 38, - 44, + 22, + 25, ], - "type": "Keyword", - "value": "return", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 9, "line": 2, }, "start": Object { - "column": 9, + "column": 8, "line": 2, }, }, "range": Array [ - 45, - 46, + 26, + 27, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { @@ -43708,173 +45535,167 @@ Object { }, }, "range": Array [ - 46, - 47, + 28, + 29, ], - "type": "Punctuator", - "value": ";", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 12, + "line": 2, }, "start": Object { - "column": 0, - "line": 3, + "column": 11, + "line": 2, }, }, "range": Array [ - 48, - 49, + 29, + 30, ], "type": "Punctuator", - "value": "}", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 7, "line": 3, }, "start": Object { - "column": 1, + "column": 4, "line": 3, }, }, "range": Array [ - 49, - 50, + 35, + 38, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 39, + 40, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/function-anynomus-with-return-type.src 1`] = ` +exports[`typescript fixtures/basics/export-type-alias-declaration.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + "declaration": Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, }, - "name": "obj", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", }, - "init": Object { - "async": false, - "body": Object { - "body": Array [], + "name": "TestAlias", + "range": Array [ + 12, + 21, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 40, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 39, + ], + "type": "TSUnionType", + "types": Array [ + Object { "loc": Object { "end": Object { - "column": 1, - "line": 2, + "column": 30, + "line": 1, }, "start": Object { - "column": 28, + "column": 24, "line": 1, }, }, "range": Array [ - 28, - 31, + 24, + 30, ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 1, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 1, - }, + "type": "TSStringKeyword", }, - "params": Array [], - "range": Array [ - 10, - 31, - ], - "returnType": Object { + Object { "loc": Object { "end": Object { - "column": 27, + "column": 39, "line": 1, }, "start": Object { - "column": 21, + "column": 33, "line": 1, }, }, "range": Array [ - 21, - 27, + 33, + 39, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 27, - ], - "type": "TSVoidKeyword", - }, - }, - "type": "FunctionExpression", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 1, + "type": "TSNumberKeyword", }, - }, - "range": Array [ - 4, - 31, ], - "type": "VariableDeclarator", }, - ], - "kind": "var", + }, "loc": Object { "end": Object { - "column": 2, - "line": 2, + "column": 40, + "line": 1, }, "start": Object { "column": 0, @@ -43883,15 +45704,17 @@ Object { }, "range": Array [ 0, - 32, + 40, ], - "type": "VariableDeclaration", + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 3, + "column": 40, + "line": 1, }, "start": Object { "column": 0, @@ -43900,14 +45723,14 @@ Object { }, "range": Array [ 0, - 33, + 40, ], - "sourceType": "script", + "sourceType": "module", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 6, "line": 1, }, "start": Object { @@ -43917,187 +45740,133 @@ Object { }, "range": Array [ 0, - 3, + 6, ], "type": "Keyword", - "value": "var", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 11, "line": 1, }, "start": Object { - "column": 4, + "column": 7, "line": 1, }, }, "range": Array [ - 4, 7, + 11, ], "type": "Identifier", - "value": "obj", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 9, - ], - "type": "Punctuator", - "value": "=", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 21, "line": 1, }, "start": Object { - "column": 10, + "column": 12, "line": 1, }, }, "range": Array [ - 10, - 18, + 12, + 21, ], - "type": "Keyword", - "value": "function", + "type": "Identifier", + "value": "TestAlias", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 23, "line": 1, }, "start": Object { - "column": 19, + "column": 22, "line": 1, }, }, "range": Array [ - 19, - 20, + 22, + 23, ], "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 30, "line": 1, }, "start": Object { - "column": 20, + "column": 24, "line": 1, }, }, "range": Array [ - 20, - 21, + 24, + 30, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 32, "line": 1, }, "start": Object { - "column": 21, + "column": 31, "line": 1, }, }, "range": Array [ - 21, - 22, + 31, + 32, ], "type": "Punctuator", - "value": ":", + "value": "|", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 39, "line": 1, }, "start": Object { - "column": 23, + "column": 33, "line": 1, }, }, "range": Array [ - 23, - 27, + 33, + 39, ], - "type": "Keyword", - "value": "void", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 40, "line": 1, }, "start": Object { - "column": 28, + "column": 39, "line": 1, }, }, "range": Array [ - 28, - 29, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 30, - 31, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 2, - }, - "start": Object { - "column": 1, - "line": 2, - }, - }, - "range": Array [ - 31, - 32, + 39, + 40, ], "type": "Punctuator", "value": ";", @@ -44107,565 +45876,147 @@ Object { } `; -exports[`typescript fixtures/basics/function-overloads.src 1`] = ` +exports[`typescript fixtures/basics/export-type-class-declaration.src 1`] = ` Object { "body": Array [ Object { "declaration": Object { - "async": false, - "expression": false, - "generator": false, "id": Object { "loc": Object { "end": Object { - "column": 17, + "column": 26, "line": 1, }, "start": Object { - "column": 16, + "column": 12, "line": 1, }, }, - "name": "f", + "name": "TestClassProps", "range": Array [ - 16, - 17, + 12, + 26, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 2, + "line": 3, }, "start": Object { "column": 7, "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, + "range": Array [ + 7, + 51, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, }, - "name": "x", - "range": Array [ - 18, - 27, - ], - "type": "Identifier", - "typeAnnotation": Object { + "start": Object { + "column": 29, + "line": 1, + }, + }, + "members": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "count", + "range": Array [ + 35, + 40, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 19, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 19, - 27, + 35, + 48, ], - "type": "TSTypeAnnotation", + "type": "TSPropertySignature", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, + "column": 9, + "line": 2, }, }, "range": Array [ - 21, - 27, - ], - "type": "TSNumberKeyword", - }, - }, - }, - ], - "range": Array [ - 7, - 37, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 36, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "range": Array [ - 30, - 36, - ], - "type": "TSNumberKeyword", - }, - }, - "type": "TSDeclareFunction", - }, - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 37, - ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", - }, - Object { - "declaration": Object { - "async": false, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "name": "f", - "range": Array [ - 54, - 55, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 37, - "line": 2, - }, - "start": Object { - "column": 7, - "line": 2, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, - }, - }, - "name": "x", - "range": Array [ - 56, - 65, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 2, - }, - "start": Object { - "column": 19, - "line": 2, - }, - }, - "range": Array [ - 57, - 65, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 2, - }, - "start": Object { - "column": 21, - "line": 2, - }, - }, - "range": Array [ - 59, - 65, - ], - "type": "TSStringKeyword", - }, - }, - }, - ], - "range": Array [ - 45, - 75, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 2, - }, - "start": Object { - "column": 28, - "line": 2, - }, - }, - "range": Array [ - 66, - 74, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 2, - }, - "start": Object { - "column": 30, - "line": 2, - }, - }, - "range": Array [ - 68, - 74, - ], - "type": "TSStringKeyword", - }, - }, - "type": "TSDeclareFunction", - }, - "loc": Object { - "end": Object { - "column": 37, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 38, - 75, - ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", - }, - Object { - "declaration": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 4, - }, - "start": Object { - "column": 9, - "line": 4, - }, - }, - "name": "x", - "range": Array [ - 142, - 143, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 4, - }, - "start": Object { - "column": 2, - "line": 4, - }, - }, - "range": Array [ - 135, - 144, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 55, - "line": 3, - }, - }, - "range": Array [ - 131, - 146, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 3, - }, - "start": Object { - "column": 16, - "line": 3, - }, - }, - "name": "f", - "range": Array [ - 92, - 93, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 7, - "line": 3, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 3, - }, - "start": Object { - "column": 18, - "line": 3, - }, - }, - "name": "x", - "range": Array [ - 94, - 112, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 3, - }, - "start": Object { - "column": 19, - "line": 3, - }, - }, - "range": Array [ - 95, - 112, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 3, - }, - "start": Object { - "column": 21, - "line": 3, - }, - }, - "range": Array [ - 97, - 112, + 40, + 48, ], - "type": "TSUnionType", - "types": Array [ - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 3, - }, - "start": Object { - "column": 21, - "line": 3, - }, + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, }, - "range": Array [ - 97, - 103, - ], - "type": "TSStringKeyword", - }, - Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 3, - }, - "start": Object { - "column": 30, - "line": 3, - }, + "start": Object { + "column": 11, + "line": 2, }, - "range": Array [ - 106, - 112, - ], - "type": "TSNumberKeyword", }, - ], + "range": Array [ + 42, + 48, + ], + "type": "TSNumberKeyword", + }, }, }, - }, - ], - "range": Array [ - 83, - 146, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 54, - "line": 3, - }, - "start": Object { - "column": 37, - "line": 3, - }, - }, + ], "range": Array [ - 113, - 130, + 29, + 50, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 54, - "line": 3, - }, - "start": Object { - "column": 39, - "line": 3, - }, - }, - "range": Array [ - 115, - 130, - ], - "type": "TSUnionType", - "types": Array [ - Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 3, - }, - "start": Object { - "column": 39, - "line": 3, - }, - }, - "range": Array [ - 115, - 121, - ], - "type": "TSStringKeyword", - }, - Object { - "loc": Object { - "end": Object { - "column": 54, - "line": 3, - }, - "start": Object { - "column": 48, - "line": 3, - }, - }, - "range": Array [ - 124, - 130, - ], - "type": "TSNumberKeyword", - }, - ], - }, + "type": "TSTypeLiteral", }, - "type": "FunctionDeclaration", }, "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 2, + "line": 3, }, "start": Object { "column": 0, - "line": 3, + "line": 1, }, }, "range": Array [ - 76, - 146, + 0, + 51, ], "source": null, "specifiers": Array [], @@ -44674,8 +46025,8 @@ Object { ], "loc": Object { "end": Object { - "column": 0, - "line": 6, + "column": 2, + "line": 3, }, "start": Object { "column": 0, @@ -44684,7 +46035,7 @@ Object { }, "range": Array [ 0, - 147, + 51, ], "sourceType": "module", "tokens": Array [ @@ -44709,7 +46060,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { @@ -44719,187 +46070,353 @@ Object { }, "range": Array [ 7, - 15, + 11, ], - "type": "Keyword", - "value": "function", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 26, "line": 1, }, "start": Object { - "column": 16, + "column": 12, "line": 1, }, }, "range": Array [ - 16, - 17, + 12, + 26, ], "type": "Identifier", - "value": "f", + "value": "TestClassProps", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 28, "line": 1, }, "start": Object { - "column": 17, + "column": 27, "line": 1, }, }, "range": Array [ - 17, - 18, + 27, + 28, ], "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 30, "line": 1, }, "start": Object { - "column": 18, + "column": 29, "line": 1, }, }, "range": Array [ - 18, - 19, + 29, + 30, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { - "column": 19, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 19, - 20, + 35, + 40, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "count", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 10, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, + "column": 9, + "line": 2, }, }, "range": Array [ - 21, - 27, + 40, + 41, ], - "type": "Identifier", - "value": "number", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 27, - "line": 1, + "column": 11, + "line": 2, }, }, "range": Array [ - 27, - 28, + 42, + 48, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 28, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 28, - 29, + 49, + 50, ], "type": "Punctuator", - "value": ":", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 36, - "line": 1, + "column": 2, + "line": 3, }, "start": Object { - "column": 30, - "line": 1, + "column": 1, + "line": 3, }, }, "range": Array [ - 30, - 36, + 50, + 51, ], - "type": "Identifier", - "value": "number", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/export-type-function-declaration.src 1`] = ` +Object { + "body": Array [ Object { + "declaration": Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "TestCallback", + "range": Array [ + 12, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 47, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 28, + 37, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 37, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "TSNumberKeyword", + }, + }, + }, + ], + "range": Array [ + 27, + 46, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 46, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 46, + ], + "type": "TSVoidKeyword", + }, + }, + "type": "TSFunctionType", + }, + }, "loc": Object { "end": Object { - "column": 37, + "column": 47, "line": 1, }, "start": Object { - "column": 36, + "column": 0, "line": 1, }, }, "range": Array [ - 36, - 37, + 0, + 47, ], - "type": "Punctuator", - "value": ";", + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 47, + ], + "sourceType": "module", + "tokens": Array [ Object { "loc": Object { "end": Object { "column": 6, - "line": 2, + "line": 1, }, "start": Object { "column": 0, - "line": 2, + "line": 1, }, }, "range": Array [ - 38, - 44, + 0, + 6, ], "type": "Keyword", "value": "export", @@ -44907,143 +46424,107 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 11, + "line": 1, }, "start": Object { "column": 7, - "line": 2, + "line": 1, }, }, "range": Array [ - 45, - 53, + 7, + 11, ], - "type": "Keyword", - "value": "function", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 24, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 12, + "line": 1, }, }, "range": Array [ - 54, - 55, + 12, + 24, ], "type": "Identifier", - "value": "f", + "value": "TestCallback", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 26, + "line": 1, }, "start": Object { - "column": 17, - "line": 2, + "column": 25, + "line": 1, }, }, "range": Array [ - 55, - 56, + 25, + 26, ], "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, - }, - }, - "range": Array [ - 56, - 57, - ], - "type": "Identifier", - "value": "x", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 28, + "line": 1, }, "start": Object { - "column": 19, - "line": 2, + "column": 27, + "line": 1, }, }, "range": Array [ - 57, - 58, + 27, + 28, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 2, + "column": 29, + "line": 1, }, "start": Object { - "column": 21, - "line": 2, + "column": 28, + "line": 1, }, }, "range": Array [ - 59, - 65, + 28, + 29, ], "type": "Identifier", - "value": "string", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 2, + "column": 30, + "line": 1, }, "start": Object { - "column": 27, - "line": 2, - }, - }, - "range": Array [ - 65, - 66, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { "column": 29, - "line": 2, - }, - "start": Object { - "column": 28, - "line": 2, + "line": 1, }, }, "range": Array [ - 66, - 67, + 29, + 30, ], "type": "Punctuator", "value": ":", @@ -45051,305 +46532,586 @@ Object { Object { "loc": Object { "end": Object { - "column": 36, - "line": 2, + "column": 37, + "line": 1, }, "start": Object { - "column": 30, - "line": 2, + "column": 31, + "line": 1, }, }, "range": Array [ - 68, - 74, + 31, + 37, ], "type": "Identifier", - "value": "string", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 2, + "column": 38, + "line": 1, }, "start": Object { - "column": 36, - "line": 2, + "column": 37, + "line": 1, }, }, "range": Array [ - 74, - 75, + 37, + 38, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 3, + "column": 41, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 39, + "line": 1, }, }, "range": Array [ - 76, - 82, + 39, + 41, ], - "type": "Keyword", - "value": "export", + "type": "Punctuator", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 46, + "line": 1, }, "start": Object { - "column": 7, - "line": 3, + "column": 42, + "line": 1, }, }, "range": Array [ - 83, - 91, + 42, + 46, ], "type": "Keyword", - "value": "function", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 3, - }, - "start": Object { - "column": 16, - "line": 3, - }, - }, - "range": Array [ - 92, - 93, - ], - "type": "Identifier", - "value": "f", + "value": "void", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 3, + "column": 47, + "line": 1, }, "start": Object { - "column": 17, - "line": 3, + "column": 46, + "line": 1, }, }, "range": Array [ - 93, - 94, + 46, + 47, ], "type": "Punctuator", - "value": "(", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/function-anonymus-with-type-parameters.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 18, - "line": 3, - }, - }, - "range": Array [ - 94, - 95, - ], - "type": "Identifier", - "value": "x", + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "obj", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 38, + 47, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 49, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 23, + 32, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 32, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 32, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 10, + 49, + ], + "type": "FunctionExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "range": Array [ + 20, + 21, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 19, + 22, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 49, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 50, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 51, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 20, - "line": 3, + "column": 3, + "line": 1, }, "start": Object { - "column": 19, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 95, - 96, + 0, + 3, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 3, + "column": 7, + "line": 1, }, "start": Object { - "column": 21, - "line": 3, + "column": 4, + "line": 1, }, }, "range": Array [ - 97, - 103, + 4, + 7, ], "type": "Identifier", - "value": "string", + "value": "obj", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 3, + "column": 9, + "line": 1, }, "start": Object { - "column": 28, - "line": 3, + "column": 8, + "line": 1, }, }, "range": Array [ - 104, - 105, + 8, + 9, ], "type": "Punctuator", - "value": "|", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 36, - "line": 3, + "column": 18, + "line": 1, }, "start": Object { - "column": 30, - "line": 3, + "column": 10, + "line": 1, }, }, "range": Array [ - 106, - 112, + 10, + 18, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, ], "type": "Identifier", - "value": "number", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 3, + "column": 22, + "line": 1, }, "start": Object { - "column": 36, - "line": 3, + "column": 21, + "line": 1, }, }, "range": Array [ - 112, - 113, + 21, + 22, ], "type": "Punctuator", - "value": ")", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 38, - "line": 3, + "column": 23, + "line": 1, }, "start": Object { - "column": 37, - "line": 3, + "column": 22, + "line": 1, }, }, "range": Array [ - 113, - 114, + 22, + 23, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 45, - "line": 3, + "column": 24, + "line": 1, }, "start": Object { - "column": 39, - "line": 3, + "column": 23, + "line": 1, }, }, "range": Array [ - 115, - 121, + 23, + 24, ], "type": "Identifier", - "value": "string", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 47, - "line": 3, + "column": 25, + "line": 1, }, "start": Object { - "column": 46, - "line": 3, + "column": 24, + "line": 1, }, }, "range": Array [ - 122, - 123, + 24, + 25, ], "type": "Punctuator", - "value": "|", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 54, - "line": 3, + "column": 32, + "line": 1, }, "start": Object { - "column": 48, - "line": 3, + "column": 26, + "line": 1, }, }, "range": Array [ - 124, - 130, + 26, + 32, ], "type": "Identifier", - "value": "number", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 56, - "line": 3, + "column": 33, + "line": 1, }, "start": Object { - "column": 55, - "line": 3, + "column": 32, + "line": 1, }, }, "range": Array [ - 131, - 132, + 32, + 33, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, ], "type": "Punctuator", "value": "{", @@ -45358,16 +47120,16 @@ Object { "loc": Object { "end": Object { "column": 8, - "line": 4, + "line": 2, }, "start": Object { "column": 2, - "line": 4, + "line": 2, }, }, "range": Array [ - 135, - 141, + 38, + 44, ], "type": "Keyword", "value": "return", @@ -45376,34 +47138,34 @@ Object { "loc": Object { "end": Object { "column": 10, - "line": 4, + "line": 2, }, "start": Object { "column": 9, - "line": 4, + "line": 2, }, }, "range": Array [ - 142, - 143, + 45, + 46, ], "type": "Identifier", - "value": "x", + "value": "a", }, Object { "loc": Object { "end": Object { "column": 11, - "line": 4, + "line": 2, }, "start": Object { "column": 10, - "line": 4, + "line": 2, }, }, "range": Array [ - 143, - 144, + 46, + 47, ], "type": "Punctuator", "value": ";", @@ -45412,162 +47174,180 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 3, }, "start": Object { "column": 0, - "line": 5, + "line": 3, }, }, "range": Array [ - 145, - 146, + 48, + 49, ], "type": "Punctuator", "value": "}", }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 1, + "line": 3, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": ";", + }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/function-with-await.src 1`] = ` +exports[`typescript fixtures/basics/function-anynomus-with-return-type.src 1`] = ` Object { "body": Array [ Object { - "async": true, - "body": Object { - "body": Array [ - Object { - "expression": Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "name": "future", - "range": Array [ - 40, - 46, - ], - "type": "Identifier", + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, }, + }, + "name": "obj", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 16, + "column": 1, "line": 2, }, "start": Object { - "column": 4, - "line": 2, + "column": 28, + "line": 1, }, }, "range": Array [ - 34, - 46, + 28, + 31, ], - "type": "AwaitExpression", + "type": "BlockStatement", }, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 17, + "column": 1, "line": 2, }, "start": Object { - "column": 4, - "line": 2, + "column": 10, + "line": 1, }, }, + "params": Array [], "range": Array [ - 34, - 47, + 10, + 31, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 49, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, + "returnType": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 27, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 27, + ], + "type": "TSVoidKeyword", + }, + }, + "type": "FunctionExpression", }, - }, - "name": "hope", - "range": Array [ - 15, - 19, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 1, + "line": 2, }, "start": Object { - "column": 20, + "column": 4, "line": 1, }, }, - "name": "future", "range": Array [ - 20, - 26, + 4, + 31, ], - "type": "Identifier", + "type": "VariableDeclarator", }, ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 2, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, "range": Array [ 0, - 49, + 32, ], - "type": "FunctionDeclaration", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 3, }, "start": Object { "column": 0, @@ -45576,14 +47356,14 @@ Object { }, "range": Array [ 0, - 50, + 33, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 3, "line": 1, }, "start": Object { @@ -45593,97 +47373,97 @@ Object { }, "range": Array [ 0, - 5, + 3, ], - "type": "Identifier", - "value": "async", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 7, "line": 1, }, "start": Object { - "column": 6, + "column": 4, "line": 1, }, }, "range": Array [ - 6, - 14, + 4, + 7, ], - "type": "Keyword", - "value": "function", + "type": "Identifier", + "value": "obj", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 9, "line": 1, }, "start": Object { - "column": 15, + "column": 8, "line": 1, }, }, "range": Array [ - 15, - 19, + 8, + 9, ], - "type": "Identifier", - "value": "hope", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 18, "line": 1, }, "start": Object { - "column": 19, + "column": 10, "line": 1, }, }, "range": Array [ - 19, - 20, + 10, + 18, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 20, "line": 1, }, "start": Object { - "column": 20, + "column": 19, "line": 1, }, }, "range": Array [ + 19, 20, - 26, ], - "type": "Identifier", - "value": "future", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 21, "line": 1, }, "start": Object { - "column": 26, + "column": 20, "line": 1, }, }, "range": Array [ - 26, - 27, + 20, + 21, ], "type": "Punctuator", "value": ")", @@ -45691,245 +47471,156 @@ Object { Object { "loc": Object { "end": Object { - "column": 29, + "column": 22, "line": 1, }, "start": Object { - "column": 28, + "column": 21, "line": 1, }, }, "range": Array [ - 28, - 29, + 21, + 22, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 27, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 23, + "line": 1, }, }, "range": Array [ - 34, - 39, + 23, + 27, ], - "type": "Identifier", - "value": "await", + "type": "Keyword", + "value": "void", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 29, + "line": 1, }, "start": Object { - "column": 10, - "line": 2, + "column": 28, + "line": 1, }, }, "range": Array [ - 40, - 46, + 28, + 29, ], - "type": "Identifier", - "value": "future", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 1, "line": 2, }, "start": Object { - "column": 16, + "column": 0, "line": 2, }, }, "range": Array [ - 46, - 47, + 30, + 31, ], "type": "Punctuator", - "value": ";", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 2, + "line": 2, }, "start": Object { - "column": 0, - "line": 3, + "column": 1, + "line": 2, }, }, "range": Array [ - 48, - 49, + 31, + 32, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/function-with-object-type-with-optional-properties.src 1`] = ` +exports[`typescript fixtures/basics/function-overloads.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 47, - "line": 1, + "declaration": Object { + "async": false, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, }, + "name": "f", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", }, - "range": Array [ - 47, - 51, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { "loc": Object { "end": Object { - "column": 12, + "column": 37, "line": 1, }, "start": Object { - "column": 9, + "column": 7, "line": 1, }, }, - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, }, - "method": false, - "range": Array [ - 14, - 17, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", + "start": Object { + "column": 18, + "line": 1, }, }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "name": "baz", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - "kind": "init", + "name": "x", + "range": Array [ + 18, + 27, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 22, + "column": 27, "line": 1, }, "start": Object { @@ -45937,195 +47628,510 @@ Object { "line": 1, }, }, - "method": false, "range": Array [ 19, - 22, + 27, ], - "shorthand": true, - "type": "Property", - "value": Object { + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 22, + "column": 27, "line": 1, }, "start": Object { - "column": 19, + "column": 21, "line": 1, }, }, - "name": "baz", "range": Array [ - 19, - 22, + 21, + 27, ], - "type": "Identifier", + "type": "TSNumberKeyword", }, }, - ], + }, + ], + "range": Array [ + 7, + 37, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, "range": Array [ - 13, - 45, + 28, + 36, ], - "type": "ObjectPattern", + "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 45, + "column": 36, "line": 1, }, "start": Object { - "column": 23, + "column": 30, "line": 1, }, }, "range": Array [ - 23, - 45, + 30, + 36, ], - "type": "TSTypeAnnotation", + "type": "TSNumberKeyword", + }, + }, + "type": "TSDeclareFunction", + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + Object { + "declaration": Object { + "async": false, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "f", + "range": Array [ + 54, + 55, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "name": "x", + "range": Array [ + 56, + 65, + ], + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 45, - "line": 1, + "column": 27, + "line": 2, }, "start": Object { - "column": 25, - "line": 1, + "column": 19, + "line": 2, }, }, - "members": Array [ - Object { - "computed": false, - "key": Object { + "range": Array [ + 57, + 65, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 59, + 65, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 45, + 75, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 66, + 74, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "range": Array [ + 68, + 74, + ], + "type": "TSStringKeyword", + }, + }, + "type": "TSDeclareFunction", + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 38, + 75, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + Object { + "declaration": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "name": "x", + "range": Array [ + 142, + 143, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 135, + 144, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 55, + "line": 3, + }, + }, + "range": Array [ + 131, + 146, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "name": "f", + "range": Array [ + 92, + 93, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "name": "x", + "range": Array [ + 94, + 112, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 3, + }, + }, + "range": Array [ + 95, + 112, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "range": Array [ + 97, + 112, + ], + "type": "TSUnionType", + "types": Array [ + Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 27, + "line": 3, }, "start": Object { - "column": 26, - "line": 1, + "column": 21, + "line": 3, }, }, - "name": "bar", "range": Array [ - 26, - 29, + 97, + 103, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 39, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, + "type": "TSStringKeyword", }, - "optional": true, - "range": Array [ - 26, - 39, - ], - "type": "TSPropertySignature", - "typeAnnotation": Object { + Object { "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 36, + "line": 3, }, "start": Object { "column": 30, - "line": 1, + "line": 3, }, }, "range": Array [ - 30, - 38, + 106, + 112, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 32, - "line": 1, - }, - }, - "range": Array [ - 32, - 38, - ], - "type": "TSStringKeyword", - }, + "type": "TSNumberKeyword", + }, + ], + }, + }, + }, + ], + "range": Array [ + 83, + 146, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 3, + }, + "start": Object { + "column": 37, + "line": 3, + }, + }, + "range": Array [ + 113, + 130, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 3, + }, + "start": Object { + "column": 39, + "line": 3, + }, + }, + "range": Array [ + 115, + 130, + ], + "type": "TSUnionType", + "types": Array [ + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 3, + }, + "start": Object { + "column": 39, + "line": 3, }, }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 40, - "line": 1, - }, - }, - "name": "baz", - "range": Array [ - 40, - 43, - ], - "type": "Identifier", + "range": Array [ + 115, + 121, + ], + "type": "TSStringKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 3, }, - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 40, - "line": 1, - }, + "start": Object { + "column": 48, + "line": 3, }, - "optional": true, - "range": Array [ - 40, - 44, - ], - "type": "TSPropertySignature", }, - ], - "range": Array [ - 25, - 45, - ], - "type": "TSTypeLiteral", - }, + "range": Array [ + 124, + 130, + ], + "type": "TSNumberKeyword", + }, + ], }, }, - ], + "type": "FunctionDeclaration", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, "range": Array [ - 0, - 51, + 76, + 146, ], - "type": "FunctionDeclaration", + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 6, }, "start": Object { "column": 0, @@ -46134,14 +48140,14 @@ Object { }, "range": Array [ 0, - 52, + 147, ], - "sourceType": "script", + "sourceType": "module", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 6, "line": 1, }, "start": Object { @@ -46151,151 +48157,151 @@ Object { }, "range": Array [ 0, - 8, + 6, ], "type": "Keyword", - "value": "function", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 15, "line": 1, }, "start": Object { - "column": 9, + "column": 7, "line": 1, }, }, "range": Array [ - 9, - 12, + 7, + 15, ], - "type": "Identifier", - "value": "foo", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 17, "line": 1, }, "start": Object { - "column": 12, + "column": 16, "line": 1, }, }, "range": Array [ - 12, - 13, + 16, + 17, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "f", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 18, "line": 1, }, "start": Object { - "column": 13, + "column": 17, "line": 1, }, }, "range": Array [ - 13, - 14, + 17, + 18, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 19, "line": 1, }, "start": Object { - "column": 14, + "column": 18, "line": 1, }, }, "range": Array [ - 14, - 17, + 18, + 19, ], "type": "Identifier", - "value": "bar", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 20, "line": 1, }, "start": Object { - "column": 17, + "column": 19, "line": 1, }, }, "range": Array [ - 17, - 18, + 19, + 20, ], "type": "Punctuator", - "value": ",", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 27, "line": 1, }, "start": Object { - "column": 19, + "column": 21, "line": 1, }, }, "range": Array [ - 19, - 22, + 21, + 27, ], "type": "Identifier", - "value": "baz", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 28, "line": 1, }, "start": Object { - "column": 22, + "column": 27, "line": 1, }, }, "range": Array [ - 22, - 23, + 27, + 28, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 29, "line": 1, }, "start": Object { - "column": 23, + "column": 28, "line": 1, }, }, "range": Array [ - 23, - 24, + 28, + 29, ], "type": "Punctuator", "value": ":", @@ -46303,71 +48309,143 @@ Object { Object { "loc": Object { "end": Object { - "column": 26, + "column": 36, "line": 1, }, "start": Object { - "column": 25, + "column": 30, "line": 1, }, }, "range": Array [ - 25, - 26, + 30, + 36, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 37, "line": 1, }, "start": Object { - "column": 26, + "column": 36, "line": 1, }, }, "range": Array [ - 26, - 29, + 36, + 37, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 38, + 44, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 45, + 53, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 54, + 55, ], "type": "Identifier", - "value": "bar", + "value": "f", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 29, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 29, - 30, + 55, + 56, ], "type": "Punctuator", - "value": "?", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 19, + "line": 2, }, "start": Object { - "column": 30, - "line": 1, + "column": 18, + "line": 2, }, }, "range": Array [ - 30, - 31, + 56, + 57, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 57, + 58, ], "type": "Punctuator", "value": ":", @@ -46375,17 +48453,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 27, + "line": 2, }, "start": Object { - "column": 32, - "line": 1, + "column": 21, + "line": 2, }, }, "range": Array [ - 32, - 38, + 59, + 65, ], "type": "Identifier", "value": "string", @@ -46393,199 +48471,839 @@ Object { Object { "loc": Object { "end": Object { - "column": 39, - "line": 1, + "column": 28, + "line": 2, }, "start": Object { - "column": 38, - "line": 1, + "column": 27, + "line": 2, }, }, "range": Array [ - 38, - 39, + 65, + 66, ], "type": "Punctuator", - "value": ",", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 43, - "line": 1, + "column": 29, + "line": 2, }, "start": Object { - "column": 40, - "line": 1, + "column": 28, + "line": 2, }, }, "range": Array [ - 40, - 43, + 66, + 67, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "range": Array [ + 68, + 74, ], "type": "Identifier", - "value": "baz", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 44, - "line": 1, + "column": 37, + "line": 2, }, "start": Object { - "column": 43, - "line": 1, + "column": 36, + "line": 2, }, }, "range": Array [ - 43, - 44, + 74, + 75, ], "type": "Punctuator", - "value": "?", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 45, - "line": 1, + "column": 6, + "line": 3, }, "start": Object { - "column": 44, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 44, - 45, + 76, + 82, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 46, - "line": 1, + "column": 15, + "line": 3, }, "start": Object { - "column": 45, - "line": 1, + "column": 7, + "line": 3, }, }, "range": Array [ - 45, - 46, + 83, + 91, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 92, + 93, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 17, + "line": 3, + }, + }, + "range": Array [ + 93, + 94, ], "type": "Punctuator", - "value": ")", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 48, - "line": 1, + "column": 19, + "line": 3, }, "start": Object { - "column": 47, - "line": 1, + "column": 18, + "line": 3, }, }, "range": Array [ - 47, - 48, + 94, + 95, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 3, + }, + }, + "range": Array [ + 95, + 96, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 1, + "column": 27, "line": 3, }, "start": Object { - "column": 0, + "column": 21, "line": 3, }, }, "range": Array [ - 50, - 51, + 97, + 103, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 28, + "line": 3, + }, + }, + "range": Array [ + 104, + 105, ], "type": "Punctuator", - "value": "}", + "value": "|", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/function-with-object-type-without-annotation.src 1`] = ` -Object { - "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 45, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 36, + "line": 3, + }, + "start": Object { + "column": 30, + "line": 3, }, - "range": Array [ - 45, - 49, - ], - "type": "BlockStatement", }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, + "range": Array [ + 106, + 112, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 3, + }, + "start": Object { + "column": 36, + "line": 3, }, - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", }, + "range": Array [ + 112, + 113, + ], + "type": "Punctuator", + "value": ")", + }, + Object { "loc": Object { "end": Object { - "column": 1, + "column": 38, "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 37, + "line": 3, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, + "range": Array [ + 113, + 114, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 3, + }, + "start": Object { + "column": 39, + "line": 3, + }, + }, + "range": Array [ + 115, + 121, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 3, + }, + "start": Object { + "column": 46, + "line": 3, + }, + }, + "range": Array [ + 122, + 123, + ], + "type": "Punctuator", + "value": "|", + }, + Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 3, + }, + "start": Object { + "column": 48, + "line": 3, + }, + }, + "range": Array [ + 124, + 130, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 3, + }, + "start": Object { + "column": 55, + "line": 3, + }, + }, + "range": Array [ + 131, + 132, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 135, + 141, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "range": Array [ + 142, + 143, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 4, + }, + }, + "range": Array [ + 143, + 144, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 145, + 146, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/function-with-await.src 1`] = ` +Object { + "body": Array [ + Object { + "async": true, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "name": "future", + "range": Array [ + 40, + 46, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 34, + 46, + ], + "type": "AwaitExpression", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 34, + 47, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 49, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "hope", + "range": Array [ + 15, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "future", + "range": Array [ + 20, + 26, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 0, + 49, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 50, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Identifier", + "value": "async", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 14, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 19, + ], + "type": "Identifier", + "value": "hope", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 26, + ], + "type": "Identifier", + "value": "future", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 34, + 39, + ], + "type": "Identifier", + "value": "await", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 40, + 46, + ], + "type": "Identifier", + "value": "future", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/function-with-object-type-with-optional-properties.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "range": Array [ + 47, + 51, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, "properties": Array [ Object { "computed": false, @@ -46704,13 +49422,13 @@ Object { ], "range": Array [ 13, - 43, + 45, ], "type": "ObjectPattern", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 43, + "column": 45, "line": 1, }, "start": Object { @@ -46720,13 +49438,13 @@ Object { }, "range": Array [ 23, - 43, + 45, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 43, + "column": 45, "line": 1, }, "start": Object { @@ -46757,7 +49475,7 @@ Object { }, "loc": Object { "end": Object { - "column": 38, + "column": 39, "line": 1, }, "start": Object { @@ -46765,41 +49483,42 @@ Object { "line": 1, }, }, + "optional": true, "range": Array [ 26, - 38, + 39, ], "type": "TSPropertySignature", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 37, + "column": 38, "line": 1, }, "start": Object { - "column": 29, + "column": 30, "line": 1, }, }, "range": Array [ - 29, - 37, + 30, + 38, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 37, + "column": 38, "line": 1, }, "start": Object { - "column": 31, + "column": 32, "line": 1, }, }, "range": Array [ - 31, - 37, + 32, + 38, ], "type": "TSStringKeyword", }, @@ -46810,41 +49529,42 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 42, + "column": 43, "line": 1, }, "start": Object { - "column": 39, + "column": 40, "line": 1, }, }, "name": "baz", "range": Array [ - 39, - 42, + 40, + 43, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 42, + "column": 44, "line": 1, }, "start": Object { - "column": 39, + "column": 40, "line": 1, }, }, + "optional": true, "range": Array [ - 39, - 42, + 40, + 44, ], "type": "TSPropertySignature", }, ], "range": Array [ 25, - 43, + 45, ], "type": "TSTypeLiteral", }, @@ -46853,7 +49573,7 @@ Object { ], "range": Array [ 0, - 49, + 51, ], "type": "FunctionDeclaration", }, @@ -46870,7 +49590,7 @@ Object { }, "range": Array [ 0, - 50, + 52, ], "sourceType": "script", "tokens": Array [ @@ -47088,22 +49808,40 @@ Object { 30, ], "type": "Punctuator", - "value": ":", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 37, + "column": 31, "line": 1, }, "start": Object { - "column": 31, + "column": 30, "line": 1, }, }, "range": Array [ + 30, 31, - 37, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 38, ], "type": "Identifier", "value": "string", @@ -47111,17 +49849,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 38, + "column": 39, "line": 1, }, "start": Object { - "column": 37, + "column": 38, "line": 1, }, }, "range": Array [ - 37, 38, + 39, ], "type": "Punctuator", "value": ",", @@ -47129,17 +49867,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 42, + "column": 43, "line": 1, }, "start": Object { - "column": 39, + "column": 40, "line": 1, }, }, "range": Array [ - 39, - 42, + 40, + 43, ], "type": "Identifier", "value": "baz", @@ -47147,38 +49885,38 @@ Object { Object { "loc": Object { "end": Object { - "column": 43, + "column": 44, "line": 1, }, "start": Object { - "column": 42, + "column": 43, "line": 1, }, }, "range": Array [ - 42, 43, + 44, ], "type": "Punctuator", - "value": "}", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 44, + "column": 45, "line": 1, }, "start": Object { - "column": 43, + "column": 44, "line": 1, }, }, "range": Array [ - 43, 44, + 45, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { @@ -47196,6 +49934,24 @@ Object { 46, ], "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", "value": "{", }, Object { @@ -47210,8 +49966,8 @@ Object { }, }, "range": Array [ - 48, - 49, + 50, + 51, ], "type": "Punctuator", "value": "}", @@ -47221,62 +49977,26 @@ Object { } `; -exports[`typescript fixtures/basics/function-with-type-parameters.src 1`] = ` +exports[`typescript fixtures/basics/function-with-object-type-without-annotation.src 1`] = ` Object { "body": Array [ Object { "async": false, "body": Object { - "body": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "name": "b", - "range": Array [ - 36, - 37, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 29, - 38, - ], - "type": "ReturnStatement", - }, - ], + "body": Array [], "loc": Object { "end": Object { "column": 1, "line": 3, }, "start": Object { - "column": 23, + "column": 45, "line": 1, }, }, "range": Array [ - 23, - 40, + 45, + 49, ], "type": "BlockStatement", }, @@ -47285,7 +50005,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 10, + "column": 12, "line": 1, }, "start": Object { @@ -47293,10 +50013,10 @@ Object { "line": 1, }, }, - "name": "a", + "name": "foo", "range": Array [ 9, - 10, + 12, ], "type": "Identifier", }, @@ -47314,225 +50034,961 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, + "column": 43, "line": 1, }, "start": Object { - "column": 14, + "column": 13, "line": 1, }, }, - "name": "b", - "range": Array [ - 14, - 18, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", }, - }, - "range": Array [ - 15, - 18, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "kind": "init", "loc": Object { "end": Object { - "column": 18, + "column": 17, "line": 1, }, "start": Object { - "column": 17, + "column": 14, "line": 1, }, }, + "method": false, "range": Array [ + 14, 17, - 18, ], - "type": "TSTypeReference", - "typeName": Object { + "shorthand": true, + "type": "Property", + "value": Object { "loc": Object { "end": Object { - "column": 18, + "column": 17, "line": 1, }, "start": Object { - "column": 17, + "column": 14, "line": 1, }, }, - "name": "X", + "name": "bar", "range": Array [ + 14, 17, - 18, ], "type": "Identifier", }, }, - }, - }, - ], - "range": Array [ - 0, - 40, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 22, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 19, + 22, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, }, - }, + ], "range": Array [ - 21, - 22, + 13, + 43, ], - "type": "TSTypeReference", - "typeName": Object { + "type": "ObjectPattern", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 22, + "column": 43, "line": 1, }, "start": Object { - "column": 21, + "column": 23, "line": 1, }, }, - "name": "X", "range": Array [ - 21, - 22, + 23, + 43, ], - "type": "Identifier", - }, - }, - }, - "type": "FunctionDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": Object { + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 12, + "column": 43, "line": 1, }, "start": Object { - "column": 11, + "column": 25, "line": 1, }, }, - "name": "X", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "range": Array [ - 11, - 12, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 10, - 13, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 41, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 8, - ], - "type": "Keyword", - "value": "function", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, + "members": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 38, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 37, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 39, + 42, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 42, + ], + "type": "TSPropertySignature", + }, + ], + "range": Array [ + 25, + 43, + ], + "type": "TSTypeLiteral", + }, + }, + }, + ], + "range": Array [ + 0, + 49, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 50, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 42, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 45, + "line": 1, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/function-with-type-parameters.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "b", + "range": Array [ + 36, + 37, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 29, + 38, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 40, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 14, + 18, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + }, + }, + }, + ], + "range": Array [ + 0, + 40, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 22, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + }, + }, + "type": "FunctionDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "range": Array [ + 11, + 12, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 10, + 13, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 41, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, "line": 1, }, "start": Object { @@ -50279,6 +53735,7 @@ Object { ], "type": "Identifier", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -50461,6 +53918,7 @@ Object { ], "type": "Identifier", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -55900,243 +59358,17257 @@ Object { "line": 10, }, }, - "range": Array [ - 198, - 199, - ], - "type": "Identifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 10, - }, - "start": Object { - "column": 12, - "line": 10, + "range": Array [ + 198, + 199, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 10, + }, + "start": Object { + "column": 12, + "line": 10, + }, + }, + "range": Array [ + 199, + 200, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 10, + }, + "start": Object { + "column": 14, + "line": 10, + }, + }, + "range": Array [ + 201, + 202, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 10, + }, + "start": Object { + "column": 15, + "line": 10, + }, + }, + "range": Array [ + 202, + 203, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 10, + }, + "start": Object { + "column": 17, + "line": 10, + }, + }, + "range": Array [ + 204, + 205, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 10, + }, + "start": Object { + "column": 18, + "line": 10, + }, + }, + "range": Array [ + 205, + 206, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 10, + }, + "start": Object { + "column": 19, + "line": 10, + }, + }, + "range": Array [ + 206, + 207, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 10, + }, + "start": Object { + "column": 21, + "line": 10, + }, + }, + "range": Array [ + 208, + 212, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 10, + }, + "start": Object { + "column": 25, + "line": 10, + }, + }, + "range": Array [ + 212, + 213, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 11, + }, + "start": Object { + "column": 4, + "line": 11, + }, + }, + "range": Array [ + 218, + 221, + ], + "type": "Identifier", + "value": "boo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 11, + }, + "start": Object { + "column": 7, + "line": 11, + }, + }, + "range": Array [ + 221, + 222, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 11, + }, + "start": Object { + "column": 8, + "line": 11, + }, + }, + "range": Array [ + 222, + 223, + ], + "type": "Identifier", + "value": "J", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 11, + }, + "start": Object { + "column": 9, + "line": 11, + }, + }, + "range": Array [ + 223, + 224, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 11, + }, + "start": Object { + "column": 10, + "line": 11, + }, + }, + "range": Array [ + 224, + 225, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 11, + }, + "start": Object { + "column": 11, + "line": 11, + }, + }, + "range": Array [ + 225, + 226, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 11, + }, + "start": Object { + "column": 12, + "line": 11, + }, + }, + "range": Array [ + 226, + 227, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 11, + }, + "start": Object { + "column": 14, + "line": 11, + }, + }, + "range": Array [ + 228, + 229, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 11, + }, + "start": Object { + "column": 15, + "line": 11, + }, + }, + "range": Array [ + 229, + 230, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 11, + }, + "start": Object { + "column": 17, + "line": 11, + }, + }, + "range": Array [ + 231, + 232, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 11, + }, + "start": Object { + "column": 18, + "line": 11, + }, + }, + "range": Array [ + 232, + 233, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 11, + }, + "start": Object { + "column": 19, + "line": 11, + }, + }, + "range": Array [ + 233, + 234, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 11, + }, + "start": Object { + "column": 21, + "line": 11, + }, + }, + "range": Array [ + 235, + 239, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 11, + }, + "start": Object { + "column": 25, + "line": 11, + }, + }, + "range": Array [ + 239, + 240, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 12, + }, + "start": Object { + "column": 4, + "line": 12, + }, + }, + "range": Array [ + 245, + 248, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 12, + }, + "start": Object { + "column": 8, + "line": 12, + }, + }, + "range": Array [ + 249, + 250, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 12, + }, + "start": Object { + "column": 9, + "line": 12, + }, + }, + "range": Array [ + 250, + 251, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 12, + }, + "start": Object { + "column": 10, + "line": 12, + }, + }, + "range": Array [ + 251, + 252, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 12, + }, + "start": Object { + "column": 12, + "line": 12, + }, + }, + "range": Array [ + 253, + 254, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 12, + }, + "start": Object { + "column": 13, + "line": 12, + }, + }, + "range": Array [ + 254, + 255, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 12, + }, + "start": Object { + "column": 14, + "line": 12, + }, + }, + "range": Array [ + 255, + 256, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 12, + }, + "start": Object { + "column": 15, + "line": 12, + }, + }, + "range": Array [ + 256, + 257, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 12, + }, + "start": Object { + "column": 17, + "line": 12, + }, + }, + "range": Array [ + 258, + 264, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 12, + }, + "start": Object { + "column": 23, + "line": 12, + }, + }, + "range": Array [ + 264, + 265, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 13, + }, + "start": Object { + "column": 4, + "line": 13, + }, + }, + "range": Array [ + 270, + 273, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 13, + }, + "start": Object { + "column": 8, + "line": 13, + }, + }, + "range": Array [ + 274, + 275, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 13, + }, + "start": Object { + "column": 9, + "line": 13, + }, + }, + "range": Array [ + 275, + 276, + ], + "type": "Identifier", + "value": "F", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 13, + }, + "start": Object { + "column": 10, + "line": 13, + }, + }, + "range": Array [ + 276, + 277, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 13, + }, + "start": Object { + "column": 11, + "line": 13, + }, + }, + "range": Array [ + 277, + 278, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 13, + }, + "start": Object { + "column": 12, + "line": 13, + }, + }, + "range": Array [ + 278, + 279, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 13, + }, + "start": Object { + "column": 13, + "line": 13, + }, + }, + "range": Array [ + 279, + 280, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 13, + }, + "start": Object { + "column": 15, + "line": 13, + }, + }, + "range": Array [ + 281, + 282, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 13, + }, + "start": Object { + "column": 16, + "line": 13, + }, + }, + "range": Array [ + 282, + 283, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 13, + }, + "start": Object { + "column": 17, + "line": 13, + }, + }, + "range": Array [ + 283, + 284, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 13, + }, + "start": Object { + "column": 18, + "line": 13, + }, + }, + "range": Array [ + 284, + 285, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 13, + }, + "start": Object { + "column": 20, + "line": 13, + }, + }, + "range": Array [ + 286, + 292, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 13, + }, + "start": Object { + "column": 26, + "line": 13, + }, + }, + "range": Array [ + 292, + 293, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 14, + }, + "start": Object { + "column": 0, + "line": 14, + }, + }, + "range": Array [ + 294, + 295, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-with-construct-signature-with-parameter-accessibility.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "params": Array [ + Object { + "accessibility": "public", + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "x", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + "range": Array [ + 26, + 34, + ], + "type": "TSParameterProperty", + }, + Object { + "accessibility": "private", + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "name": "y", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + "range": Array [ + 36, + 45, + ], + "type": "TSParameterProperty", + }, + ], + "range": Array [ + 21, + 47, + ], + "type": "TSConstructSignatureDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 49, + ], + "type": "TSInterfaceBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 49, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 50, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + "value": "Test", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 26, + 32, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 36, + 43, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-with-extends-member-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 33, + ], + "type": "TSInterfaceBody", + }, + "extends": Array [ + Object { + "expression": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + "range": Array [ + 22, + 29, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 29, + ], + "type": "TSInterfaceHeritage", + }, + ], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 33, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 34, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 21, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-with-extends-type-parameters.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 36, + ], + "type": "TSInterfaceBody", + }, + "extends": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 31, + ], + "type": "TSInterfaceHeritage", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "J", + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 28, + 31, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + ], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 36, + ], + "type": "TSInterfaceDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "range": Array [ + 14, + 15, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 13, + 16, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 24, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + "value": "Bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + "value": "J", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-with-generic.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 21, + ], + "type": "TSInterfaceBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "type": "TSInterfaceDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "range": Array [ + 15, + 16, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 14, + 17, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + "value": "Test", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-with-jsdoc.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "name": "foo", + "range": Array [ + 76, + 79, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "name": "bar", + "range": Array [ + 80, + 83, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 76, + 85, + ], + "type": "TSMethodSignature", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 87, + ], + "type": "TSInterfaceBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 87, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 88, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + "value": "Test", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 76, + 79, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 6, + }, + "start": Object { + "column": 7, + "line": 6, + }, + }, + "range": Array [ + 79, + 80, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "range": Array [ + 80, + 83, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 11, + "line": 6, + }, + }, + "range": Array [ + 83, + 84, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 6, + }, + "start": Object { + "column": 12, + "line": 6, + }, + }, + "range": Array [ + 84, + 85, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "range": Array [ + 86, + 87, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-with-method.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "h", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 21, + 32, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 24, + 32, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 26, + 32, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 19, + 40, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 33, + 39, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 35, + 39, + ], + "type": "TSVoidKeyword", + }, + }, + "type": "TSMethodSignature", + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "name": "g", + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 48, + 54, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 51, + 54, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "name": "T", + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + }, + }, + }, + }, + ], + "range": Array [ + 43, + 59, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 55, + 58, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "name": "T", + "range": Array [ + 57, + 58, + ], + "type": "Identifier", + }, + }, + }, + "type": "TSMethodSignature", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 3, + "line": 3, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "T", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + "range": Array [ + 45, + 46, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 44, + 47, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 61, + ], + "type": "TSInterfaceBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 61, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 62, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + "value": "test", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + "value": "h", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 26, + 32, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 35, + 39, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + "value": "g", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 3, + }, + "start": Object { + "column": 3, + "line": 3, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 48, + 51, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 17, + "line": 3, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 60, + 61, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-with-optional-properties.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "optional": true, + "range": Array [ + 21, + 26, + ], + "type": "TSPropertySignature", + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 31, + 34, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "optional": true, + "range": Array [ + 31, + 44, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 35, + 43, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 37, + 43, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "name": "baz", + "range": Array [ + 49, + 52, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 34, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "optional": true, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "name": "foo", + "range": Array [ + 54, + 57, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "name": "bar", + "optional": true, + "range": Array [ + 59, + 71, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "range": Array [ + 63, + 71, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 20, + "line": 4, + }, + }, + "range": Array [ + 65, + 71, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 4, + }, + "start": Object { + "column": 28, + "line": 4, + }, + }, + "name": "baz", + "optional": true, + "range": Array [ + 73, + 77, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 49, + 79, + ], + "type": "TSMethodSignature", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 81, + ], + "type": "TSInterfaceBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 81, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 82, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + "value": "test", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 31, + 34, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 37, + 43, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 49, + 52, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 7, + "line": 4, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "range": Array [ + 54, + 57, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "range": Array [ + 59, + 62, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "range": Array [ + 63, + 64, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 20, + "line": 4, + }, + }, + "range": Array [ + 65, + 71, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 26, + "line": 4, + }, + }, + "range": Array [ + 71, + 72, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 28, + "line": 4, + }, + }, + "range": Array [ + 73, + 76, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 4, + }, + "start": Object { + "column": 31, + "line": 4, + }, + }, + "range": Array [ + 76, + 77, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 4, + }, + "start": Object { + "column": 32, + "line": 4, + }, + }, + "range": Array [ + 77, + 78, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 4, + }, + "start": Object { + "column": 33, + "line": 4, + }, + }, + "range": Array [ + 78, + 79, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 80, + 81, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-without-type-annotation.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 25, + ], + "type": "TSPropertySignature", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 27, + ], + "type": "TSInterfaceBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + "value": "test", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/keyof-operator.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "operator": "keyof", + "range": Array [ + 9, + 18, + ], + "type": "TSTypeOperator", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 14, + ], + "type": "Identifier", + "value": "keyof", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/keyword-variables.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "name": "get", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 10, + 17, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 4, + 18, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "name": "set", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 33, + 34, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 27, + 34, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 21, + 35, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "name": "module", + "range": Array [ + 44, + 50, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 53, + 54, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 44, + 54, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 19, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 38, + 55, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "name": "type", + "range": Array [ + 64, + 68, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 15, + "line": 5, + }, + }, + "range": Array [ + 71, + 72, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 64, + 72, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 58, + 73, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "name": "async", + "range": Array [ + 82, + 87, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 6, + }, + "start": Object { + "column": 16, + "line": 6, + }, + }, + "range": Array [ + 90, + 91, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "range": Array [ + 82, + 91, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 18, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 76, + 92, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "name": "is", + "range": Array [ + 101, + 103, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "start": Object { + "column": 13, + "line": 7, + }, + }, + "range": Array [ + 106, + 107, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "range": Array [ + 101, + 107, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 15, + "line": 7, + }, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "range": Array [ + 95, + 108, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 110, + ], + "type": "BlockStatement", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 17, + }, + "start": Object { + "column": 0, + "line": 10, + }, + }, + "range": Array [ + 112, + 189, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 17, + }, + "start": Object { + "column": 7, + "line": 17, + }, + }, + "range": Array [ + 175, + 188, + ], + "raw": "'fake-module'", + "type": "Literal", + "value": "fake-module", + }, + "specifiers": Array [ + Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 11, + }, + "start": Object { + "column": 2, + "line": 11, + }, + }, + "name": "get", + "range": Array [ + 123, + 126, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 11, + }, + "start": Object { + "column": 2, + "line": 11, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 11, + }, + "start": Object { + "column": 2, + "line": 11, + }, + }, + "name": "get", + "range": Array [ + 123, + 126, + ], + "type": "Identifier", + }, + "range": Array [ + 123, + 126, + ], + "type": "ImportSpecifier", + }, + Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 12, + }, + "start": Object { + "column": 2, + "line": 12, + }, + }, + "name": "set", + "range": Array [ + 130, + 133, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 12, + }, + "start": Object { + "column": 2, + "line": 12, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 12, + }, + "start": Object { + "column": 2, + "line": 12, + }, + }, + "name": "set", + "range": Array [ + 130, + 133, + ], + "type": "Identifier", + }, + "range": Array [ + 130, + 133, + ], + "type": "ImportSpecifier", + }, + Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 13, + }, + "start": Object { + "column": 2, + "line": 13, + }, + }, + "name": "module", + "range": Array [ + 137, + 143, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 13, + }, + "start": Object { + "column": 2, + "line": 13, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 13, + }, + "start": Object { + "column": 2, + "line": 13, + }, + }, + "name": "module", + "range": Array [ + 137, + 143, + ], + "type": "Identifier", + }, + "range": Array [ + 137, + 143, + ], + "type": "ImportSpecifier", + }, + Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 14, + }, + "start": Object { + "column": 2, + "line": 14, + }, + }, + "name": "type", + "range": Array [ + 147, + 151, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 14, + }, + "start": Object { + "column": 2, + "line": 14, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 14, + }, + "start": Object { + "column": 2, + "line": 14, + }, + }, + "name": "type", + "range": Array [ + 147, + 151, + ], + "type": "Identifier", + }, + "range": Array [ + 147, + 151, + ], + "type": "ImportSpecifier", + }, + Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 15, + }, + "start": Object { + "column": 2, + "line": 15, + }, + }, + "name": "async", + "range": Array [ + 155, + 160, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 15, + }, + "start": Object { + "column": 2, + "line": 15, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 15, + }, + "start": Object { + "column": 2, + "line": 15, + }, + }, + "name": "async", + "range": Array [ + 155, + 160, + ], + "type": "Identifier", + }, + "range": Array [ + 155, + 160, + ], + "type": "ImportSpecifier", + }, + Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 16, + }, + "start": Object { + "column": 2, + "line": 16, + }, + }, + "name": "is", + "range": Array [ + 164, + 166, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 4, + "line": 16, + }, + "start": Object { + "column": 2, + "line": 16, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 16, + }, + "start": Object { + "column": 2, + "line": 16, + }, + }, + "name": "is", + "range": Array [ + 164, + 166, + ], + "type": "Identifier", + }, + "range": Array [ + 164, + 166, + ], + "type": "ImportSpecifier", + }, + ], + "type": "ImportDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 18, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 190, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 4, + 9, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 21, + 26, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + "value": "set", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 38, + 43, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 44, + 50, + ], + "type": "Identifier", + "value": "module", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 4, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 58, + 63, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 64, + 68, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 13, + "line": 5, + }, + }, + "range": Array [ + 69, + 70, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 15, + "line": 5, + }, + }, + "range": Array [ + 71, + 72, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 5, + }, + }, + "range": Array [ + 72, + 73, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 76, + 81, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "range": Array [ + 82, + 87, + ], + "type": "Identifier", + "value": "async", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 6, + }, + "start": Object { + "column": 14, + "line": 6, + }, + }, + "range": Array [ + 88, + 89, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 6, + }, + "start": Object { + "column": 16, + "line": 6, + }, + }, + "range": Array [ + 90, + 91, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 6, + }, + "start": Object { + "column": 17, + "line": 6, + }, + }, + "range": Array [ + 91, + 92, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "range": Array [ + 95, + 100, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "range": Array [ + 101, + 103, + ], + "type": "Identifier", + "value": "is", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 7, + }, + "start": Object { + "column": 11, + "line": 7, + }, + }, + "range": Array [ + 104, + 105, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "start": Object { + "column": 13, + "line": 7, + }, + }, + "range": Array [ + 106, + 107, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 7, + }, + "start": Object { + "column": 14, + "line": 7, + }, + }, + "range": Array [ + 107, + 108, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 8, + }, + }, + "range": Array [ + 109, + 110, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 10, + }, + }, + "range": Array [ + 112, + 118, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 10, + }, + "start": Object { + "column": 7, + "line": 10, + }, + }, + "range": Array [ + 119, + 120, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 11, + }, + "start": Object { + "column": 2, + "line": 11, + }, + }, + "range": Array [ + 123, + 126, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 11, + }, + "start": Object { + "column": 5, + "line": 11, + }, + }, + "range": Array [ + 126, + 127, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 12, + }, + "start": Object { + "column": 2, + "line": 12, + }, + }, + "range": Array [ + 130, + 133, + ], + "type": "Identifier", + "value": "set", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 12, + }, + "start": Object { + "column": 5, + "line": 12, + }, + }, + "range": Array [ + 133, + 134, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 13, + }, + "start": Object { + "column": 2, + "line": 13, + }, + }, + "range": Array [ + 137, + 143, + ], + "type": "Identifier", + "value": "module", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 13, + }, + "start": Object { + "column": 8, + "line": 13, + }, + }, + "range": Array [ + 143, + 144, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 14, + }, + "start": Object { + "column": 2, + "line": 14, + }, + }, + "range": Array [ + 147, + 151, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 14, + }, + "start": Object { + "column": 6, + "line": 14, + }, + }, + "range": Array [ + 151, + 152, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 15, + }, + "start": Object { + "column": 2, + "line": 15, + }, + }, + "range": Array [ + 155, + 160, + ], + "type": "Identifier", + "value": "async", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 15, + }, + "start": Object { + "column": 7, + "line": 15, + }, + }, + "range": Array [ + 160, + 161, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 16, + }, + "start": Object { + "column": 2, + "line": 16, + }, + }, + "range": Array [ + 164, + 166, + ], + "type": "Identifier", + "value": "is", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 16, + }, + "start": Object { + "column": 4, + "line": 16, + }, + }, + "range": Array [ + 166, + 167, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 17, + }, + "start": Object { + "column": 0, + "line": 17, + }, + }, + "range": Array [ + 168, + 169, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 17, + }, + "start": Object { + "column": 2, + "line": 17, + }, + }, + "range": Array [ + 170, + 174, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 17, + }, + "start": Object { + "column": 7, + "line": 17, + }, + }, + "range": Array [ + 175, + 188, + ], + "type": "String", + "value": "'fake-module'", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 17, + }, + "start": Object { + "column": 20, + "line": 17, + }, + }, + "range": Array [ + 188, + 189, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/nested-type-arguments.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "nestedArray", + "range": Array [ + 4, + 44, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 44, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 44, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 17, + 22, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 43, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 23, + 28, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 42, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 29, + 34, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 41, + ], + "type": "TSStringKeyword", + }, + ], + "range": Array [ + 34, + 42, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + ], + "range": Array [ + 28, + 43, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + ], + "range": Array [ + 22, + 44, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 44, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 44, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 44, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 15, + ], + "type": "Identifier", + "value": "nestedArray", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 22, + ], + "type": "Identifier", + "value": "Array", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 28, + ], + "type": "Identifier", + "value": "Array", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 34, + ], + "type": "Identifier", + "value": "Array", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 41, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ">", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/never-type-param.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 17, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 17, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 17, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 16, + ], + "type": "TSNeverKeyword", + }, + ], + "range": Array [ + 10, + 17, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 17, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "type": "VariableDeclaration", + }, + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "name": "Observable", + "range": Array [ + 19, + 29, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "empty", + "range": Array [ + 30, + 35, + ], + "type": "Identifier", + }, + "range": Array [ + 19, + 35, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "optional": false, + "range": Array [ + 19, + 44, + ], + "type": "CallExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 36, + 41, + ], + "type": "TSNeverKeyword", + }, + ], + "range": Array [ + 35, + 42, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 19, + 45, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 46, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 16, + ], + "type": "Identifier", + "value": "never", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 19, + 29, + ], + "type": "Identifier", + "value": "Observable", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 30, + 35, + ], + "type": "Identifier", + "value": "empty", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 36, + 41, + ], + "type": "Identifier", + "value": "never", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/non-null-assertion-operator.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "name": "e", + "range": Array [ + 56, + 57, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "validateEntity", + "range": Array [ + 41, + 55, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "optional": false, + "range": Array [ + 41, + 58, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 41, + 59, + ], + "type": "ExpressionStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "name": "s", + "range": Array [ + 68, + 69, + ], + "type": "Identifier", + }, + "init": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "object": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "name": "e", + "range": Array [ + 72, + 73, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 72, + 74, + ], + "type": "TSNonNullExpression", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "name": "name", + "range": Array [ + 75, + 79, + ], + "type": "Identifier", + }, + "range": Array [ + 72, + 79, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 68, + 79, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 64, + 80, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 82, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "processEntity", + "range": Array [ + 9, + 22, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "e", + "optional": true, + "range": Array [ + 23, + 33, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 33, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 33, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "name": "Entity", + "range": Array [ + 27, + 33, + ], + "type": "Identifier", + }, + }, + }, + }, + ], + "range": Array [ + 0, + 82, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 82, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 22, + ], + "type": "Identifier", + "value": "processEntity", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + "value": "e", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 33, + ], + "type": "Identifier", + "value": "Entity", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 41, + 55, + ], + "type": "Identifier", + "value": "validateEntity", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Identifier", + "value": "e", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 64, + 67, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Identifier", + "value": "s", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 70, + 71, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 72, + 73, + ], + "type": "Identifier", + "value": "e", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 73, + 74, + ], + "type": "Punctuator", + "value": "!", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 74, + 75, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 75, + 79, + ], + "type": "Identifier", + "value": "name", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 3, + }, + }, + "range": Array [ + 79, + 80, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 81, + 82, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/null-and-undefined-type-annotations.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 11, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 11, + ], + "type": "TSNullKeyword", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 11, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "y", + "range": Array [ + 17, + 29, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 18, + 29, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 20, + 29, + ], + "type": "TSUndefinedKeyword", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 17, + 29, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 13, + 30, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 11, + ], + "type": "Keyword", + "value": "null", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 20, + 29, + ], + "type": "Identifier", + "value": "undefined", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/nullish-coalescing.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "name": "len", + "range": Array [ + 52, + 55, + ], + "type": "Identifier", + }, + "init": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "name": "s", + "range": Array [ + 59, + 60, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "operator": "??", + "range": Array [ + 59, + 66, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 64, + 66, + ], + "raw": "''", + "type": "Literal", + "value": "", + }, + "type": "LogicalExpression", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 52, + 67, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 48, + 68, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 70, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "processNullishCoalesce", + "range": Array [ + 9, + 31, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "name": "s", + "optional": true, + "range": Array [ + 32, + 42, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 42, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 42, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 0, + 70, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 71, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 31, + ], + "type": "Identifier", + "value": "processNullishCoalesce", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Identifier", + "value": "s", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 42, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 48, + 51, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 52, + 55, + ], + "type": "Identifier", + "value": "len", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Identifier", + "value": "s", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 61, + 63, + ], + "type": "Punctuator", + "value": "??", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 64, + 66, + ], + "type": "String", + "value": "''", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 66, + 67, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 67, + 68, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 69, + 70, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/object-with-escaped-properties.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 7, + ], + "raw": "'__'", + "type": "Literal", + "value": "__", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 3, + 13, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 13, + ], + "raw": "null", + "type": "Literal", + "value": null, + }, + }, + ], + "range": Array [ + 1, + 15, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 1, + "line": 3, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 3, + "line": 3, + }, + }, + "range": Array [ + 22, + 26, + ], + "raw": "'__'", + "type": "Literal", + "value": "__", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 3, + "line": 3, + }, + }, + "method": true, + "range": Array [ + 22, + 31, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 29, + 31, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "params": Array [], + "range": Array [ + 26, + 31, + ], + "type": "FunctionExpression", + }, + }, + ], + "range": Array [ + 20, + 33, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 19, + 35, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 5, + }, + }, + "properties": Array [ + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 41, + 45, + ], + "raw": "'__'", + "type": "Literal", + "value": "__", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "method": false, + "range": Array [ + 40, + 52, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 48, + 52, + ], + "raw": "null", + "type": "Literal", + "value": null, + }, + }, + ], + "range": Array [ + 38, + 54, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 37, + 56, + ], + "type": "ExpressionStatement", + }, + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "declare": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "start": Object { + "column": 10, + "line": 7, + }, + }, + "range": Array [ + 68, + 72, + ], + "raw": "'__'", + "type": "Literal", + "value": "__", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 7, + }, + "start": Object { + "column": 10, + "line": 7, + }, + }, + "range": Array [ + 68, + 79, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 7, + }, + "start": Object { + "column": 17, + "line": 7, + }, + }, + "range": Array [ + 75, + 79, + ], + "raw": "null", + "type": "Literal", + "value": null, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "range": Array [ + 66, + 81, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 6, + "line": 7, + }, + }, + "name": "X", + "range": Array [ + 64, + 65, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "range": Array [ + 58, + 81, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 82, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 7, + ], + "type": "String", + "value": "'__'", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 13, + ], + "type": "Keyword", + "value": "null", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 1, + "line": 3, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 3, + "line": 3, + }, + }, + "range": Array [ + 22, + 26, + ], + "type": "String", + "value": "'__'", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 5, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 41, + 45, + ], + "type": "String", + "value": "'__'", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 48, + 52, + ], + "type": "Keyword", + "value": "null", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 5, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 18, + "line": 5, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "range": Array [ + 58, + 63, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 6, + "line": 7, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "range": Array [ + 66, + 67, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "start": Object { + "column": 10, + "line": 7, + }, + }, + "range": Array [ + 68, + 72, + ], + "type": "String", + "value": "'__'", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 7, + }, + "start": Object { + "column": 15, + "line": 7, + }, + }, + "range": Array [ + 73, + 74, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 7, + }, + "start": Object { + "column": 17, + "line": 7, + }, + }, + "range": Array [ + 75, + 79, + ], + "type": "Keyword", + "value": "null", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 7, + }, + "start": Object { + "column": 22, + "line": 7, + }, + }, + "range": Array [ + 80, + 81, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/object-with-typed-methods.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 13, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 16, + 29, + ], + "raw": "\\"constructor\\"", + "type": "Literal", + "value": "constructor", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "method": true, + "range": Array [ + 16, + 61, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 56, + 57, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 49, + 57, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "range": Array [ + 43, + 61, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 29, + 61, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 34, + 42, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 36, + 42, + ], + "type": "TSNumberKeyword", + }, + }, + "type": "FunctionExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "T", + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + }, + "range": Array [ + 30, + 31, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 29, + 32, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "name": "foo", + "range": Array [ + 65, + 68, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 3, + "line": 7, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "method": true, + "range": Array [ + 65, + 100, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 11, + "line": 6, + }, + }, + "range": Array [ + 95, + 96, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 88, + 96, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 7, + }, + "start": Object { + "column": 19, + "line": 5, + }, + }, + "range": Array [ + 82, + 100, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 7, + }, + "start": Object { + "column": 5, + "line": 5, + }, + }, + "params": Array [], + "range": Array [ + 68, + 100, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 10, + "line": 5, + }, + }, + "range": Array [ + 73, + 81, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "range": Array [ + 75, + 81, + ], + "type": "TSNumberKeyword", + }, + }, + "type": "FunctionExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 5, + "line": 5, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "name": "T", + "range": Array [ + 69, + 70, + ], + "type": "Identifier", + }, + "range": Array [ + 69, + 70, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 68, + 71, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 8, + }, + "start": Object { + "column": 6, + "line": 8, + }, + }, + "name": "a", + "range": Array [ + 108, + 109, + ], + "type": "Identifier", + }, + "kind": "get", + "loc": Object { + "end": Object { + "column": 3, + "line": 10, + }, + "start": Object { + "column": 2, + "line": 8, + }, + }, + "method": false, + "range": Array [ + 104, + 138, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 9, + }, + "start": Object { + "column": 11, + "line": 9, + }, + }, + "range": Array [ + 133, + 134, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 9, + }, + "start": Object { + "column": 4, + "line": 9, + }, + }, + "range": Array [ + 126, + 134, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 10, + }, + "start": Object { + "column": 18, + "line": 8, + }, + }, + "range": Array [ + 120, + 138, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 10, + }, + "start": Object { + "column": 7, + "line": 8, + }, + }, + "params": Array [], + "range": Array [ + 109, + 138, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 8, + }, + "start": Object { + "column": 9, + "line": 8, + }, + }, + "range": Array [ + 111, + 119, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 8, + }, + "start": Object { + "column": 11, + "line": 8, + }, + }, + "range": Array [ + 113, + 119, + ], + "type": "TSNumberKeyword", + }, + }, + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 11, + }, + "start": Object { + "column": 6, + "line": 11, + }, + }, + "name": "a", + "range": Array [ + 146, + 147, + ], + "type": "Identifier", + }, + "kind": "set", + "loc": Object { + "end": Object { + "column": 3, + "line": 12, + }, + "start": Object { + "column": 2, + "line": 11, + }, + }, + "method": false, + "range": Array [ + 142, + 172, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 3, + "line": 12, + }, + "start": Object { + "column": 27, + "line": 11, + }, + }, + "range": Array [ + 167, + 172, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 12, + }, + "start": Object { + "column": 7, + "line": 11, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 11, + }, + "start": Object { + "column": 8, + "line": 11, + }, + }, + "name": "x", + "range": Array [ + 148, + 157, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 11, + }, + "start": Object { + "column": 9, + "line": 11, + }, + }, + "range": Array [ + 149, + 157, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 11, + }, + "start": Object { + "column": 11, + "line": 11, + }, + }, + "range": Array [ + 151, + 157, + ], + "type": "TSNumberKeyword", + }, + }, + }, + ], + "range": Array [ + 147, + 172, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 11, + }, + "start": Object { + "column": 18, + "line": 11, + }, + }, + "range": Array [ + 158, + 166, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 11, + }, + "start": Object { + "column": 20, + "line": 11, + }, + }, + "range": Array [ + 160, + 166, + ], + "type": "TSNumberKeyword", + }, + }, + "type": "FunctionExpression", + }, + }, + ], + "range": Array [ + 12, + 174, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 13, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 174, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 2, + "line": 13, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 175, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 14, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 176, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 16, + 29, + ], + "type": "String", + "value": "\\"constructor\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 36, + 42, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 49, + 55, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 60, + 61, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 4, + }, + "start": Object { + "column": 3, + "line": 4, + }, + }, + "range": Array [ + 61, + 62, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 65, + 68, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 5, + }, + "start": Object { + "column": 5, + "line": 5, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "range": Array [ + 69, + 70, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 7, + "line": 5, + }, + }, + "range": Array [ + 70, + 71, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 71, + 72, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "range": Array [ + 72, + 73, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 5, + }, + "start": Object { + "column": 10, + "line": 5, + }, + }, + "range": Array [ + 73, + 74, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "range": Array [ + 75, + 81, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 5, + }, + "start": Object { + "column": 19, + "line": 5, + }, + }, + "range": Array [ + 82, + 83, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 88, + 94, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 11, + "line": 6, + }, + }, + "range": Array [ + 95, + 96, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 7, + }, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "range": Array [ + 99, + 100, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 7, + }, + "start": Object { + "column": 3, + "line": 7, + }, + }, + "range": Array [ + 100, + 101, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 8, + }, + "start": Object { + "column": 2, + "line": 8, + }, + }, + "range": Array [ + 104, + 107, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 8, + }, + "start": Object { + "column": 6, + "line": 8, + }, + }, + "range": Array [ + 108, + 109, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 8, + }, + "start": Object { + "column": 7, + "line": 8, + }, + }, + "range": Array [ + 109, + 110, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 8, + }, + "start": Object { + "column": 8, + "line": 8, + }, + }, + "range": Array [ + 110, + 111, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 9, + "line": 8, + }, + }, + "range": Array [ + 111, + 112, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 8, + }, + "start": Object { + "column": 11, + "line": 8, + }, + }, + "range": Array [ + 113, + 119, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 8, + }, + "start": Object { + "column": 18, + "line": 8, + }, + }, + "range": Array [ + 120, + 121, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 9, + }, + "start": Object { + "column": 4, + "line": 9, + }, + }, + "range": Array [ + 126, + 132, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 9, + }, + "start": Object { + "column": 11, + "line": 9, + }, + }, + "range": Array [ + 133, + 134, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 10, + }, + "start": Object { + "column": 2, + "line": 10, + }, + }, + "range": Array [ + 137, + 138, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 10, + }, + "start": Object { + "column": 3, + "line": 10, + }, + }, + "range": Array [ + 138, + 139, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 11, + }, + "start": Object { + "column": 2, + "line": 11, + }, + }, + "range": Array [ + 142, + 145, + ], + "type": "Identifier", + "value": "set", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 11, + }, + "start": Object { + "column": 6, + "line": 11, + }, + }, + "range": Array [ + 146, + 147, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 11, + }, + "start": Object { + "column": 7, + "line": 11, + }, + }, + "range": Array [ + 147, + 148, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 11, + }, + "start": Object { + "column": 8, + "line": 11, + }, + }, + "range": Array [ + 148, + 149, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 11, + }, + "start": Object { + "column": 9, + "line": 11, + }, + }, + "range": Array [ + 149, + 150, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 11, + }, + "start": Object { + "column": 11, + "line": 11, + }, + }, + "range": Array [ + 151, + 157, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 11, + }, + "start": Object { + "column": 17, + "line": 11, + }, + }, + "range": Array [ + 157, + 158, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 11, + }, + "start": Object { + "column": 18, + "line": 11, + }, + }, + "range": Array [ + 158, + 159, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 11, + }, + "start": Object { + "column": 20, + "line": 11, + }, + }, + "range": Array [ + 160, + 166, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 11, + }, + "start": Object { + "column": 27, + "line": 11, + }, + }, + "range": Array [ + 167, + 168, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 12, + }, + "start": Object { + "column": 2, + "line": 12, + }, + }, + "range": Array [ + 171, + 172, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 13, + }, + "start": Object { + "column": 0, + "line": 13, + }, + }, + "range": Array [ + 173, + 174, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 13, + }, + "start": Object { + "column": 1, + "line": 13, + }, + }, + "range": Array [ + 174, + 175, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/optional-chain.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "one", + "range": Array [ + 40, + 43, + ], + "type": "Identifier", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "name": "two", + "range": Array [ + 45, + 48, + ], + "type": "Identifier", + }, + "range": Array [ + 40, + 48, + ], + "type": "OptionalMemberExpression", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 40, + 49, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "name": "one", + "range": Array [ + 52, + 55, + ], + "type": "Identifier", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "name": "two", + "range": Array [ + 57, + 60, + ], + "type": "Identifier", + }, + "range": Array [ + 52, + 60, + ], + "type": "OptionalMemberExpression", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "name": "three", + "range": Array [ + 61, + 66, + ], + "type": "Identifier", + }, + "range": Array [ + 52, + 66, + ], + "type": "OptionalMemberExpression", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 52, + 67, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "name": "one", + "range": Array [ + 70, + 73, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 4, + }, + }, + "name": "two", + "range": Array [ + 74, + 77, + ], + "type": "Identifier", + }, + "range": Array [ + 70, + 77, + ], + "type": "MemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 11, + "line": 4, + }, + }, + "name": "three", + "range": Array [ + 79, + 84, + ], + "type": "Identifier", + }, + "range": Array [ + 70, + 84, + ], + "type": "OptionalMemberExpression", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 70, + 85, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 21, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "name": "one", + "range": Array [ + 88, + 91, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "name": "two", + "range": Array [ + 92, + 95, + ], + "type": "Identifier", + }, + "range": Array [ + 88, + 95, + ], + "type": "MemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "name": "three", + "range": Array [ + 97, + 102, + ], + "type": "Identifier", + }, + "range": Array [ + 88, + 102, + ], + "type": "OptionalMemberExpression", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "name": "four", + "range": Array [ + 103, + 107, + ], + "type": "Identifier", + }, + "range": Array [ + 88, + 107, + ], + "type": "OptionalMemberExpression", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 88, + 108, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 22, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 16, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 9, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "name": "one", + "range": Array [ + 111, + 114, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 6, + }, + "start": Object { + "column": 6, + "line": 6, + }, + }, + "name": "two", + "range": Array [ + 115, + 118, + ], + "type": "Identifier", + }, + "range": Array [ + 111, + 118, + ], + "type": "MemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 6, + }, + "start": Object { + "column": 11, + "line": 6, + }, + }, + "name": "three", + "range": Array [ + 120, + 125, + ], + "type": "Identifier", + }, + "range": Array [ + 111, + 125, + ], + "type": "OptionalMemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 6, + }, + "start": Object { + "column": 18, + "line": 6, + }, + }, + "name": "four", + "range": Array [ + 127, + 131, + ], + "type": "Identifier", + }, + "range": Array [ + 111, + 131, + ], + "type": "OptionalMemberExpression", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 111, + 132, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 134, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "processOptional", + "range": Array [ + 9, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "one", + "optional": true, + "range": Array [ + 25, + 34, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 34, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 34, + ], + "type": "TSAnyKeyword", + }, + }, + }, + ], + "range": Array [ + 0, + 134, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 135, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 24, + ], + "type": "Identifier", + "value": "processOptional", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + "value": "one", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 34, + ], + "type": "Identifier", + "value": "any", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 40, + 43, + ], + "type": "Identifier", + "value": "one", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 43, + 45, + ], + "type": "Punctuator", + "value": "?.", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 45, + 48, + ], + "type": "Identifier", + "value": "two", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 52, + 55, + ], + "type": "Identifier", + "value": "one", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 55, + 57, + ], + "type": "Punctuator", + "value": "?.", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 57, + 60, + ], + "type": "Identifier", + "value": "two", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 60, + 61, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 61, + 66, + ], + "type": "Identifier", + "value": "three", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 66, + 67, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 70, + 73, + ], + "type": "Identifier", + "value": "one", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 4, + }, + "start": Object { + "column": 5, + "line": 4, + }, + }, + "range": Array [ + 73, + 74, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 4, + }, + }, + "range": Array [ + 74, + 77, + ], + "type": "Identifier", + "value": "two", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "range": Array [ + 77, + 79, + ], + "type": "Punctuator", + "value": "?.", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 11, + "line": 4, + }, + }, + "range": Array [ + 79, + 84, + ], + "type": "Identifier", + "value": "three", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "range": Array [ + 84, + 85, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 88, + 91, + ], + "type": "Identifier", + "value": "one", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 5, + }, + "start": Object { + "column": 5, + "line": 5, + }, + }, + "range": Array [ + 91, + 92, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "range": Array [ + 92, + 95, + ], + "type": "Identifier", + "value": "two", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "range": Array [ + 95, + 97, + ], + "type": "Punctuator", + "value": "?.", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 97, + 102, + ], + "type": "Identifier", + "value": "three", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 5, + }, + }, + "range": Array [ + 102, + 103, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "range": Array [ + 103, + 107, + ], + "type": "Identifier", + "value": "four", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 5, + }, + "start": Object { + "column": 21, + "line": 5, + }, + }, + "range": Array [ + 107, + 108, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 111, + 114, + ], + "type": "Identifier", + "value": "one", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "start": Object { + "column": 5, + "line": 6, + }, + }, + "range": Array [ + 114, + 115, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 6, + }, + "start": Object { + "column": 6, + "line": 6, + }, + }, + "range": Array [ + 115, + 118, + ], + "type": "Identifier", + "value": "two", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 6, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "range": Array [ + 118, + 120, + ], + "type": "Punctuator", + "value": "?.", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 6, + }, + "start": Object { + "column": 11, + "line": 6, + }, + }, + "range": Array [ + 120, + 125, + ], + "type": "Identifier", + "value": "three", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 6, + }, + "start": Object { + "column": 16, + "line": 6, + }, + }, + "range": Array [ + 125, + 127, + ], + "type": "Punctuator", + "value": "?.", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 6, + }, + "start": Object { + "column": 18, + "line": 6, + }, + }, + "range": Array [ + 127, + 131, + ], + "type": "Identifier", + "value": "four", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 6, + }, + "start": Object { + "column": 22, + "line": 6, + }, + }, + "range": Array [ + 131, + 132, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "range": Array [ + 133, + 134, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/optional-chain-call.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "one", + "range": Array [ + 44, + 47, + ], + "type": "Identifier", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "name": "fn", + "range": Array [ + 49, + 51, + ], + "type": "Identifier", + }, + "range": Array [ + 44, + 51, + ], + "type": "OptionalMemberExpression", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "optional": false, + "range": Array [ + 44, + 53, + ], + "type": "OptionalCallExpression", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 44, + 54, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "name": "one", + "range": Array [ + 57, + 60, + ], + "type": "Identifier", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "name": "two", + "range": Array [ + 62, + 65, + ], + "type": "Identifier", + }, + "range": Array [ + 57, + 65, + ], + "type": "OptionalMemberExpression", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "name": "fn", + "range": Array [ + 66, + 68, + ], + "type": "Identifier", + }, + "range": Array [ + 57, + 68, + ], + "type": "OptionalMemberExpression", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "optional": false, + "range": Array [ + 57, + 70, + ], + "type": "OptionalCallExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 57, + 71, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "name": "one", + "range": Array [ + 74, + 77, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 4, + }, + }, + "name": "two", + "range": Array [ + 78, + 81, + ], + "type": "Identifier", + }, + "range": Array [ + 74, + 81, + ], + "type": "MemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 11, + "line": 4, + }, + }, + "name": "fn", + "range": Array [ + 83, + 85, + ], + "type": "Identifier", + }, + "range": Array [ + 74, + 85, + ], + "type": "OptionalMemberExpression", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "optional": false, + "range": Array [ + 74, + 87, + ], + "type": "OptionalCallExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 74, + 88, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "name": "one", + "range": Array [ + 91, + 94, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "name": "two", + "range": Array [ + 95, + 98, + ], + "type": "Identifier", + }, + "range": Array [ + 91, + 98, + ], + "type": "MemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "name": "three", + "range": Array [ + 100, + 105, + ], + "type": "Identifier", + }, + "range": Array [ + 91, + 105, + ], + "type": "OptionalMemberExpression", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "name": "fn", + "range": Array [ + 106, + 108, + ], + "type": "Identifier", + }, + "range": Array [ + 91, + 108, + ], + "type": "OptionalMemberExpression", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "optional": false, + "range": Array [ + 91, + 110, + ], + "type": "OptionalCallExpression", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 91, + 111, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 20, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 16, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 9, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "name": "one", + "range": Array [ + 114, + 117, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 6, + }, + "start": Object { + "column": 6, + "line": 6, + }, + }, + "name": "two", + "range": Array [ + 118, + 121, + ], + "type": "Identifier", + }, + "range": Array [ + 114, + 121, + ], + "type": "MemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 6, + }, + "start": Object { + "column": 11, + "line": 6, + }, + }, + "name": "three", + "range": Array [ + 123, + 128, + ], + "type": "Identifier", + }, + "range": Array [ + 114, + 128, + ], + "type": "OptionalMemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 6, + }, + "start": Object { + "column": 18, + "line": 6, + }, + }, + "name": "fn", + "range": Array [ + 130, + 132, + ], + "type": "Identifier", + }, + "range": Array [ + 114, + 132, + ], + "type": "OptionalMemberExpression", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "optional": false, + "range": Array [ + 114, + 134, + ], + "type": "OptionalCallExpression", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 114, + 135, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 8, + }, + "start": Object { + "column": 2, + "line": 8, + }, + }, + "name": "one", + "range": Array [ + 139, + 142, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 8, + }, + "start": Object { + "column": 2, + "line": 8, + }, + }, + "optional": true, + "range": Array [ + 139, + 146, + ], + "type": "OptionalCallExpression", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 2, + "line": 8, + }, + }, + "range": Array [ + 139, + 147, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 9, + }, + "start": Object { + "column": 2, + "line": 9, + }, + }, + "name": "one", + "range": Array [ + 150, + 153, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 9, + }, + "start": Object { + "column": 2, + "line": 9, + }, + }, + "optional": true, + "range": Array [ + 150, + 157, + ], + "type": "OptionalCallExpression", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 9, + }, + "start": Object { + "column": 2, + "line": 9, + }, + }, + "optional": false, + "range": Array [ + 150, + 159, + ], + "type": "OptionalCallExpression", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 9, + }, + "start": Object { + "column": 2, + "line": 9, + }, + }, + "range": Array [ + 150, + 160, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 10, + }, + "start": Object { + "column": 2, + "line": 10, + }, + }, + "name": "one", + "range": Array [ + 163, + 166, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 10, + }, + "start": Object { + "column": 2, + "line": 10, + }, + }, + "optional": true, + "range": Array [ + 163, + 170, + ], + "type": "OptionalCallExpression", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 10, + }, + "start": Object { + "column": 2, + "line": 10, + }, + }, + "optional": true, + "range": Array [ + 163, + 174, + ], + "type": "OptionalCallExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 10, + }, + "start": Object { + "column": 2, + "line": 10, + }, + }, + "range": Array [ + 163, + 175, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 13, + "line": 12, + }, + "start": Object { + "column": 2, + "line": 12, + }, + }, + "object": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 12, + }, + "start": Object { + "column": 2, + "line": 12, + }, + }, + "name": "one", + "range": Array [ + 179, + 182, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 12, + }, + "start": Object { + "column": 2, + "line": 12, + }, + }, + "optional": true, + "range": Array [ + 179, + 186, + ], + "type": "OptionalCallExpression", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 12, + }, + "start": Object { + "column": 10, + "line": 12, + }, + }, + "name": "two", + "range": Array [ + 187, + 190, + ], + "type": "Identifier", + }, + "range": Array [ + 179, + 190, + ], + "type": "OptionalMemberExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 12, + }, + "start": Object { + "column": 2, + "line": 12, + }, + }, + "range": Array [ + 179, + 191, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 13, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 193, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "processOptionalCall", + "range": Array [ + 9, + 28, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 13, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "one", + "optional": true, + "range": Array [ + 29, + 38, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 38, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 38, + ], + "type": "TSAnyKeyword", + }, + }, + }, + ], + "range": Array [ + 0, + 193, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 14, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 194, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 28, + ], + "type": "Identifier", + "value": "processOptionalCall", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 32, + ], + "type": "Identifier", + "value": "one", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 38, + ], + "type": "Identifier", + "value": "any", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 44, + 47, + ], + "type": "Identifier", + "value": "one", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 47, + 49, + ], + "type": "Punctuator", + "value": "?.", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 49, + 51, + ], + "type": "Identifier", + "value": "fn", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 57, + 60, + ], + "type": "Identifier", + "value": "one", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 60, + 62, + ], + "type": "Punctuator", + "value": "?.", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 62, + 65, + ], + "type": "Identifier", + "value": "two", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 65, + 66, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 66, + 68, + ], + "type": "Identifier", + "value": "fn", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 69, + 70, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 70, + 71, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 74, + 77, + ], + "type": "Identifier", + "value": "one", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 4, + }, + "start": Object { + "column": 5, + "line": 4, + }, + }, + "range": Array [ + 77, + 78, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 4, + }, + }, + "range": Array [ + 78, + 81, + ], + "type": "Identifier", + "value": "two", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "range": Array [ + 81, + 83, + ], + "type": "Punctuator", + "value": "?.", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 11, + "line": 4, + }, + }, + "range": Array [ + 83, + 85, + ], + "type": "Identifier", + "value": "fn", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 4, + }, + }, + "range": Array [ + 85, + 86, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "range": Array [ + 86, + 87, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 4, + }, + }, + "range": Array [ + 87, + 88, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 91, + 94, + ], + "type": "Identifier", + "value": "one", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 5, + }, + "start": Object { + "column": 5, + "line": 5, + }, + }, + "range": Array [ + 94, + 95, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "range": Array [ + 95, + 98, + ], + "type": "Identifier", + "value": "two", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "range": Array [ + 98, + 100, + ], + "type": "Punctuator", + "value": "?.", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 100, + 105, + ], + "type": "Identifier", + "value": "three", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 5, + }, + }, + "range": Array [ + 105, + 106, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "range": Array [ + 106, + 108, + ], + "type": "Identifier", + "value": "fn", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 5, + }, + "start": Object { + "column": 19, + "line": 5, + }, + }, + "range": Array [ + 108, + 109, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 5, + }, + "start": Object { + "column": 20, + "line": 5, + }, + }, + "range": Array [ + 109, + 110, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 5, + }, + "start": Object { + "column": 21, + "line": 5, + }, + }, + "range": Array [ + 110, + 111, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 114, + 117, + ], + "type": "Identifier", + "value": "one", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "start": Object { + "column": 5, + "line": 6, + }, + }, + "range": Array [ + 117, + 118, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 6, + }, + "start": Object { + "column": 6, + "line": 6, + }, + }, + "range": Array [ + 118, + 121, + ], + "type": "Identifier", + "value": "two", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 6, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "range": Array [ + 121, + 123, + ], + "type": "Punctuator", + "value": "?.", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 6, + }, + "start": Object { + "column": 11, + "line": 6, + }, + }, + "range": Array [ + 123, + 128, + ], + "type": "Identifier", + "value": "three", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 6, + }, + "start": Object { + "column": 16, + "line": 6, + }, + }, + "range": Array [ + 128, + 130, + ], + "type": "Punctuator", + "value": "?.", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 6, + }, + "start": Object { + "column": 18, + "line": 6, + }, + }, + "range": Array [ + 130, + 132, + ], + "type": "Identifier", + "value": "fn", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 6, + }, + "start": Object { + "column": 20, + "line": 6, + }, + }, + "range": Array [ + 132, + 133, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 6, + }, + "start": Object { + "column": 21, + "line": 6, + }, + }, + "range": Array [ + 133, + 134, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 6, + }, + "start": Object { + "column": 22, + "line": 6, + }, + }, + "range": Array [ + 134, + 135, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 8, + }, + "start": Object { + "column": 2, + "line": 8, + }, + }, + "range": Array [ + 139, + 142, + ], + "type": "Identifier", + "value": "one", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 8, + }, + "start": Object { + "column": 5, + "line": 8, + }, + }, + "range": Array [ + 142, + 144, + ], + "type": "Punctuator", + "value": "?.", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 8, + }, + "start": Object { + "column": 7, + "line": 8, + }, + }, + "range": Array [ + 144, + 145, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 8, + }, + "start": Object { + "column": 8, + "line": 8, + }, + }, + "range": Array [ + 145, + 146, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 9, + "line": 8, + }, + }, + "range": Array [ + 146, + 147, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 9, + }, + "start": Object { + "column": 2, + "line": 9, + }, + }, + "range": Array [ + 150, + 153, + ], + "type": "Identifier", + "value": "one", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 9, + }, + "start": Object { + "column": 5, + "line": 9, + }, + }, + "range": Array [ + 153, + 155, + ], + "type": "Punctuator", + "value": "?.", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 9, + }, + "start": Object { + "column": 7, + "line": 9, + }, + }, + "range": Array [ + 155, + 156, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 9, + }, + "start": Object { + "column": 8, + "line": 9, + }, + }, + "range": Array [ + 156, + 157, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 9, + }, + "start": Object { + "column": 9, + "line": 9, + }, + }, + "range": Array [ + 157, + 158, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 9, + }, + "start": Object { + "column": 10, + "line": 9, + }, + }, + "range": Array [ + 158, + 159, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 9, + }, + "start": Object { + "column": 11, + "line": 9, + }, + }, + "range": Array [ + 159, + 160, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 10, + }, + "start": Object { + "column": 2, + "line": 10, + }, + }, + "range": Array [ + 163, + 166, + ], + "type": "Identifier", + "value": "one", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 10, + }, + "start": Object { + "column": 5, + "line": 10, + }, + }, + "range": Array [ + 166, + 168, + ], + "type": "Punctuator", + "value": "?.", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 10, + }, + "start": Object { + "column": 7, + "line": 10, + }, + }, + "range": Array [ + 168, + 169, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 10, + }, + "start": Object { + "column": 8, + "line": 10, + }, + }, + "range": Array [ + 169, + 170, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 10, + }, + "start": Object { + "column": 9, + "line": 10, + }, + }, + "range": Array [ + 170, + 172, + ], + "type": "Punctuator", + "value": "?.", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 10, + }, + "start": Object { + "column": 11, + "line": 10, + }, + }, + "range": Array [ + 172, + 173, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 10, + }, + "start": Object { + "column": 12, + "line": 10, + }, + }, + "range": Array [ + 173, + 174, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 10, + }, + "start": Object { + "column": 13, + "line": 10, + }, + }, + "range": Array [ + 174, + 175, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 12, + }, + "start": Object { + "column": 2, + "line": 12, + }, + }, + "range": Array [ + 179, + 182, + ], + "type": "Identifier", + "value": "one", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 12, + }, + "start": Object { + "column": 5, + "line": 12, + }, + }, + "range": Array [ + 182, + 184, + ], + "type": "Punctuator", + "value": "?.", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 12, + }, + "start": Object { + "column": 7, + "line": 12, + }, + }, + "range": Array [ + 184, + 185, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 12, + }, + "start": Object { + "column": 8, + "line": 12, + }, + }, + "range": Array [ + 185, + 186, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 12, + }, + "start": Object { + "column": 9, + "line": 12, + }, + }, + "range": Array [ + 186, + 187, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 12, + }, + "start": Object { + "column": 10, + "line": 12, + }, + }, + "range": Array [ + 187, + 190, + ], + "type": "Identifier", + "value": "two", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 12, + }, + "start": Object { + "column": 13, + "line": 12, + }, + }, + "range": Array [ + 190, + 191, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 13, + }, + "start": Object { + "column": 0, + "line": 13, + }, + }, + "range": Array [ + 192, + 193, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/optional-chain-call-with-parens.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "name": "one", + "range": Array [ + 51, + 54, + ], + "type": "Identifier", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "name": "fn", + "range": Array [ + 56, + 58, + ], + "type": "Identifier", + }, + "range": Array [ + 51, + 58, + ], + "type": "OptionalMemberExpression", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "optional": false, + "range": Array [ + 51, + 60, + ], + "type": "OptionalCallExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 50, + 62, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 3, + "line": 3, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 3, + "line": 3, + }, + }, + "name": "one", + "range": Array [ + 66, + 69, + ], + "type": "Identifier", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "name": "two", + "range": Array [ + 71, + 74, + ], + "type": "Identifier", + }, + "range": Array [ + 66, + 74, + ], + "type": "OptionalMemberExpression", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "name": "fn", + "range": Array [ + 76, + 78, + ], + "type": "Identifier", + }, + "range": Array [ + 65, + 78, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "optional": false, + "range": Array [ + 65, + 80, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 65, + 81, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 3, + "line": 4, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 3, + "line": 4, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 4, + }, + "start": Object { + "column": 3, + "line": 4, + }, + }, + "name": "one", + "range": Array [ + 85, + 88, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 7, + "line": 4, + }, + }, + "name": "two", + "range": Array [ + 89, + 92, + ], + "type": "Identifier", + }, + "range": Array [ + 85, + 92, + ], + "type": "MemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "name": "fn", + "range": Array [ + 94, + 96, + ], + "type": "Identifier", + }, + "range": Array [ + 85, + 96, + ], + "type": "OptionalMemberExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 3, + "line": 4, + }, + }, + "optional": false, + "range": Array [ + 85, + 98, + ], + "type": "OptionalCallExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 84, + 100, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 21, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "name": "one", + "range": Array [ + 104, + 107, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 7, + "line": 5, + }, + }, + "name": "two", + "range": Array [ + 108, + 111, + ], + "type": "Identifier", + }, + "range": Array [ + 104, + 111, + ], + "type": "MemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "name": "three", + "range": Array [ + 113, + 118, + ], + "type": "Identifier", + }, + "range": Array [ + 104, + 118, + ], + "type": "OptionalMemberExpression", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 5, + }, + "start": Object { + "column": 19, + "line": 5, + }, + }, + "name": "fn", + "range": Array [ + 120, + 122, + ], + "type": "Identifier", + }, + "range": Array [ + 103, + 122, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "optional": false, + "range": Array [ + 103, + 124, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 103, + 125, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 21, + "line": 6, + }, + "start": Object { + "column": 3, + "line": 6, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 17, + "line": 6, + }, + "start": Object { + "column": 3, + "line": 6, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 10, + "line": 6, + }, + "start": Object { + "column": 3, + "line": 6, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "start": Object { + "column": 3, + "line": 6, + }, + }, + "name": "one", + "range": Array [ + 129, + 132, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 6, + }, + "start": Object { + "column": 7, + "line": 6, + }, + }, + "name": "two", + "range": Array [ + 133, + 136, + ], + "type": "Identifier", + }, + "range": Array [ + 129, + 136, + ], + "type": "MemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 6, + }, + "start": Object { + "column": 12, + "line": 6, + }, + }, + "name": "three", + "range": Array [ + 138, + 143, + ], + "type": "Identifier", + }, + "range": Array [ + 129, + 143, + ], + "type": "OptionalMemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 6, + }, + "start": Object { + "column": 19, + "line": 6, + }, + }, + "name": "fn", + "range": Array [ + 145, + 147, + ], + "type": "Identifier", + }, + "range": Array [ + 129, + 147, + ], + "type": "OptionalMemberExpression", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 6, + }, + "start": Object { + "column": 3, + "line": 6, + }, + }, + "optional": false, + "range": Array [ + 129, + 149, + ], + "type": "OptionalCallExpression", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 128, + 151, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 8, + }, + "start": Object { + "column": 3, + "line": 8, + }, + }, + "name": "one", + "range": Array [ + 156, + 159, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 3, + "line": 8, + }, + }, + "optional": true, + "range": Array [ + 156, + 163, + ], + "type": "OptionalCallExpression", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 8, + }, + "start": Object { + "column": 2, + "line": 8, + }, + }, + "range": Array [ + 155, + 165, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 9, + }, + "start": Object { + "column": 3, + "line": 9, + }, + }, + "name": "one", + "range": Array [ + 169, + 172, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 9, + }, + "start": Object { + "column": 3, + "line": 9, + }, + }, + "optional": true, + "range": Array [ + 169, + 176, + ], + "type": "OptionalCallExpression", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 9, + }, + "start": Object { + "column": 2, + "line": 9, + }, + }, + "optional": false, + "range": Array [ + 168, + 179, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 9, + }, + "start": Object { + "column": 2, + "line": 9, + }, + }, + "range": Array [ + 168, + 180, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 10, + }, + "start": Object { + "column": 3, + "line": 10, + }, + }, + "name": "one", + "range": Array [ + 184, + 187, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 10, + }, + "start": Object { + "column": 3, + "line": 10, + }, + }, + "optional": true, + "range": Array [ + 184, + 191, + ], + "type": "OptionalCallExpression", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 10, + }, + "start": Object { + "column": 2, + "line": 10, + }, + }, + "optional": true, + "range": Array [ + 183, + 196, + ], + "type": "OptionalCallExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 10, + }, + "start": Object { + "column": 2, + "line": 10, + }, + }, + "range": Array [ + 183, + 197, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 15, + "line": 12, + }, + "start": Object { + "column": 2, + "line": 12, + }, + }, + "object": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 12, + }, + "start": Object { + "column": 3, + "line": 12, + }, + }, + "name": "one", + "range": Array [ + 202, + 205, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 12, + }, + "start": Object { + "column": 3, + "line": 12, + }, + }, + "optional": true, + "range": Array [ + 202, + 209, + ], + "type": "OptionalCallExpression", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 12, + }, + "start": Object { + "column": 12, + "line": 12, + }, + }, + "name": "two", + "range": Array [ + 211, + 214, + ], + "type": "Identifier", + }, + "range": Array [ + 201, + 214, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 12, + }, + "start": Object { + "column": 2, + "line": 12, + }, + }, + "range": Array [ + 201, + 215, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 13, + }, + "start": Object { + "column": 46, + "line": 1, + }, + }, + "range": Array [ + 46, + 217, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, }, + "name": "processOptionalCallParens", + "range": Array [ + 9, + 34, + ], + "type": "Identifier", }, - "range": Array [ - 199, - 200, - ], - "type": "Punctuator", - "value": ",", - }, - Object { "loc": Object { "end": Object { - "column": 15, - "line": 10, + "column": 1, + "line": 13, }, "start": Object { - "column": 14, - "line": 10, + "column": 0, + "line": 1, }, }, - "range": Array [ - 201, - 202, - ], - "type": "Identifier", - "value": "b", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 10, - }, - "start": Object { - "column": 15, - "line": 10, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "name": "one", + "optional": true, + "range": Array [ + 35, + 44, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 44, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 44, + ], + "type": "TSAnyKeyword", + }, + }, }, - }, - "range": Array [ - 202, - 203, ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 10, - }, - "start": Object { - "column": 17, - "line": 10, - }, - }, "range": Array [ - 204, - 205, + 0, + 217, ], - "type": "Identifier", - "value": "c", + "type": "FunctionDeclaration", }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 10, - }, - "start": Object { - "column": 18, - "line": 10, - }, - }, - "range": Array [ - 205, - 206, - ], - "type": "Punctuator", - "value": ")", + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 14, }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 10, - }, - "start": Object { - "column": 19, - "line": 10, - }, - }, - "range": Array [ - 206, - 207, - ], - "type": "Punctuator", - "value": ":", + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 218, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 25, - "line": 10, + "column": 8, + "line": 1, }, "start": Object { - "column": 21, - "line": 10, + "column": 0, + "line": 1, }, }, "range": Array [ - 208, - 212, + 0, + 8, ], "type": "Keyword", - "value": "void", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 10, - }, - "start": Object { - "column": 25, - "line": 10, - }, - }, - "range": Array [ - 212, - 213, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 11, - }, - "start": Object { - "column": 4, - "line": 11, - }, - }, - "range": Array [ - 218, - 221, - ], - "type": "Identifier", - "value": "boo", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 11, + "column": 34, + "line": 1, }, "start": Object { - "column": 7, - "line": 11, - }, - }, - "range": Array [ - 221, - 222, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { "column": 9, - "line": 11, - }, - "start": Object { - "column": 8, - "line": 11, + "line": 1, }, }, "range": Array [ - 222, - 223, + 9, + 34, ], "type": "Identifier", - "value": "J", + "value": "processOptionalCallParens", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 11, - }, - "start": Object { - "column": 9, - "line": 11, - }, - }, - "range": Array [ - 223, - 224, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 11, + "column": 35, + "line": 1, }, "start": Object { - "column": 10, - "line": 11, + "column": 34, + "line": 1, }, }, "range": Array [ - 224, - 225, + 34, + 35, ], "type": "Punctuator", "value": "(", @@ -56144,107 +76616,89 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, - "line": 11, + "column": 38, + "line": 1, }, "start": Object { - "column": 11, - "line": 11, + "column": 35, + "line": 1, }, }, "range": Array [ - 225, - 226, + 35, + 38, ], "type": "Identifier", - "value": "a", + "value": "one", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 11, + "column": 39, + "line": 1, }, "start": Object { - "column": 12, - "line": 11, + "column": 38, + "line": 1, }, }, "range": Array [ - 226, - 227, + 38, + 39, ], "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 11, - }, - "start": Object { - "column": 14, - "line": 11, - }, - }, - "range": Array [ - 228, - 229, - ], - "type": "Identifier", - "value": "b", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 11, + "column": 40, + "line": 1, }, "start": Object { - "column": 15, - "line": 11, + "column": 39, + "line": 1, }, }, "range": Array [ - 229, - 230, + 39, + 40, ], "type": "Punctuator", - "value": ",", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 11, + "column": 44, + "line": 1, }, "start": Object { - "column": 17, - "line": 11, + "column": 41, + "line": 1, }, }, "range": Array [ - 231, - 232, + 41, + 44, ], "type": "Identifier", - "value": "c", + "value": "any", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 11, + "column": 45, + "line": 1, }, "start": Object { - "column": 18, - "line": 11, + "column": 44, + "line": 1, }, }, "range": Array [ - 232, - 233, + 44, + 45, ], "type": "Punctuator", "value": ")", @@ -56252,89 +76706,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, - "line": 11, - }, - "start": Object { - "column": 19, - "line": 11, - }, - }, - "range": Array [ - 233, - 234, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 11, - }, - "start": Object { - "column": 21, - "line": 11, - }, - }, - "range": Array [ - 235, - 239, - ], - "type": "Keyword", - "value": "void", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 11, + "column": 47, + "line": 1, }, "start": Object { - "column": 25, - "line": 11, + "column": 46, + "line": 1, }, }, "range": Array [ - 239, - 240, + 46, + 47, ], "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 12, - }, - "start": Object { - "column": 4, - "line": 12, - }, - }, - "range": Array [ - 245, - 248, - ], - "type": "Keyword", - "value": "new", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 12, + "column": 3, + "line": 2, }, "start": Object { - "column": 8, - "line": 12, + "column": 2, + "line": 2, }, }, "range": Array [ - 249, - 250, + 50, + 51, ], "type": "Punctuator", "value": "(", @@ -56342,2811 +76742,1403 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, - "line": 12, - }, - "start": Object { - "column": 9, - "line": 12, - }, - }, - "range": Array [ - 250, - 251, - ], - "type": "Identifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 12, - }, - "start": Object { - "column": 10, - "line": 12, - }, - }, - "range": Array [ - 251, - 252, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 12, - }, - "start": Object { - "column": 12, - "line": 12, - }, - }, - "range": Array [ - 253, - 254, - ], - "type": "Identifier", - "value": "b", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 12, - }, - "start": Object { - "column": 13, - "line": 12, - }, - }, - "range": Array [ - 254, - 255, - ], - "type": "Punctuator", - "value": "?", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 12, - }, - "start": Object { - "column": 14, - "line": 12, - }, - }, - "range": Array [ - 255, - 256, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 12, - }, - "start": Object { - "column": 15, - "line": 12, - }, - }, - "range": Array [ - 256, - 257, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 12, + "column": 6, + "line": 2, }, "start": Object { - "column": 17, - "line": 12, + "column": 3, + "line": 2, }, }, "range": Array [ - 258, - 264, + 51, + 54, ], "type": "Identifier", - "value": "string", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 12, - }, - "start": Object { - "column": 23, - "line": 12, - }, - }, - "range": Array [ - 264, - 265, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 13, - }, - "start": Object { - "column": 4, - "line": 13, - }, - }, - "range": Array [ - 270, - 273, - ], - "type": "Keyword", - "value": "new", + "value": "one", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 13, + "column": 8, + "line": 2, }, "start": Object { - "column": 8, - "line": 13, + "column": 6, + "line": 2, }, }, "range": Array [ - 274, - 275, + 54, + 56, ], "type": "Punctuator", - "value": "<", + "value": "?.", }, Object { "loc": Object { "end": Object { "column": 10, - "line": 13, + "line": 2, }, "start": Object { - "column": 9, - "line": 13, + "column": 8, + "line": 2, }, }, "range": Array [ - 275, - 276, + 56, + 58, ], "type": "Identifier", - "value": "F", + "value": "fn", }, Object { "loc": Object { "end": Object { "column": 11, - "line": 13, + "line": 2, }, "start": Object { "column": 10, - "line": 13, - }, - }, - "range": Array [ - 276, - 277, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 13, - }, - "start": Object { - "column": 11, - "line": 13, + "line": 2, }, }, "range": Array [ - 277, - 278, + 58, + 59, ], "type": "Punctuator", "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 13, - }, - "start": Object { - "column": 12, - "line": 13, - }, - }, - "range": Array [ - 278, - 279, - ], - "type": "Identifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 13, - }, - "start": Object { - "column": 13, - "line": 13, - }, - }, - "range": Array [ - 279, - 280, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 13, - }, - "start": Object { - "column": 15, - "line": 13, - }, - }, - "range": Array [ - 281, - 282, - ], - "type": "Identifier", - "value": "b", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 13, - }, - "start": Object { - "column": 16, - "line": 13, - }, - }, - "range": Array [ - 282, - 283, - ], - "type": "Punctuator", - "value": "?", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 13, - }, - "start": Object { - "column": 17, - "line": 13, - }, - }, - "range": Array [ - 283, - 284, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 13, - }, - "start": Object { - "column": 18, - "line": 13, - }, - }, - "range": Array [ - 284, - 285, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 13, - }, - "start": Object { - "column": 20, - "line": 13, - }, - }, - "range": Array [ - 286, - 292, - ], - "type": "Identifier", - "value": "string", - }, - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 13, - }, - "start": Object { - "column": 26, - "line": 13, - }, - }, - "range": Array [ - 292, - 293, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 14, - }, - "start": Object { - "column": 0, - "line": 14, - }, - }, - "range": Array [ - 294, - 295, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/interface-with-construct-signature-with-parameter-accessibility.src 1`] = ` -Object { - "body": Array [ - Object { - "body": Object { - "body": Array [ - Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "params": Array [ - Object { - "accessibility": "public", - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "parameter": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "name": "x", - "range": Array [ - 33, - 34, - ], - "type": "Identifier", - }, - "range": Array [ - 26, - 34, - ], - "type": "TSParameterProperty", - }, - Object { - "accessibility": "private", - "loc": Object { - "end": Object { - "column": 28, - "line": 2, - }, - "start": Object { - "column": 19, - "line": 2, - }, - }, - "parameter": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 2, - }, - "start": Object { - "column": 27, - "line": 2, - }, - }, - "name": "y", - "range": Array [ - 44, - 45, - ], - "type": "Identifier", - }, - "range": Array [ - 36, - 45, - ], - "type": "TSParameterProperty", - }, - ], - "range": Array [ - 21, - 47, - ], - "type": "TSConstructSignatureDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 49, - ], - "type": "TSInterfaceBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "Test", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 49, - ], - "type": "TSInterfaceDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 50, - ], - "sourceType": "script", - "tokens": Array [ + }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 12, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 11, + "line": 2, }, }, "range": Array [ - 0, - 9, + 59, + 60, ], - "type": "Keyword", - "value": "interface", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 10, - "line": 1, + "column": 12, + "line": 2, }, }, "range": Array [ - 10, - 14, + 60, + 61, ], - "type": "Identifier", - "value": "Test", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { - "column": 15, - "line": 1, + "column": 13, + "line": 2, }, }, "range": Array [ - 15, - 16, + 61, + 62, ], "type": "Punctuator", - "value": "{", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 3, + "line": 3, }, "start": Object { - "column": 4, - "line": 2, + "column": 2, + "line": 3, }, }, "range": Array [ - 21, - 24, + 65, + 66, ], - "type": "Keyword", - "value": "new", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 6, + "line": 3, }, "start": Object { - "column": 8, - "line": 2, + "column": 3, + "line": 3, }, }, "range": Array [ - 25, - 26, + 66, + 69, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "one", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 8, + "line": 3, }, "start": Object { - "column": 9, - "line": 2, + "column": 6, + "line": 3, }, }, "range": Array [ - 26, - 32, + 69, + 71, ], - "type": "Keyword", - "value": "public", + "type": "Punctuator", + "value": "?.", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 11, + "line": 3, }, "start": Object { - "column": 16, - "line": 2, + "column": 8, + "line": 3, }, }, "range": Array [ - 33, - 34, + 71, + 74, ], "type": "Identifier", - "value": "x", + "value": "two", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 12, + "line": 3, }, "start": Object { - "column": 17, - "line": 2, + "column": 11, + "line": 3, }, }, "range": Array [ - 34, - 35, + 74, + 75, ], "type": "Punctuator", - "value": ",", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 2, + "column": 13, + "line": 3, }, "start": Object { - "column": 19, - "line": 2, + "column": 12, + "line": 3, }, }, "range": Array [ - 36, - 43, + 75, + 76, ], - "type": "Keyword", - "value": "private", + "type": "Punctuator", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 2, + "column": 15, + "line": 3, }, "start": Object { - "column": 27, - "line": 2, + "column": 13, + "line": 3, }, }, "range": Array [ - 44, - 45, + 76, + 78, ], "type": "Identifier", - "value": "y", + "value": "fn", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 2, + "column": 16, + "line": 3, }, "start": Object { - "column": 28, - "line": 2, + "column": 15, + "line": 3, }, }, "range": Array [ - 45, - 46, + 78, + 79, ], "type": "Punctuator", - "value": ")", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 2, + "column": 17, + "line": 3, }, "start": Object { - "column": 29, - "line": 2, + "column": 16, + "line": 3, }, }, "range": Array [ - 46, - 47, + 79, + 80, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 1, + "column": 18, "line": 3, }, "start": Object { - "column": 0, + "column": 17, "line": 3, }, }, "range": Array [ - 48, - 49, + 80, + 81, ], "type": "Punctuator", - "value": "}", + "value": ";", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/interface-with-extends-member-expression.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 2, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "range": Array [ - 30, - 33, - ], - "type": "TSInterfaceBody", - }, - "extends": Array [ - Object { - "expression": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "name": "baz", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - "range": Array [ - 22, - 29, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 29, - ], - "type": "TSInterfaceHeritage", + "loc": Object { + "end": Object { + "column": 3, + "line": 4, }, - ], - "id": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, + "start": Object { + "column": 2, + "line": 4, }, - "name": "foo", - "range": Array [ - 10, - 13, - ], - "type": "Identifier", }, + "range": Array [ + 84, + 85, + ], + "type": "Punctuator", + "value": "(", + }, + Object { "loc": Object { "end": Object { - "column": 1, - "line": 2, + "column": 6, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 3, + "line": 4, }, }, "range": Array [ - 0, - 33, + 85, + 88, ], - "type": "TSInterfaceDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "one", }, - }, - "range": Array [ - 0, - 34, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 7, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 6, + "line": 4, }, }, "range": Array [ - 0, - 9, + 88, + 89, ], - "type": "Keyword", - "value": "interface", + "type": "Punctuator", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 10, + "line": 4, }, "start": Object { - "column": 10, - "line": 1, + "column": 7, + "line": 4, }, }, "range": Array [ - 10, - 13, + 89, + 92, ], "type": "Identifier", - "value": "foo", + "value": "two", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 12, + "line": 4, }, "start": Object { - "column": 14, - "line": 1, + "column": 10, + "line": 4, }, }, "range": Array [ - 14, - 21, + 92, + 94, ], - "type": "Keyword", - "value": "extends", + "type": "Punctuator", + "value": "?.", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 14, + "line": 4, }, "start": Object { - "column": 22, - "line": 1, + "column": 12, + "line": 4, }, }, "range": Array [ - 22, - 25, + 94, + 96, ], "type": "Identifier", - "value": "bar", + "value": "fn", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 15, + "line": 4, }, "start": Object { - "column": 25, - "line": 1, + "column": 14, + "line": 4, }, }, "range": Array [ - 25, - 26, + 96, + 97, ], "type": "Punctuator", - "value": ".", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 16, + "line": 4, }, "start": Object { - "column": 26, - "line": 1, + "column": 15, + "line": 4, }, }, "range": Array [ - 26, - 29, + 97, + 98, ], - "type": "Identifier", - "value": "baz", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 17, + "line": 4, }, "start": Object { - "column": 30, - "line": 1, + "column": 16, + "line": 4, }, }, "range": Array [ - 30, - 31, + 98, + 99, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 2, + "column": 18, + "line": 4, }, "start": Object { - "column": 0, - "line": 2, + "column": 17, + "line": 4, }, }, "range": Array [ - 32, - 33, + 99, + 100, ], "type": "Punctuator", - "value": "}", + "value": ";", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/interface-with-extends-type-parameters.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 32, - "line": 1, - }, - }, - "range": Array [ - 32, - 36, - ], - "type": "TSInterfaceBody", - }, - "extends": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "name": "Bar", - "range": Array [ - 25, - 28, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 31, - ], - "type": "TSInterfaceHeritage", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 30, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "name": "J", - "range": Array [ - 29, - 30, - ], - "type": "Identifier", - }, - }, - ], - "range": Array [ - 28, - 31, - ], - "type": "TSTypeParameterInstantiation", - }, + "loc": Object { + "end": Object { + "column": 3, + "line": 5, }, - ], - "id": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, + "start": Object { + "column": 2, + "line": 5, }, - "name": "Foo", - "range": Array [ - 10, - 13, - ], - "type": "Identifier", }, + "range": Array [ + 103, + 104, + ], + "type": "Punctuator", + "value": "(", + }, + Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 6, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 3, + "line": 5, }, }, "range": Array [ - 0, - 36, + 104, + 107, ], - "type": "TSInterfaceDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "range": Array [ - 14, - 15, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 13, - 16, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "one", }, - }, - "range": Array [ - 0, - 37, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 7, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 6, + "line": 5, }, }, "range": Array [ - 0, - 9, + 107, + 108, ], - "type": "Keyword", - "value": "interface", + "type": "Punctuator", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 10, + "line": 5, }, "start": Object { - "column": 10, - "line": 1, + "column": 7, + "line": 5, }, }, "range": Array [ - 10, - 13, + 108, + 111, ], "type": "Identifier", - "value": "Foo", + "value": "two", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 12, + "line": 5, }, "start": Object { - "column": 13, - "line": 1, + "column": 10, + "line": 5, }, }, "range": Array [ - 13, - 14, + 111, + 113, ], "type": "Punctuator", - "value": "<", + "value": "?.", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 17, + "line": 5, }, "start": Object { - "column": 14, - "line": 1, + "column": 12, + "line": 5, }, }, "range": Array [ - 14, - 15, + 113, + 118, ], "type": "Identifier", - "value": "T", + "value": "three", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 18, + "line": 5, }, "start": Object { - "column": 15, - "line": 1, + "column": 17, + "line": 5, }, }, "range": Array [ - 15, - 16, + 118, + 119, ], "type": "Punctuator", - "value": ">", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 19, + "line": 5, }, "start": Object { - "column": 17, - "line": 1, + "column": 18, + "line": 5, }, }, "range": Array [ - 17, - 24, + 119, + 120, ], - "type": "Keyword", - "value": "extends", + "type": "Punctuator", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 21, + "line": 5, }, "start": Object { - "column": 25, - "line": 1, + "column": 19, + "line": 5, }, }, "range": Array [ - 25, - 28, + 120, + 122, ], "type": "Identifier", - "value": "Bar", + "value": "fn", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 22, + "line": 5, }, "start": Object { - "column": 28, - "line": 1, + "column": 21, + "line": 5, }, }, "range": Array [ - 28, - 29, + 122, + 123, ], "type": "Punctuator", - "value": "<", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 23, + "line": 5, }, "start": Object { - "column": 29, - "line": 1, + "column": 22, + "line": 5, }, }, "range": Array [ - 29, - 30, + 123, + 124, ], - "type": "Identifier", - "value": "J", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 24, + "line": 5, }, "start": Object { - "column": 30, - "line": 1, + "column": 23, + "line": 5, }, }, "range": Array [ - 30, - 31, + 124, + 125, ], "type": "Punctuator", - "value": ">", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 1, + "column": 3, + "line": 6, }, "start": Object { - "column": 32, - "line": 1, + "column": 2, + "line": 6, }, }, "range": Array [ - 32, - 33, + 128, + 129, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 6, + "line": 6, }, "start": Object { - "column": 0, - "line": 3, + "column": 3, + "line": 6, }, }, "range": Array [ - 35, - 36, + 129, + 132, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "one", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/interface-with-generic.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 7, + "line": 6, }, - "range": Array [ - 18, - 21, - ], - "type": "TSInterfaceBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, + "start": Object { + "column": 6, + "line": 6, }, - "name": "Test", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", }, + "range": Array [ + 132, + 133, + ], + "type": "Punctuator", + "value": ".", + }, + Object { "loc": Object { "end": Object { - "column": 1, - "line": 2, + "column": 10, + "line": 6, }, "start": Object { - "column": 0, - "line": 1, + "column": 7, + "line": 6, }, }, "range": Array [ - 0, - 21, + 133, + 136, ], - "type": "TSInterfaceDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "range": Array [ - 15, - 16, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 14, - 17, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "two", }, - }, - "range": Array [ - 0, - 22, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 12, + "line": 6, }, "start": Object { - "column": 0, - "line": 1, + "column": 10, + "line": 6, }, }, "range": Array [ - 0, - 9, + 136, + 138, ], - "type": "Keyword", - "value": "interface", + "type": "Punctuator", + "value": "?.", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 17, + "line": 6, }, "start": Object { - "column": 10, - "line": 1, + "column": 12, + "line": 6, }, }, "range": Array [ - 10, - 14, + 138, + 143, ], "type": "Identifier", - "value": "Test", + "value": "three", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 19, + "line": 6, }, "start": Object { - "column": 14, - "line": 1, + "column": 17, + "line": 6, }, }, "range": Array [ - 14, - 15, + 143, + 145, ], "type": "Punctuator", - "value": "<", + "value": "?.", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 21, + "line": 6, }, "start": Object { - "column": 15, - "line": 1, + "column": 19, + "line": 6, }, }, "range": Array [ - 15, - 16, + 145, + 147, ], "type": "Identifier", - "value": "T", + "value": "fn", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 22, + "line": 6, }, "start": Object { - "column": 16, - "line": 1, + "column": 21, + "line": 6, }, }, "range": Array [ - 16, - 17, + 147, + 148, ], "type": "Punctuator", - "value": ">", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 23, + "line": 6, }, "start": Object { - "column": 18, - "line": 1, + "column": 22, + "line": 6, }, }, "range": Array [ - 18, - 19, + 148, + 149, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 2, + "column": 24, + "line": 6, }, "start": Object { - "column": 0, - "line": 2, + "column": 23, + "line": 6, }, }, "range": Array [ - 20, - 21, + 149, + 150, ], "type": "Punctuator", - "value": "}", + "value": ")", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/interface-with-jsdoc.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "name": "foo", - "range": Array [ - 76, - 79, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 6, - }, - "start": Object { - "column": 8, - "line": 6, - }, - }, - "name": "bar", - "range": Array [ - 80, - 83, - ], - "type": "Identifier", - }, - ], - "range": Array [ - 76, - 85, - ], - "type": "TSMethodSignature", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 7, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 87, - ], - "type": "TSInterfaceBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "Test", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 1, - "line": 7, + "column": 25, + "line": 6, }, "start": Object { - "column": 0, - "line": 1, + "column": 24, + "line": 6, }, }, "range": Array [ - 0, - 87, + 150, + 151, ], - "type": "TSInterfaceDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 8, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ";", }, - }, - "range": Array [ - 0, - 88, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 3, + "line": 8, }, "start": Object { - "column": 0, - "line": 1, + "column": 2, + "line": 8, }, }, "range": Array [ - 0, - 9, + 155, + 156, ], - "type": "Keyword", - "value": "interface", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 6, + "line": 8, }, "start": Object { - "column": 10, - "line": 1, + "column": 3, + "line": 8, }, }, "range": Array [ - 10, - 14, + 156, + 159, ], "type": "Identifier", - "value": "Test", + "value": "one", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 8, + "line": 8, }, "start": Object { - "column": 15, - "line": 1, + "column": 6, + "line": 8, }, }, "range": Array [ - 15, - 16, + 159, + 161, ], "type": "Punctuator", - "value": "{", + "value": "?.", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 6, + "column": 9, + "line": 8, }, "start": Object { - "column": 4, - "line": 6, + "column": 8, + "line": 8, }, }, "range": Array [ - 76, - 79, + 161, + 162, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 6, + "column": 10, + "line": 8, }, "start": Object { - "column": 7, - "line": 6, + "column": 9, + "line": 8, }, }, "range": Array [ - 79, - 80, + 162, + 163, ], "type": "Punctuator", - "value": "(", + "value": ")", }, Object { "loc": Object { "end": Object { "column": 11, - "line": 6, + "line": 8, }, "start": Object { - "column": 8, - "line": 6, + "column": 10, + "line": 8, }, }, "range": Array [ - 80, - 83, + 163, + 164, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { "column": 12, - "line": 6, + "line": 8, }, "start": Object { "column": 11, - "line": 6, + "line": 8, }, }, "range": Array [ - 83, - 84, + 164, + 165, ], "type": "Punctuator", - "value": ")", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 6, + "column": 3, + "line": 9, }, "start": Object { - "column": 12, - "line": 6, + "column": 2, + "line": 9, }, }, "range": Array [ - 84, - 85, + 168, + 169, ], "type": "Punctuator", - "value": ";", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 7, + "column": 6, + "line": 9, }, "start": Object { - "column": 0, - "line": 7, + "column": 3, + "line": 9, }, }, "range": Array [ - 86, - 87, + 169, + 172, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "one", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/interface-with-method.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "name": "h", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "bar", - "range": Array [ - 21, - 32, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 7, - "line": 2, - }, - }, - "range": Array [ - 24, - 32, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "range": Array [ - 26, - 32, - ], - "type": "TSStringKeyword", - }, - }, - }, - ], - "range": Array [ - 19, - 40, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 33, - 39, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, - }, - }, - "range": Array [ - 35, - 39, - ], - "type": "TSVoidKeyword", - }, - }, - "type": "TSMethodSignature", - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "name": "g", - "range": Array [ - 43, - 44, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 18, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 3, - }, - }, - "name": "bar", - "range": Array [ - 48, - 54, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 3, - }, - }, - "range": Array [ - 51, - 54, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "range": Array [ - 53, - 54, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "name": "T", - "range": Array [ - 53, - 54, - ], - "type": "Identifier", - }, - }, - }, - }, - ], - "range": Array [ - 43, - 59, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "range": Array [ - 55, - 58, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 3, - }, - "start": Object { - "column": 16, - "line": 3, - }, - }, - "range": Array [ - 57, - 58, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 3, - }, - "start": Object { - "column": 16, - "line": 3, - }, - }, - "name": "T", - "range": Array [ - 57, - 58, - ], - "type": "Identifier", - }, - }, - }, - "type": "TSMethodSignature", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 3, - }, - "start": Object { - "column": 3, - "line": 3, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "name": "T", - "range": Array [ - 45, - 46, - ], - "type": "Identifier", - }, - "range": Array [ - 45, - 46, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 44, - 47, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 61, - ], - "type": "TSInterfaceBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "test", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 8, + "line": 9, }, "start": Object { - "column": 0, - "line": 1, + "column": 6, + "line": 9, }, }, "range": Array [ - 0, - 61, + 172, + 174, ], - "type": "TSInterfaceDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "?.", }, - }, - "range": Array [ - 0, - 62, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { "column": 9, - "line": 1, + "line": 9, }, "start": Object { - "column": 0, - "line": 1, + "column": 8, + "line": 9, }, }, "range": Array [ - 0, - 9, + 174, + 175, ], - "type": "Keyword", - "value": "interface", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 10, + "line": 9, }, "start": Object { - "column": 10, - "line": 1, + "column": 9, + "line": 9, }, }, "range": Array [ - 10, - 14, + 175, + 176, ], - "type": "Identifier", - "value": "test", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 11, + "line": 9, }, "start": Object { - "column": 15, - "line": 1, + "column": 10, + "line": 9, }, }, "range": Array [ - 15, - 16, + 176, + 177, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 2, + "column": 12, + "line": 9, }, "start": Object { - "column": 2, - "line": 2, + "column": 11, + "line": 9, }, }, "range": Array [ - 19, - 20, + 177, + 178, ], - "type": "Identifier", - "value": "h", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 2, + "column": 13, + "line": 9, }, "start": Object { - "column": 3, - "line": 2, + "column": 12, + "line": 9, }, }, "range": Array [ - 20, - 21, + 178, + 179, ], "type": "Punctuator", - "value": "(", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 14, + "line": 9, }, "start": Object { - "column": 4, - "line": 2, + "column": 13, + "line": 9, }, }, "range": Array [ - 21, - 24, + 179, + 180, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 3, + "line": 10, }, "start": Object { - "column": 7, - "line": 2, + "column": 2, + "line": 10, }, }, "range": Array [ - 24, - 25, + 183, + 184, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 6, + "line": 10, }, "start": Object { - "column": 9, - "line": 2, + "column": 3, + "line": 10, }, }, "range": Array [ - 26, - 32, + 184, + 187, ], "type": "Identifier", - "value": "string", + "value": "one", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 8, + "line": 10, }, "start": Object { - "column": 15, - "line": 2, + "column": 6, + "line": 10, }, }, "range": Array [ - 32, - 33, + 187, + 189, ], "type": "Punctuator", - "value": ")", + "value": "?.", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 9, + "line": 10, }, "start": Object { - "column": 16, - "line": 2, + "column": 8, + "line": 10, }, }, "range": Array [ - 33, - 34, + 189, + 190, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 10, + "line": 10, }, "start": Object { - "column": 18, - "line": 2, + "column": 9, + "line": 10, }, }, "range": Array [ - 35, - 39, + 190, + 191, ], - "type": "Keyword", - "value": "void", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 11, + "line": 10, }, "start": Object { - "column": 22, - "line": 2, + "column": 10, + "line": 10, }, }, "range": Array [ - 39, - 40, + 191, + 192, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 3, + "column": 13, + "line": 10, }, "start": Object { - "column": 2, - "line": 3, + "column": 11, + "line": 10, }, }, "range": Array [ - 43, - 44, + 192, + 194, ], - "type": "Identifier", - "value": "g", + "type": "Punctuator", + "value": "?.", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 3, + "column": 14, + "line": 10, }, "start": Object { - "column": 3, - "line": 3, + "column": 13, + "line": 10, }, }, "range": Array [ - 44, - 45, + 194, + 195, ], "type": "Punctuator", - "value": "<", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 15, + "line": 10, }, "start": Object { - "column": 4, - "line": 3, + "column": 14, + "line": 10, }, }, "range": Array [ - 45, - 46, + 195, + 196, ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 3, + "column": 16, + "line": 10, }, "start": Object { - "column": 5, - "line": 3, + "column": 15, + "line": 10, }, }, "range": Array [ - 46, - 47, + 196, + 197, ], "type": "Punctuator", - "value": ">", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 3, + "line": 12, }, "start": Object { - "column": 6, - "line": 3, + "column": 2, + "line": 12, }, }, "range": Array [ - 47, - 48, + 201, + 202, ], "type": "Punctuator", "value": "(", @@ -59154,71 +78146,89 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, - "line": 3, + "column": 6, + "line": 12, }, "start": Object { - "column": 7, - "line": 3, + "column": 3, + "line": 12, + }, + }, + "range": Array [ + 202, + 205, + ], + "type": "Identifier", + "value": "one", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 12, + }, + "start": Object { + "column": 6, + "line": 12, }, }, "range": Array [ - 48, - 51, + 205, + 207, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "?.", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 3, + "column": 9, + "line": 12, }, "start": Object { - "column": 10, - "line": 3, + "column": 8, + "line": 12, }, }, "range": Array [ - 51, - 52, + 207, + 208, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 3, + "column": 10, + "line": 12, }, "start": Object { - "column": 12, - "line": 3, + "column": 9, + "line": 12, }, }, "range": Array [ - 53, - 54, + 208, + 209, ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 3, + "column": 11, + "line": 12, }, "start": Object { - "column": 13, - "line": 3, + "column": 10, + "line": 12, }, }, "range": Array [ - 54, - 55, + 209, + 210, ], "type": "Punctuator", "value": ")", @@ -59226,53 +78236,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 12, + "line": 12, }, "start": Object { - "column": 14, - "line": 3, + "column": 11, + "line": 12, }, }, "range": Array [ - 55, - 56, + 210, + 211, ], "type": "Punctuator", - "value": ":", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 3, + "column": 15, + "line": 12, }, "start": Object { - "column": 16, - "line": 3, + "column": 12, + "line": 12, }, }, "range": Array [ - 57, - 58, + 211, + 214, ], "type": "Identifier", - "value": "T", + "value": "two", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 3, + "column": 16, + "line": 12, }, "start": Object { - "column": 17, - "line": 3, + "column": 15, + "line": 12, }, }, "range": Array [ - 58, - 59, + 214, + 215, ], "type": "Punctuator", "value": ";", @@ -59281,16 +78291,16 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 13, }, "start": Object { "column": 0, - "line": 4, + "line": 13, }, }, "range": Array [ - 60, - 61, + 216, + 217, ], "type": "Punctuator", "value": "}", @@ -59300,305 +78310,830 @@ Object { } `; -exports[`typescript fixtures/basics/interface-with-optional-properties.src 1`] = ` +exports[`typescript fixtures/basics/optional-chain-element-access.src 1`] = ` Object { "body": Array [ Object { + "async": false, "body": Object { "body": Array [ Object { - "computed": false, - "key": Object { + "expression": Object { + "computed": true, "loc": Object { "end": Object { - "column": 7, + "column": 10, "line": 2, }, "start": Object { - "column": 4, + "column": 2, "line": 2, }, }, - "name": "foo", + "object": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "one", + "range": Array [ + 47, + 50, + ], + "type": "Identifier", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 53, + 54, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, "range": Array [ - 21, - 24, + 47, + 55, ], - "type": "Identifier", + "type": "OptionalMemberExpression", }, "loc": Object { "end": Object { - "column": 9, + "column": 11, "line": 2, }, "start": Object { - "column": 4, + "column": 2, "line": 2, }, }, - "optional": true, "range": Array [ - 21, - 26, + 47, + 56, ], - "type": "TSPropertySignature", + "type": "ExpressionStatement", }, Object { - "computed": false, - "key": Object { + "expression": Object { + "computed": true, "loc": Object { "end": Object { - "column": 7, + "column": 13, "line": 3, }, "start": Object { - "column": 4, + "column": 2, "line": 3, }, }, - "name": "bar", + "object": Object { + "computed": true, + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "name": "one", + "range": Array [ + 59, + 62, + ], + "type": "Identifier", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 65, + 66, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "range": Array [ + 59, + 67, + ], + "type": "OptionalMemberExpression", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 68, + 69, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, "range": Array [ - 31, - 34, + 59, + 70, ], - "type": "Identifier", + "type": "OptionalMemberExpression", }, "loc": Object { "end": Object { - "column": 17, + "column": 14, "line": 3, }, "start": Object { - "column": 4, + "column": 2, "line": 3, }, }, - "optional": true, "range": Array [ - 31, - 44, + 59, + 71, ], - "type": "TSPropertySignature", - "typeAnnotation": Object { + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "computed": true, "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 13, + "line": 4, }, "start": Object { - "column": 8, - "line": 3, + "column": 2, + "line": 4, }, }, - "range": Array [ - 35, - 43, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "object": Object { + "computed": true, "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 8, + "line": 4, }, "start": Object { - "column": 10, - "line": 3, + "column": 2, + "line": 4, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "name": "one", + "range": Array [ + 74, + 77, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 4, + }, }, + "range": Array [ + 78, + 79, + ], + "raw": "2", + "type": "Literal", + "value": 2, }, "range": Array [ - 37, - 43, + 74, + 80, ], - "type": "TSStringKeyword", + "type": "MemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 11, + "line": 4, + }, + }, + "range": Array [ + 83, + 84, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + "range": Array [ + 74, + 85, + ], + "type": "OptionalMemberExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, }, }, + "range": Array [ + 74, + 86, + ], + "type": "ExpressionStatement", }, Object { - "computed": false, - "key": Object { + "expression": Object { + "computed": true, "loc": Object { "end": Object { - "column": 7, - "line": 4, + "column": 13, + "line": 5, }, "start": Object { - "column": 4, - "line": 4, + "column": 2, + "line": 5, }, }, - "name": "baz", + "object": Object { + "computed": true, + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "name": "one", + "range": Array [ + 89, + 92, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "range": Array [ + 93, + 94, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "range": Array [ + 89, + 95, + ], + "type": "MemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 98, + 99, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, "range": Array [ - 49, - 52, + 89, + 100, ], - "type": "Identifier", + "type": "OptionalMemberExpression", }, "loc": Object { "end": Object { - "column": 34, - "line": 4, + "column": 14, + "line": 5, }, "start": Object { - "column": 4, - "line": 4, + "column": 2, + "line": 5, }, }, - "optional": true, - "params": Array [ - Object { + "range": Array [ + 89, + 101, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "computed": true, + "loc": Object { + "end": Object { + "column": 16, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "object": Object { + "computed": true, "loc": Object { "end": Object { - "column": 12, - "line": 4, + "column": 13, + "line": 6, }, "start": Object { - "column": 9, - "line": 4, + "column": 2, + "line": 6, }, }, - "name": "foo", + "object": Object { + "computed": true, + "loc": Object { + "end": Object { + "column": 8, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "name": "one", + "range": Array [ + 104, + 107, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 6, + "line": 6, + }, + }, + "range": Array [ + 108, + 109, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "range": Array [ + 104, + 110, + ], + "type": "MemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 11, + "line": 6, + }, + }, + "range": Array [ + 113, + 114, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, "range": Array [ - 54, - 57, + 104, + 115, ], - "type": "Identifier", + "type": "OptionalMemberExpression", }, - Object { + "optional": false, + "property": Object { "loc": Object { "end": Object { - "column": 26, - "line": 4, + "column": 15, + "line": 6, }, "start": Object { "column": 14, - "line": 4, + "line": 6, }, }, - "name": "bar", - "optional": true, "range": Array [ - 59, - 71, + 116, + 117, ], - "type": "Identifier", - "typeAnnotation": Object { + "raw": "4", + "type": "Literal", + "value": 4, + }, + "range": Array [ + 104, + 118, + ], + "type": "OptionalMemberExpression", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 104, + 119, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "computed": true, + "loc": Object { + "end": Object { + "column": 18, + "line": 7, + }, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "object": Object { + "computed": true, + "loc": Object { + "end": Object { + "column": 13, + "line": 7, + }, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "object": Object { + "computed": true, "loc": Object { "end": Object { - "column": 26, - "line": 4, + "column": 8, + "line": 7, }, "start": Object { - "column": 18, - "line": 4, + "column": 2, + "line": 7, }, }, - "range": Array [ - 63, - 71, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "object": Object { "loc": Object { "end": Object { - "column": 26, - "line": 4, + "column": 5, + "line": 7, }, "start": Object { - "column": 20, - "line": 4, + "column": 2, + "line": 7, }, }, + "name": "one", "range": Array [ - 65, - 71, + 122, + 125, ], - "type": "TSStringKeyword", + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 6, + "line": 7, + }, + }, + "range": Array [ + 126, + 127, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "range": Array [ + 122, + 128, + ], + "type": "MemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 7, + }, + "start": Object { + "column": 11, + "line": 7, + }, }, + "range": Array [ + 131, + 132, + ], + "raw": "3", + "type": "Literal", + "value": 3, }, + "range": Array [ + 122, + 133, + ], + "type": "OptionalMemberExpression", }, - Object { + "optional": true, + "property": Object { "loc": Object { "end": Object { - "column": 32, - "line": 4, + "column": 17, + "line": 7, }, "start": Object { - "column": 28, - "line": 4, + "column": 16, + "line": 7, }, }, - "name": "baz", - "optional": true, "range": Array [ - 73, - 77, + 136, + 137, ], - "type": "Identifier", + "raw": "4", + "type": "Literal", + "value": 4, }, - ], + "range": Array [ + 122, + 138, + ], + "type": "OptionalMemberExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 7, + }, + "start": Object { + "column": 2, + "line": 7, + }, + }, "range": Array [ - 49, - 79, + 122, + 139, ], - "type": "TSMethodSignature", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 8, }, "start": Object { - "column": 15, + "column": 43, "line": 1, }, }, "range": Array [ - 15, - 81, + 43, + 141, ], - "type": "TSInterfaceBody", + "type": "BlockStatement", }, + "expression": false, + "generator": false, "id": Object { "loc": Object { "end": Object { - "column": 14, + "column": 31, "line": 1, }, "start": Object { - "column": 10, + "column": 9, "line": 1, }, }, - "name": "test", + "name": "processOptionalElement", "range": Array [ - 10, - 14, + 9, + 31, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 8, }, "start": Object { "column": 0, "line": 1, }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "name": "one", + "optional": true, + "range": Array [ + 32, + 41, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 41, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 41, + ], + "type": "TSAnyKeyword", + }, + }, + }, + ], "range": Array [ 0, - 81, + 141, ], - "type": "TSInterfaceDeclaration", + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 6, + "line": 9, }, "start": Object { "column": 0, @@ -59607,14 +79142,14 @@ Object { }, "range": Array [ 0, - 82, + 142, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 9, + "column": 8, "line": 1, }, "start": Object { @@ -59623,188 +79158,422 @@ Object { }, }, "range": Array [ - 0, - 9, + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 31, + ], + "type": "Identifier", + "value": "processOptionalElement", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 35, + ], + "type": "Identifier", + "value": "one", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 41, + ], + "type": "Identifier", + "value": "any", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 47, + 50, + ], + "type": "Identifier", + "value": "one", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 50, + 52, + ], + "type": "Punctuator", + "value": "?.", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 54, + 55, ], - "type": "Keyword", - "value": "interface", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { "column": 10, - "line": 1, + "line": 2, }, }, "range": Array [ - 10, - 14, + 55, + 56, ], - "type": "Identifier", - "value": "test", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 15, - "line": 1, + "column": 2, + "line": 3, }, }, "range": Array [ - 15, - 16, + 59, + 62, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "one", }, Object { "loc": Object { "end": Object { "column": 7, - "line": 2, + "line": 3, }, "start": Object { - "column": 4, - "line": 2, + "column": 5, + "line": 3, }, }, "range": Array [ - 21, - 24, + 62, + 64, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "?.", }, Object { "loc": Object { "end": Object { "column": 8, - "line": 2, + "line": 3, }, "start": Object { "column": 7, - "line": 2, + "line": 3, }, }, "range": Array [ - 24, - 25, + 64, + 65, ], "type": "Punctuator", - "value": "?", + "value": "[", }, Object { "loc": Object { "end": Object { "column": 9, - "line": 2, + "line": 3, }, "start": Object { "column": 8, - "line": 2, + "line": 3, }, }, "range": Array [ - 25, - 26, + 65, + 66, ], - "type": "Punctuator", - "value": ";", + "type": "Numeric", + "value": "2", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 10, "line": 3, }, "start": Object { - "column": 4, + "column": 9, "line": 3, }, }, "range": Array [ - 31, - 34, + 66, + 67, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 11, "line": 3, }, "start": Object { - "column": 7, + "column": 10, "line": 3, }, }, "range": Array [ - 34, - 35, + 67, + 68, ], "type": "Punctuator", - "value": "?", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 12, "line": 3, }, "start": Object { - "column": 8, + "column": 11, "line": 3, }, }, "range": Array [ - 35, - 36, + 68, + 69, ], - "type": "Punctuator", - "value": ":", + "type": "Numeric", + "value": "3", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 13, "line": 3, }, "start": Object { - "column": 10, + "column": 12, "line": 3, }, }, "range": Array [ - 37, - 43, + 69, + 70, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 14, "line": 3, }, "start": Object { - "column": 16, + "column": 13, "line": 3, }, }, "range": Array [ - 43, - 44, + 70, + 71, ], "type": "Punctuator", "value": ";", @@ -59812,1549 +79581,1700 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 4, }, "start": Object { - "column": 4, + "column": 2, "line": 4, }, }, "range": Array [ - 49, - 52, + 74, + 77, ], "type": "Identifier", - "value": "baz", + "value": "one", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 6, "line": 4, }, "start": Object { - "column": 7, + "column": 5, "line": 4, }, }, "range": Array [ - 52, - 53, + 77, + 78, ], "type": "Punctuator", - "value": "?", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 4, }, "start": Object { - "column": 8, + "column": 6, "line": 4, }, }, "range": Array [ - 53, - 54, + 78, + 79, ], - "type": "Punctuator", - "value": "(", + "type": "Numeric", + "value": "2", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 8, "line": 4, }, "start": Object { - "column": 9, + "column": 7, "line": 4, }, }, "range": Array [ - 54, - 57, + 79, + 80, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 10, "line": 4, }, "start": Object { - "column": 12, + "column": 8, "line": 4, }, }, "range": Array [ - 57, - 58, + 80, + 82, ], "type": "Punctuator", - "value": ",", + "value": "?.", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 11, "line": 4, }, "start": Object { - "column": 14, + "column": 10, "line": 4, }, }, "range": Array [ - 59, - 62, + 82, + 83, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 12, "line": 4, }, "start": Object { - "column": 17, + "column": 11, "line": 4, }, }, "range": Array [ - 62, - 63, + 83, + 84, ], - "type": "Punctuator", - "value": "?", + "type": "Numeric", + "value": "3", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 13, "line": 4, }, "start": Object { - "column": 18, + "column": 12, "line": 4, }, }, "range": Array [ - 63, - 64, + 84, + 85, ], "type": "Punctuator", - "value": ":", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 14, "line": 4, }, "start": Object { - "column": 20, + "column": 13, "line": 4, }, }, "range": Array [ - 65, - 71, + 85, + 86, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 4, + "column": 5, + "line": 5, }, "start": Object { - "column": 26, - "line": 4, + "column": 2, + "line": 5, }, }, "range": Array [ - 71, - 72, + 89, + 92, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "one", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 4, + "column": 6, + "line": 5, }, "start": Object { - "column": 28, - "line": 4, + "column": 5, + "line": 5, }, }, "range": Array [ - 73, - 76, + 92, + 93, ], - "type": "Identifier", - "value": "baz", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 4, + "column": 7, + "line": 5, }, "start": Object { - "column": 31, - "line": 4, + "column": 6, + "line": 5, }, }, "range": Array [ - 76, - 77, + 93, + 94, ], - "type": "Punctuator", - "value": "?", + "type": "Numeric", + "value": "2", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 4, + "column": 8, + "line": 5, }, "start": Object { - "column": 32, - "line": 4, + "column": 7, + "line": 5, }, }, "range": Array [ - 77, - 78, + 94, + 95, ], "type": "Punctuator", - "value": ")", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 4, + "column": 10, + "line": 5, }, "start": Object { - "column": 33, - "line": 4, + "column": 8, + "line": 5, }, }, "range": Array [ - 78, - 79, + 95, + 97, ], "type": "Punctuator", - "value": ";", + "value": "?.", }, Object { "loc": Object { "end": Object { - "column": 1, + "column": 11, "line": 5, }, "start": Object { - "column": 0, + "column": 10, "line": 5, }, }, "range": Array [ - 80, - 81, + 97, + 98, ], "type": "Punctuator", - "value": "}", + "value": "[", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/interface-without-type-annotation.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 21, - 25, - ], - "type": "TSPropertySignature", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 12, + "line": 5, }, - "range": Array [ - 15, - 27, - ], - "type": "TSInterfaceBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, + "start": Object { + "column": 11, + "line": 5, }, - "name": "test", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", }, + "range": Array [ + 98, + 99, + ], + "type": "Numeric", + "value": "3", + }, + Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 13, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 12, + "line": 5, }, }, "range": Array [ - 0, - 27, + 99, + 100, ], - "type": "TSInterfaceDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "]", }, - }, - "range": Array [ - 0, - 28, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 14, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 13, + "line": 5, }, }, "range": Array [ - 0, - 9, + 100, + 101, ], - "type": "Keyword", - "value": "interface", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 5, + "line": 6, }, "start": Object { - "column": 10, - "line": 1, + "column": 2, + "line": 6, }, }, "range": Array [ - 10, - 14, + 104, + 107, ], "type": "Identifier", - "value": "test", + "value": "one", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 6, + "line": 6, }, "start": Object { - "column": 15, - "line": 1, + "column": 5, + "line": 6, }, }, "range": Array [ - 15, - 16, + 107, + 108, ], "type": "Punctuator", - "value": "{", + "value": "[", }, Object { "loc": Object { "end": Object { "column": 7, - "line": 2, + "line": 6, }, "start": Object { - "column": 4, - "line": 2, + "column": 6, + "line": 6, }, }, "range": Array [ - 21, - 24, + 108, + 109, ], - "type": "Identifier", - "value": "foo", + "type": "Numeric", + "value": "2", }, Object { "loc": Object { "end": Object { "column": 8, - "line": 2, + "line": 6, }, "start": Object { "column": 7, - "line": 2, + "line": 6, }, }, "range": Array [ - 24, - 25, + 109, + 110, ], "type": "Punctuator", - "value": ";", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 10, + "line": 6, }, "start": Object { - "column": 0, - "line": 3, + "column": 8, + "line": 6, }, }, "range": Array [ - 26, - 27, + 110, + 112, ], "type": "Punctuator", - "value": "}", + "value": "?.", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/keyof-operator.src 1`] = ` -Object { - "body": Array [ Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 11, + "line": 6, + }, + "start": Object { + "column": 10, + "line": 6, }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", }, + "range": Array [ + 112, + 113, + ], + "type": "Punctuator", + "value": "[", + }, + Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 12, + "line": 6, }, "start": Object { - "column": 0, - "line": 1, + "column": 11, + "line": 6, }, }, "range": Array [ - 0, - 19, + 113, + 114, ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, + "type": "Numeric", + "value": "3", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 6, }, - "operator": "keyof", - "range": Array [ - 9, - 18, - ], - "type": "TSTypeOperator", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 18, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, + "start": Object { + "column": 12, + "line": 6, }, }, + "range": Array [ + 114, + 115, + ], + "type": "Punctuator", + "value": "]", }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 6, + }, + "start": Object { + "column": 13, + "line": 6, + }, + }, + "range": Array [ + 115, + 116, + ], + "type": "Punctuator", + "value": "[", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 6, + }, + "start": Object { + "column": 14, + "line": 6, + }, + }, + "range": Array [ + 116, + 117, + ], + "type": "Numeric", + "value": "4", }, - }, - "range": Array [ - 0, - 20, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, - "line": 1, + "column": 16, + "line": 6, }, "start": Object { - "column": 0, - "line": 1, + "column": 15, + "line": 6, }, }, "range": Array [ - 0, - 4, + 117, + 118, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 6, + }, + "start": Object { + "column": 16, + "line": 6, + }, + }, + "range": Array [ + 118, + 119, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 7, + }, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "range": Array [ + 122, + 125, ], "type": "Identifier", - "value": "type", + "value": "one", }, Object { "loc": Object { "end": Object { "column": 6, - "line": 1, + "line": 7, }, "start": Object { "column": 5, - "line": 1, + "line": 7, }, }, "range": Array [ - 5, - 6, + 125, + 126, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 6, + "line": 7, + }, + }, + "range": Array [ + 126, + 127, + ], + "type": "Numeric", + "value": "2", }, Object { "loc": Object { "end": Object { "column": 8, - "line": 1, + "line": 7, }, "start": Object { "column": 7, - "line": 1, + "line": 7, }, }, "range": Array [ - 7, - 8, + 127, + 128, ], "type": "Punctuator", - "value": "=", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 10, + "line": 7, }, "start": Object { - "column": 9, - "line": 1, + "column": 8, + "line": 7, }, }, "range": Array [ - 9, - 14, + 128, + 130, ], - "type": "Identifier", - "value": "keyof", + "type": "Punctuator", + "value": "?.", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 11, + "line": 7, + }, + "start": Object { + "column": 10, + "line": 7, + }, + }, + "range": Array [ + 130, + 131, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 7, + }, + "start": Object { + "column": 11, + "line": 7, + }, + }, + "range": Array [ + 131, + 132, + ], + "type": "Numeric", + "value": "3", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "range": Array [ + 132, + 133, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 7, + }, + "start": Object { + "column": 13, + "line": 7, + }, + }, + "range": Array [ + 133, + 135, + ], + "type": "Punctuator", + "value": "?.", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 7, }, "start": Object { "column": 15, - "line": 1, + "line": 7, }, }, "range": Array [ - 15, - 18, + 135, + 136, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 7, + }, + "start": Object { + "column": 16, + "line": 7, + }, + }, + "range": Array [ + 136, + 137, + ], + "type": "Numeric", + "value": "4", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 7, + }, + "start": Object { + "column": 17, + "line": 7, + }, + }, + "range": Array [ + 137, + 138, + ], + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { "column": 19, - "line": 1, + "line": 7, }, "start": Object { "column": 18, - "line": 1, + "line": 7, }, }, "range": Array [ - 18, - 19, + 138, + 139, ], "type": "Punctuator", "value": ";", }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 8, + }, + }, + "range": Array [ + 140, + 141, + ], + "type": "Punctuator", + "value": "}", + }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/keyword-variables.src 1`] = ` +exports[`typescript fixtures/basics/optional-chain-element-access-with-parens.src 1`] = ` Object { "body": Array [ Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "computed": true, + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "object": Object { "loc": Object { "end": Object { - "column": 11, + "column": 6, "line": 2, }, "start": Object { - "column": 8, + "column": 3, "line": 2, }, }, - "name": "get", + "name": "one", "range": Array [ - 10, - 13, + 54, + 57, ], "type": "Identifier", }, - "init": Object { + "optional": true, + "property": Object { "loc": Object { "end": Object { - "column": 15, + "column": 10, "line": 2, }, "start": Object { - "column": 14, + "column": 9, "line": 2, }, }, "range": Array [ - 16, - 17, + 60, + 61, ], - "raw": "1", + "raw": "2", "type": "Literal", - "value": 1, - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, + "value": 2, }, "range": Array [ - 10, - 17, + 54, + 62, ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 16, - "line": 2, + "type": "OptionalMemberExpression", }, - "start": Object { - "column": 2, - "line": 2, + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, }, - }, - "range": Array [ - 4, - 18, - ], - "type": "VariableDeclaration", - }, - Object { - "declarations": Array [ - Object { - "id": Object { + "range": Array [ + 53, + 64, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "computed": true, + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "object": Object { + "computed": true, "loc": Object { "end": Object { "column": 11, "line": 3, }, "start": Object { - "column": 8, + "column": 3, "line": 3, }, }, - "name": "set", + "object": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 3, + "line": 3, + }, + }, + "name": "one", + "range": Array [ + 68, + 71, + ], + "type": "Identifier", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 74, + 75, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, "range": Array [ - 27, - 30, + 68, + 76, ], - "type": "Identifier", + "type": "OptionalMemberExpression", }, - "init": Object { + "optional": false, + "property": Object { "loc": Object { "end": Object { - "column": 15, + "column": 14, "line": 3, }, "start": Object { - "column": 14, + "column": 13, "line": 3, }, }, "range": Array [ - 33, - 34, + 78, + 79, ], - "raw": "1", + "raw": "3", "type": "Literal", - "value": 1, + "value": 3, + }, + "range": Array [ + 67, + 80, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, }, + }, + "range": Array [ + 67, + 81, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "computed": true, "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 14, + "line": 4, }, "start": Object { - "column": 8, - "line": 3, + "column": 3, + "line": 4, }, }, - "range": Array [ - 27, - 34, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 16, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "range": Array [ - 21, - 35, - ], - "type": "VariableDeclaration", - }, - Object { - "declarations": Array [ - Object { - "id": Object { + "object": Object { + "computed": true, "loc": Object { "end": Object { - "column": 14, + "column": 9, "line": 4, }, "start": Object { - "column": 8, + "column": 3, "line": 4, }, }, - "name": "module", + "object": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 4, + }, + "start": Object { + "column": 3, + "line": 4, + }, + }, + "name": "one", + "range": Array [ + 85, + 88, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 7, + "line": 4, + }, + }, + "range": Array [ + 89, + 90, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, "range": Array [ - 44, - 50, + 85, + 91, ], - "type": "Identifier", + "type": "MemberExpression", }, - "init": Object { + "optional": true, + "property": Object { "loc": Object { "end": Object { - "column": 18, + "column": 13, "line": 4, }, "start": Object { - "column": 17, + "column": 12, "line": 4, }, }, "range": Array [ - 53, - 54, + 94, + 95, ], - "raw": "1", + "raw": "3", "type": "Literal", - "value": 1, + "value": 3, + }, + "range": Array [ + 85, + 96, + ], + "type": "OptionalMemberExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, }, + }, + "range": Array [ + 84, + 98, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "computed": true, "loc": Object { "end": Object { "column": 18, - "line": 4, + "line": 5, }, "start": Object { - "column": 8, - "line": 4, + "column": 2, + "line": 5, }, }, - "range": Array [ - 44, - 54, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 19, - "line": 4, - }, - "start": Object { - "column": 2, - "line": 4, - }, - }, - "range": Array [ - 38, - 55, - ], - "type": "VariableDeclaration", - }, - Object { - "declarations": Array [ - Object { - "id": Object { + "object": Object { + "computed": true, "loc": Object { "end": Object { - "column": 12, + "column": 14, "line": 5, }, "start": Object { - "column": 8, + "column": 3, "line": 5, }, }, - "name": "type", + "object": Object { + "computed": true, + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "name": "one", + "range": Array [ + 102, + 105, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 7, + "line": 5, + }, + }, + "range": Array [ + 106, + 107, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "range": Array [ + 102, + 108, + ], + "type": "MemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "range": Array [ + 111, + 112, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, "range": Array [ - 64, - 68, + 102, + 113, ], - "type": "Identifier", + "type": "OptionalMemberExpression", }, - "init": Object { + "optional": false, + "property": Object { "loc": Object { "end": Object { - "column": 16, + "column": 17, "line": 5, }, "start": Object { - "column": 15, + "column": 16, "line": 5, }, }, "range": Array [ - 71, - 72, + 115, + 116, ], - "raw": "1", + "raw": "4", "type": "Literal", - "value": 1, + "value": 4, + }, + "range": Array [ + 101, + 117, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, }, + }, + "range": Array [ + 101, + 118, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "computed": true, "loc": Object { "end": Object { - "column": 16, - "line": 5, + "column": 19, + "line": 6, }, "start": Object { - "column": 8, - "line": 5, + "column": 3, + "line": 6, }, }, - "range": Array [ - 64, - 72, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 17, - "line": 5, - }, - "start": Object { - "column": 2, - "line": 5, - }, - }, - "range": Array [ - 58, - 73, - ], - "type": "VariableDeclaration", - }, - Object { - "declarations": Array [ - Object { - "id": Object { + "object": Object { + "computed": true, "loc": Object { "end": Object { - "column": 13, + "column": 14, "line": 6, }, "start": Object { - "column": 8, + "column": 3, "line": 6, }, }, - "name": "async", + "object": Object { + "computed": true, + "loc": Object { + "end": Object { + "column": 9, + "line": 6, + }, + "start": Object { + "column": 3, + "line": 6, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "start": Object { + "column": 3, + "line": 6, + }, + }, + "name": "one", + "range": Array [ + 122, + 125, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 6, + }, + "start": Object { + "column": 7, + "line": 6, + }, + }, + "range": Array [ + 126, + 127, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "range": Array [ + 122, + 128, + ], + "type": "MemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 6, + }, + "start": Object { + "column": 12, + "line": 6, + }, + }, + "range": Array [ + 131, + 132, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, "range": Array [ - 82, - 87, + 122, + 133, ], - "type": "Identifier", + "type": "OptionalMemberExpression", }, - "init": Object { + "optional": true, + "property": Object { "loc": Object { "end": Object { - "column": 17, + "column": 18, "line": 6, }, "start": Object { - "column": 16, + "column": 17, "line": 6, }, }, "range": Array [ - 90, - 91, + 136, + 137, ], - "raw": "1", + "raw": "4", "type": "Literal", - "value": 1, + "value": 4, + }, + "range": Array [ + 122, + 138, + ], + "type": "OptionalMemberExpression", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, }, + }, + "range": Array [ + 121, + 140, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "computed": true, "loc": Object { "end": Object { - "column": 17, - "line": 6, + "column": 23, + "line": 7, }, "start": Object { - "column": 8, - "line": 6, + "column": 2, + "line": 7, }, }, - "range": Array [ - 82, - 91, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 18, - "line": 6, - }, - "start": Object { - "column": 2, - "line": 6, - }, - }, - "range": Array [ - 76, - 92, - ], - "type": "VariableDeclaration", - }, - Object { - "declarations": Array [ - Object { - "id": Object { + "object": Object { + "computed": true, "loc": Object { "end": Object { - "column": 10, + "column": 19, "line": 7, }, "start": Object { - "column": 8, + "column": 3, "line": 7, }, }, - "name": "is", + "object": Object { + "computed": true, + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "start": Object { + "column": 3, + "line": 7, + }, + }, + "object": Object { + "computed": true, + "loc": Object { + "end": Object { + "column": 9, + "line": 7, + }, + "start": Object { + "column": 3, + "line": 7, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 7, + }, + "start": Object { + "column": 3, + "line": 7, + }, + }, + "name": "one", + "range": Array [ + 144, + 147, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 7, + }, + "start": Object { + "column": 7, + "line": 7, + }, + }, + "range": Array [ + 148, + 149, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "range": Array [ + 144, + 150, + ], + "type": "MemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "range": Array [ + 153, + 154, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + "range": Array [ + 144, + 155, + ], + "type": "OptionalMemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 7, + }, + "start": Object { + "column": 17, + "line": 7, + }, + }, + "range": Array [ + 158, + 159, + ], + "raw": "4", + "type": "Literal", + "value": 4, + }, "range": Array [ - 101, - 103, + 144, + 160, ], - "type": "Identifier", + "type": "OptionalMemberExpression", }, - "init": Object { + "optional": false, + "property": Object { "loc": Object { "end": Object { - "column": 14, + "column": 22, "line": 7, }, "start": Object { - "column": 13, + "column": 21, "line": 7, }, }, "range": Array [ - 106, - 107, + 162, + 163, ], - "raw": "1", + "raw": "5", "type": "Literal", - "value": 1, - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 7, - }, - "start": Object { - "column": 8, - "line": 7, - }, + "value": 5, }, "range": Array [ - 101, - 107, + 143, + 164, ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 15, - "line": 7, - }, - "start": Object { - "column": 2, - "line": 7, - }, - }, - "range": Array [ - 95, - 108, - ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 8, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 110, - ], - "type": "BlockStatement", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 17, - }, - "start": Object { - "column": 0, - "line": 10, - }, - }, - "range": Array [ - 112, - 189, - ], - "source": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 17, - }, - "start": Object { - "column": 7, - "line": 17, - }, - }, - "range": Array [ - 175, - 188, - ], - "raw": "'fake-module'", - "type": "Literal", - "value": "fake-module", - }, - "specifiers": Array [ - Object { - "imported": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 11, - }, - "start": Object { - "column": 2, - "line": 11, - }, - }, - "name": "get", - "range": Array [ - 123, - 126, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 5, - "line": 11, - }, - "start": Object { - "column": 2, - "line": 11, - }, - }, - "local": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 11, - }, - "start": Object { - "column": 2, - "line": 11, - }, - }, - "name": "get", - "range": Array [ - 123, - 126, - ], - "type": "Identifier", - }, - "range": Array [ - 123, - 126, - ], - "type": "ImportSpecifier", - }, - Object { - "imported": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 12, - }, - "start": Object { - "column": 2, - "line": 12, - }, - }, - "name": "set", - "range": Array [ - 130, - 133, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 5, - "line": 12, - }, - "start": Object { - "column": 2, - "line": 12, - }, - }, - "local": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 12, - }, - "start": Object { - "column": 2, - "line": 12, - }, + "type": "MemberExpression", }, - "name": "set", - "range": Array [ - 130, - 133, - ], - "type": "Identifier", - }, - "range": Array [ - 130, - 133, - ], - "type": "ImportSpecifier", - }, - Object { - "imported": Object { "loc": Object { "end": Object { - "column": 8, - "line": 13, + "column": 24, + "line": 7, }, "start": Object { "column": 2, - "line": 13, + "line": 7, }, }, - "name": "module", "range": Array [ - 137, 143, + 165, ], - "type": "Identifier", + "type": "ExpressionStatement", }, - "loc": Object { - "end": Object { - "column": 8, - "line": 13, - }, - "start": Object { - "column": 2, - "line": 13, - }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 8, }, - "local": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 13, - }, - "start": Object { - "column": 2, - "line": 13, - }, - }, - "name": "module", - "range": Array [ - 137, - 143, - ], - "type": "Identifier", + "start": Object { + "column": 49, + "line": 1, }, - "range": Array [ - 137, - 143, - ], - "type": "ImportSpecifier", }, - Object { - "imported": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 14, - }, - "start": Object { - "column": 2, - "line": 14, - }, - }, - "name": "type", - "range": Array [ - 147, - 151, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 6, - "line": 14, - }, - "start": Object { - "column": 2, - "line": 14, - }, + "range": Array [ + 49, + 167, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, }, - "local": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 14, - }, - "start": Object { - "column": 2, - "line": 14, - }, - }, - "name": "type", - "range": Array [ - 147, - 151, - ], - "type": "Identifier", + "start": Object { + "column": 9, + "line": 1, }, - "range": Array [ - 147, - 151, - ], - "type": "ImportSpecifier", }, - Object { - "imported": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 15, - }, - "start": Object { - "column": 2, - "line": 15, - }, - }, - "name": "async", - "range": Array [ - 155, - 160, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 15, - }, - "start": Object { - "column": 2, - "line": 15, - }, - }, - "local": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 15, - }, - "start": Object { - "column": 2, - "line": 15, - }, - }, - "name": "async", - "range": Array [ - 155, - 160, - ], - "type": "Identifier", - }, - "range": Array [ - 155, - 160, - ], - "type": "ImportSpecifier", + "name": "processOptionalElementParens", + "range": Array [ + 9, + 37, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "params": Array [ Object { - "imported": Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 16, - }, - "start": Object { - "column": 2, - "line": 16, - }, - }, - "name": "is", - "range": Array [ - 164, - 166, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 4, - "line": 16, + "column": 47, + "line": 1, }, "start": Object { - "column": 2, - "line": 16, + "column": 38, + "line": 1, }, }, - "local": Object { + "name": "one", + "optional": true, + "range": Array [ + 38, + 47, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 4, - "line": 16, + "column": 47, + "line": 1, }, "start": Object { - "column": 2, - "line": 16, + "column": 42, + "line": 1, }, }, - "name": "is", "range": Array [ - 164, - 166, + 42, + 47, ], - "type": "Identifier", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 47, + ], + "type": "TSAnyKeyword", + }, }, - "range": Array [ - 164, - 166, - ], - "type": "ImportSpecifier", }, ], - "type": "ImportDeclaration", + "range": Array [ + 0, + 167, + ], + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 18, + "line": 9, }, "start": Object { "column": 0, @@ -61363,14 +81283,14 @@ Object { }, "range": Array [ 0, - 190, + 168, ], - "sourceType": "module", + "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 8, "line": 1, }, "start": Object { @@ -61380,7 +81300,151 @@ Object { }, "range": Array [ 0, - 1, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 37, + ], + "type": "Identifier", + "value": "processOptionalElementParens", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 41, + ], + "type": "Identifier", + "value": "one", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 47, + ], + "type": "Identifier", + "value": "any", + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 1, + }, + "start": Object { + "column": 49, + "line": 1, + }, + }, + "range": Array [ + 49, + 50, ], "type": "Punctuator", "value": "{", @@ -61388,7 +81452,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 3, "line": 2, }, "start": Object { @@ -61397,80 +81461,134 @@ Object { }, }, "range": Array [ - 4, - 9, + 53, + 54, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 6, "line": 2, }, "start": Object { - "column": 8, + "column": 3, "line": 2, }, }, "range": Array [ - 10, - 13, + 54, + 57, ], "type": "Identifier", - "value": "get", + "value": "one", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 8, "line": 2, }, "start": Object { - "column": 12, + "column": 6, "line": 2, }, }, "range": Array [ - 14, - 15, + 57, + 59, ], "type": "Punctuator", - "value": "=", + "value": "?.", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 9, "line": 2, }, "start": Object { - "column": 14, + "column": 8, "line": 2, }, }, "range": Array [ - 16, - 17, + 59, + 60, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 60, + 61, ], "type": "Numeric", - "value": "1", + "value": "2", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 11, "line": 2, }, "start": Object { - "column": 15, + "column": 10, "line": 2, }, }, "range": Array [ - 17, - 18, + 61, + 62, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 63, + 64, ], "type": "Punctuator", "value": ";", @@ -61478,7 +81596,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 3, "line": 3, }, "start": Object { @@ -61487,29 +81605,119 @@ Object { }, }, "range": Array [ - 21, - 26, + 67, + 68, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 6, "line": 3, }, "start": Object { - "column": 8, + "column": 3, "line": 3, }, }, "range": Array [ - 27, - 30, + 68, + 71, ], "type": "Identifier", - "value": "set", + "value": "one", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 71, + 73, + ], + "type": "Punctuator", + "value": "?.", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 73, + 74, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 74, + 75, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 75, + 76, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 76, + 77, + ], + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { @@ -61523,11 +81731,29 @@ Object { }, }, "range": Array [ - 31, - 32, + 77, + 78, ], "type": "Punctuator", - "value": "=", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 78, + 79, + ], + "type": "Numeric", + "value": "3", }, Object { "loc": Object { @@ -61541,11 +81767,11 @@ Object { }, }, "range": Array [ - 33, - 34, + 79, + 80, ], - "type": "Numeric", - "value": "1", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { @@ -61559,8 +81785,8 @@ Object { }, }, "range": Array [ - 34, - 35, + 80, + 81, ], "type": "Punctuator", "value": ";", @@ -61568,7 +81794,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 3, "line": 4, }, "start": Object { @@ -61577,170 +81803,188 @@ Object { }, }, "range": Array [ - 38, - 43, + 84, + 85, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 6, "line": 4, }, "start": Object { - "column": 8, + "column": 3, "line": 4, }, }, "range": Array [ - 44, - 50, + 85, + 88, ], "type": "Identifier", - "value": "module", + "value": "one", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 7, "line": 4, }, "start": Object { - "column": 15, + "column": 6, "line": 4, }, }, "range": Array [ - 51, - 52, + 88, + 89, ], "type": "Punctuator", - "value": "=", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 8, "line": 4, }, "start": Object { - "column": 17, + "column": 7, "line": 4, }, }, "range": Array [ - 53, - 54, + 89, + 90, ], "type": "Numeric", - "value": "1", + "value": "2", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 9, "line": 4, }, "start": Object { - "column": 18, + "column": 8, "line": 4, }, }, "range": Array [ - 54, - 55, + 90, + 91, ], "type": "Punctuator", - "value": ";", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 5, + "column": 11, + "line": 4, }, "start": Object { - "column": 2, - "line": 5, + "column": 9, + "line": 4, }, }, "range": Array [ - 58, - 63, + 91, + 93, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": "?.", }, Object { "loc": Object { "end": Object { "column": 12, - "line": 5, + "line": 4, }, "start": Object { - "column": 8, - "line": 5, + "column": 11, + "line": 4, }, }, "range": Array [ - 64, - 68, + 93, + 94, ], - "type": "Identifier", - "value": "type", + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "range": Array [ + 94, + 95, + ], + "type": "Numeric", + "value": "3", }, Object { "loc": Object { "end": Object { "column": 14, - "line": 5, + "line": 4, }, "start": Object { "column": 13, - "line": 5, + "line": 4, }, }, "range": Array [ - 69, - 70, + 95, + 96, ], "type": "Punctuator", - "value": "=", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 5, + "column": 15, + "line": 4, }, "start": Object { - "column": 15, - "line": 5, + "column": 14, + "line": 4, }, }, "range": Array [ - 71, - 72, + 96, + 97, ], - "type": "Numeric", - "value": "1", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 5, + "column": 16, + "line": 4, }, "start": Object { - "column": 16, - "line": 5, + "column": 15, + "line": 4, }, }, "range": Array [ - 72, - 73, + 97, + 98, ], "type": "Punctuator", "value": ";", @@ -61748,1318 +81992,1757 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, - "line": 6, + "column": 3, + "line": 5, }, "start": Object { "column": 2, - "line": 6, + "line": 5, }, }, "range": Array [ - 76, - 81, + 101, + 102, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 6, + "column": 6, + "line": 5, }, "start": Object { - "column": 8, - "line": 6, + "column": 3, + "line": 5, }, }, "range": Array [ - 82, - 87, + 102, + 105, ], "type": "Identifier", - "value": "async", + "value": "one", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 6, + "column": 7, + "line": 5, }, "start": Object { - "column": 14, - "line": 6, + "column": 6, + "line": 5, }, }, "range": Array [ - 88, - 89, + 105, + 106, ], "type": "Punctuator", - "value": "=", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 6, + "column": 8, + "line": 5, }, "start": Object { - "column": 16, - "line": 6, + "column": 7, + "line": 5, }, }, "range": Array [ - 90, - 91, + 106, + 107, ], "type": "Numeric", - "value": "1", + "value": "2", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 6, + "column": 9, + "line": 5, }, "start": Object { - "column": 17, - "line": 6, + "column": 8, + "line": 5, }, }, "range": Array [ - 91, - 92, + 107, + 108, ], "type": "Punctuator", - "value": ";", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 7, + "column": 11, + "line": 5, }, "start": Object { - "column": 2, - "line": 7, + "column": 9, + "line": 5, }, }, "range": Array [ - 95, - 100, + 108, + 110, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": "?.", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 7, + "column": 12, + "line": 5, }, "start": Object { - "column": 8, - "line": 7, + "column": 11, + "line": 5, }, }, "range": Array [ - 101, - 103, + 110, + 111, ], - "type": "Identifier", - "value": "is", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 7, + "column": 13, + "line": 5, }, "start": Object { - "column": 11, - "line": 7, + "column": 12, + "line": 5, }, }, "range": Array [ - 104, - 105, + 111, + 112, ], - "type": "Punctuator", - "value": "=", + "type": "Numeric", + "value": "3", }, Object { "loc": Object { "end": Object { "column": 14, - "line": 7, + "line": 5, }, "start": Object { "column": 13, - "line": 7, + "line": 5, }, }, "range": Array [ - 106, - 107, + 112, + 113, ], - "type": "Numeric", - "value": "1", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { "column": 15, - "line": 7, + "line": 5, }, "start": Object { "column": 14, - "line": 7, + "line": 5, }, }, "range": Array [ - 107, - 108, + 113, + 114, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 8, + "column": 16, + "line": 5, }, "start": Object { - "column": 0, - "line": 8, + "column": 15, + "line": 5, }, }, "range": Array [ - 109, - 110, + 114, + 115, ], "type": "Punctuator", - "value": "}", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 10, + "column": 17, + "line": 5, }, "start": Object { - "column": 0, - "line": 10, + "column": 16, + "line": 5, }, }, "range": Array [ - 112, - 118, + 115, + 116, ], - "type": "Keyword", - "value": "import", + "type": "Numeric", + "value": "4", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 10, + "column": 18, + "line": 5, }, "start": Object { - "column": 7, - "line": 10, + "column": 17, + "line": 5, }, }, "range": Array [ - 119, - 120, + 116, + 117, ], "type": "Punctuator", - "value": "{", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 11, + "column": 19, + "line": 5, + }, + "start": Object { + "column": 18, + "line": 5, + }, + }, + "range": Array [ + 117, + 118, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 6, }, "start": Object { "column": 2, - "line": 11, + "line": 6, }, }, "range": Array [ - 123, - 126, + 121, + 122, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "start": Object { + "column": 3, + "line": 6, + }, + }, + "range": Array [ + 122, + 125, ], "type": "Identifier", - "value": "get", + "value": "one", }, Object { "loc": Object { "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { "column": 6, - "line": 11, + "line": 6, + }, + }, + "range": Array [ + 125, + 126, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 6, }, "start": Object { - "column": 5, - "line": 11, + "column": 7, + "line": 6, }, }, "range": Array [ 126, 127, ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "range": Array [ + 127, + 128, + ], "type": "Punctuator", - "value": ",", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 12, + "column": 11, + "line": 6, }, "start": Object { - "column": 2, - "line": 12, + "column": 9, + "line": 6, }, }, "range": Array [ + 128, 130, - 133, ], - "type": "Identifier", - "value": "set", + "type": "Punctuator", + "value": "?.", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 12, + "column": 12, + "line": 6, }, "start": Object { - "column": 5, - "line": 12, + "column": 11, + "line": 6, }, }, "range": Array [ - 133, - 134, + 130, + 131, ], "type": "Punctuator", - "value": ",", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 13, + "column": 13, + "line": 6, }, "start": Object { - "column": 2, - "line": 13, + "column": 12, + "line": 6, }, }, "range": Array [ - 137, - 143, + 131, + 132, ], - "type": "Identifier", - "value": "module", + "type": "Numeric", + "value": "3", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 13, + "column": 14, + "line": 6, }, "start": Object { - "column": 8, - "line": 13, + "column": 13, + "line": 6, }, }, "range": Array [ - 143, - 144, + 132, + 133, ], "type": "Punctuator", - "value": ",", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 14, + "column": 16, + "line": 6, }, "start": Object { - "column": 2, - "line": 14, + "column": 14, + "line": 6, }, }, "range": Array [ - 147, - 151, + 133, + 135, ], - "type": "Identifier", - "value": "type", + "type": "Punctuator", + "value": "?.", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 14, + "column": 17, + "line": 6, }, "start": Object { - "column": 6, - "line": 14, + "column": 16, + "line": 6, }, }, "range": Array [ - 151, - 152, + 135, + 136, ], "type": "Punctuator", - "value": ",", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 15, + "column": 18, + "line": 6, }, "start": Object { - "column": 2, - "line": 15, + "column": 17, + "line": 6, }, }, "range": Array [ - 155, - 160, + 136, + 137, ], - "type": "Identifier", - "value": "async", + "type": "Numeric", + "value": "4", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 15, + "column": 19, + "line": 6, }, "start": Object { - "column": 7, - "line": 15, + "column": 18, + "line": 6, }, }, "range": Array [ - 160, - 161, + 137, + 138, ], "type": "Punctuator", - "value": ",", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 16, + "column": 20, + "line": 6, }, "start": Object { - "column": 2, - "line": 16, + "column": 19, + "line": 6, + }, + }, + "range": Array [ + 138, + 139, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 6, + }, + "start": Object { + "column": 20, + "line": 6, }, }, "range": Array [ - 164, - 166, + 139, + 140, ], - "type": "Identifier", - "value": "is", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 16, + "column": 3, + "line": 7, }, "start": Object { - "column": 4, - "line": 16, + "column": 2, + "line": 7, }, }, "range": Array [ - 166, - 167, + 143, + 144, ], "type": "Punctuator", - "value": ",", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 17, + "column": 6, + "line": 7, }, "start": Object { - "column": 0, - "line": 17, + "column": 3, + "line": 7, }, }, "range": Array [ - 168, - 169, + 144, + 147, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "one", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 17, + "column": 7, + "line": 7, }, "start": Object { - "column": 2, - "line": 17, + "column": 6, + "line": 7, }, }, "range": Array [ - 170, - 174, + 147, + 148, ], - "type": "Identifier", - "value": "from", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 17, + "column": 8, + "line": 7, }, "start": Object { "column": 7, - "line": 17, + "line": 7, }, }, "range": Array [ - 175, - 188, + 148, + 149, ], - "type": "String", - "value": "'fake-module'", + "type": "Numeric", + "value": "2", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 17, + "column": 9, + "line": 7, }, "start": Object { - "column": 20, - "line": 17, + "column": 8, + "line": 7, }, }, "range": Array [ - 188, - 189, + 149, + 150, ], "type": "Punctuator", - "value": ";", + "value": "]", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/nested-type-arguments.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "nestedArray", - "range": Array [ - 4, - 44, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 44, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 44, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "Array", - "range": Array [ - 17, - 22, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 43, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "name": "Array", - "range": Array [ - 23, - 28, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 42, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "name": "Array", - "range": Array [ - 29, - 34, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 34, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "range": Array [ - 35, - 41, - ], - "type": "TSStringKeyword", - }, - ], - "range": Array [ - 34, - 42, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - ], - "range": Array [ - 28, - 43, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - ], - "range": Array [ - 22, - 44, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - }, - }, - "init": null, - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 44, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", "loc": Object { "end": Object { - "column": 44, - "line": 1, + "column": 11, + "line": 7, }, "start": Object { - "column": 0, - "line": 1, + "column": 9, + "line": 7, }, }, "range": Array [ - 0, - 44, + 150, + 152, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "?.", }, - }, - "range": Array [ - 0, - 44, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, - "line": 1, + "column": 12, + "line": 7, }, "start": Object { - "column": 0, - "line": 1, + "column": 11, + "line": 7, }, }, "range": Array [ - 0, - 3, + 152, + 153, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 13, + "line": 7, }, "start": Object { - "column": 4, - "line": 1, + "column": 12, + "line": 7, }, }, "range": Array [ - 4, - 15, + 153, + 154, ], - "type": "Identifier", - "value": "nestedArray", + "type": "Numeric", + "value": "3", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 14, + "line": 7, }, "start": Object { - "column": 15, - "line": 1, + "column": 13, + "line": 7, }, }, "range": Array [ - 15, - 16, + 154, + 155, ], "type": "Punctuator", - "value": ":", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 16, + "line": 7, }, "start": Object { - "column": 17, - "line": 1, + "column": 14, + "line": 7, }, }, "range": Array [ - 17, - 22, + 155, + 157, ], - "type": "Identifier", - "value": "Array", + "type": "Punctuator", + "value": "?.", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 17, + "line": 7, }, "start": Object { - "column": 22, - "line": 1, + "column": 16, + "line": 7, }, }, "range": Array [ - 22, - 23, + 157, + 158, ], "type": "Punctuator", - "value": "<", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 18, + "line": 7, }, "start": Object { - "column": 23, - "line": 1, + "column": 17, + "line": 7, }, }, "range": Array [ - 23, - 28, + 158, + 159, ], - "type": "Identifier", - "value": "Array", + "type": "Numeric", + "value": "4", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 19, + "line": 7, }, "start": Object { - "column": 28, - "line": 1, + "column": 18, + "line": 7, }, }, "range": Array [ - 28, - 29, + 159, + 160, ], "type": "Punctuator", - "value": "<", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 1, + "column": 20, + "line": 7, }, "start": Object { - "column": 29, - "line": 1, + "column": 19, + "line": 7, }, }, "range": Array [ - 29, - 34, + 160, + 161, ], - "type": "Identifier", - "value": "Array", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 1, + "column": 21, + "line": 7, }, "start": Object { - "column": 34, - "line": 1, + "column": 20, + "line": 7, }, }, "range": Array [ - 34, - 35, + 161, + 162, ], "type": "Punctuator", - "value": "<", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 1, + "column": 22, + "line": 7, }, "start": Object { - "column": 35, - "line": 1, + "column": 21, + "line": 7, }, }, "range": Array [ - 35, - 41, + 162, + 163, ], - "type": "Identifier", - "value": "string", + "type": "Numeric", + "value": "5", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 23, + "line": 7, }, "start": Object { - "column": 41, - "line": 1, + "column": 22, + "line": 7, }, }, "range": Array [ - 41, - 42, + 163, + 164, ], "type": "Punctuator", - "value": ">", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 43, - "line": 1, + "column": 24, + "line": 7, }, "start": Object { - "column": 42, - "line": 1, + "column": 23, + "line": 7, }, }, "range": Array [ - 42, - 43, + 164, + 165, ], "type": "Punctuator", - "value": ">", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 44, - "line": 1, + "column": 1, + "line": 8, }, "start": Object { - "column": 43, - "line": 1, + "column": 0, + "line": 8, }, }, "range": Array [ - 43, - 44, + 166, + 167, ], "type": "Punctuator", - "value": ">", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/never-type-param.src 1`] = ` +exports[`typescript fixtures/basics/optional-chain-with-parens.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "name": "one", + "range": Array [ + 47, + 50, + ], + "type": "Identifier", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "name": "two", + "range": Array [ + 52, + 55, + ], + "type": "Identifier", + }, + "range": Array [ + 47, + 55, + ], + "type": "OptionalMemberExpression", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 46, + 57, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 3, + "line": 3, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 3, + "line": 3, + }, + }, + "name": "one", + "range": Array [ + 61, + 64, + ], + "type": "Identifier", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "name": "two", + "range": Array [ + 66, + 69, + ], + "type": "Identifier", + }, + "range": Array [ + 61, + 69, + ], + "type": "OptionalMemberExpression", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "name": "three", + "range": Array [ + 71, + 76, + ], + "type": "Identifier", + }, + "range": Array [ + 60, + 76, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 60, + 77, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 3, + "line": 4, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 3, + "line": 4, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 4, + }, + "start": Object { + "column": 3, + "line": 4, + }, + }, + "name": "one", + "range": Array [ + 81, + 84, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 7, + "line": 4, + }, + }, + "name": "two", + "range": Array [ + 85, + 88, + ], + "type": "Identifier", + }, + "range": Array [ + 81, + 88, + ], + "type": "MemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "name": "three", + "range": Array [ + 90, + 95, + ], + "type": "Identifier", + }, + "range": Array [ + 81, + 95, + ], + "type": "OptionalMemberExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 80, + 97, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 23, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "name": "one", + "range": Array [ + 101, + 104, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 7, + "line": 5, + }, + }, + "name": "two", + "range": Array [ + 105, + 108, + ], + "type": "Identifier", + }, + "range": Array [ + 101, + 108, + ], + "type": "MemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "name": "three", + "range": Array [ + 110, + 115, + ], + "type": "Identifier", + }, + "range": Array [ + 101, + 115, + ], + "type": "OptionalMemberExpression", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 5, + }, + "start": Object { + "column": 19, + "line": 5, + }, + }, + "name": "four", + "range": Array [ + 117, + 121, + ], + "type": "Identifier", + }, + "range": Array [ + 100, + 121, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 100, + 122, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 23, + "line": 6, + }, + "start": Object { + "column": 3, + "line": 6, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 17, + "line": 6, + }, + "start": Object { + "column": 3, + "line": 6, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 10, + "line": 6, + }, + "start": Object { + "column": 3, + "line": 6, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "start": Object { + "column": 3, + "line": 6, + }, + }, + "name": "one", + "range": Array [ + 126, + 129, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 6, + }, + "start": Object { + "column": 7, + "line": 6, + }, + }, + "name": "two", + "range": Array [ + 130, + 133, + ], + "type": "Identifier", + }, + "range": Array [ + 126, + 133, + ], + "type": "MemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 6, + }, + "start": Object { + "column": 12, + "line": 6, + }, + }, + "name": "three", + "range": Array [ + 135, + 140, + ], + "type": "Identifier", + }, + "range": Array [ + 126, + 140, + ], + "type": "OptionalMemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 6, + }, + "start": Object { + "column": 19, + "line": 6, + }, + }, + "name": "four", + "range": Array [ + 142, + 146, + ], + "type": "Identifier", + }, + "range": Array [ + 126, + 146, + ], + "type": "OptionalMemberExpression", + }, "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 25, + "line": 6, }, "start": Object { - "column": 6, - "line": 1, + "column": 2, + "line": 6, }, }, - "name": "x", "range": Array [ - 6, - 17, + 125, + 148, ], - "type": "Identifier", - "typeAnnotation": Object { + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "computed": false, "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 29, + "line": 7, }, "start": Object { - "column": 7, - "line": 1, + "column": 2, + "line": 7, }, }, - "range": Array [ - 7, - 17, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "object": Object { + "computed": false, "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 23, + "line": 7, }, "start": Object { - "column": 9, - "line": 1, + "column": 3, + "line": 7, }, }, - "range": Array [ - 9, - 17, - ], - "type": "TSTypeReference", - "typeName": Object { + "object": Object { + "computed": false, "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 17, + "line": 7, }, "start": Object { - "column": 9, - "line": 1, + "column": 3, + "line": 7, }, }, - "name": "X", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "start": Object { + "column": 3, + "line": 7, + }, }, - "start": Object { - "column": 10, - "line": 1, + "object": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 7, + }, + "start": Object { + "column": 3, + "line": 7, + }, + }, + "name": "one", + "range": Array [ + 152, + 155, + ], + "type": "Identifier", }, - }, - "params": Array [ - Object { + "optional": false, + "property": Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 10, + "line": 7, }, "start": Object { - "column": 11, - "line": 1, + "column": 7, + "line": 7, }, }, + "name": "two", "range": Array [ - 11, - 16, + 156, + 159, ], - "type": "TSNeverKeyword", + "type": "Identifier", + }, + "range": Array [ + 152, + 159, + ], + "type": "MemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, }, + "name": "three", + "range": Array [ + 161, + 166, + ], + "type": "Identifier", + }, + "range": Array [ + 152, + 166, ], + "type": "OptionalMemberExpression", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 7, + }, + "start": Object { + "column": 19, + "line": 7, + }, + }, + "name": "four", "range": Array [ - 10, - 17, + 168, + 172, ], - "type": "TSTypeParameterInstantiation", + "type": "Identifier", }, + "range": Array [ + 152, + 172, + ], + "type": "OptionalMemberExpression", }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 7, + }, + "start": Object { + "column": 25, + "line": 7, + }, + }, + "name": "five", + "range": Array [ + 174, + 178, + ], + "type": "Identifier", + }, + "range": Array [ + 151, + 178, + ], + "type": "MemberExpression", }, - }, - "init": null, - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, + "loc": Object { + "end": Object { + "column": 30, + "line": 7, + }, + "start": Object { + "column": 2, + "line": 7, + }, }, + "range": Array [ + 151, + 179, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 42, + "line": 1, }, - "range": Array [ - 6, - 17, - ], - "type": "VariableDeclarator", }, - ], - "kind": "const", + "range": Array [ + 42, + 181, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "processOptionalParens", + "range": Array [ + 9, + 30, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 1, + "line": 8, }, "start": Object { "column": 0, "line": 1, }, }, - "range": Array [ - 0, - 18, - ], - "type": "VariableDeclaration", - }, - Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "computed": false, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 40, + "line": 1, }, "start": Object { - "column": 0, - "line": 2, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, + "column": 31, + "line": 1, }, - "name": "Observable", - "range": Array [ - 19, - 29, - ], - "type": "Identifier", }, - "property": Object { + "name": "one", + "optional": true, + "range": Array [ + 31, + 40, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 40, + "line": 1, }, "start": Object { - "column": 11, - "line": 2, + "column": 35, + "line": 1, }, }, - "name": "empty", "range": Array [ - 30, 35, + 40, ], - "type": "Identifier", - }, - "range": Array [ - 19, - 35, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 25, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 19, - 44, - ], - "type": "CallExpression", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "params": Array [ - Object { + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 40, + "line": 1, }, "start": Object { - "column": 17, - "line": 2, + "column": 37, + "line": 1, }, }, "range": Array [ - 36, - 41, + 37, + 40, ], - "type": "TSNeverKeyword", + "type": "TSAnyKeyword", }, - ], - "range": Array [ - 35, - 42, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - "loc": Object { - "end": Object { - "column": 26, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, + }, }, - }, + ], "range": Array [ - 19, - 45, + 0, + 181, ], - "type": "ExpressionStatement", + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 3, + "line": 9, }, "start": Object { "column": 0, @@ -63068,14 +83751,14 @@ Object { }, "range": Array [ 0, - 46, + 182, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 8, "line": 1, }, "start": Object { @@ -63085,1008 +83768,781 @@ Object { }, "range": Array [ 0, - 5, + 8, ], "type": "Keyword", - "value": "const", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 30, "line": 1, }, "start": Object { - "column": 6, + "column": 9, "line": 1, }, }, "range": Array [ - 6, - 7, + 9, + 30, ], "type": "Identifier", - "value": "x", + "value": "processOptionalParens", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 31, "line": 1, }, "start": Object { - "column": 7, + "column": 30, "line": 1, }, }, "range": Array [ - 7, - 8, + 30, + 31, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 34, "line": 1, }, "start": Object { - "column": 9, + "column": 31, "line": 1, }, }, "range": Array [ - 9, - 10, + 31, + 34, ], "type": "Identifier", - "value": "X", + "value": "one", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 35, "line": 1, }, "start": Object { - "column": 10, + "column": 34, "line": 1, }, }, "range": Array [ - 10, - 11, + 34, + 35, ], "type": "Punctuator", - "value": "<", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 36, "line": 1, }, "start": Object { - "column": 11, + "column": 35, "line": 1, }, }, "range": Array [ - 11, - 16, + 35, + 36, ], - "type": "Identifier", - "value": "never", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 40, "line": 1, }, "start": Object { - "column": 16, + "column": 37, "line": 1, }, }, "range": Array [ - 16, - 17, + 37, + 40, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "any", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 41, "line": 1, }, "start": Object { - "column": 17, + "column": 40, "line": 1, }, }, "range": Array [ - 17, - 18, + 40, + 41, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 43, + "line": 1, }, "start": Object { - "column": 0, - "line": 2, + "column": 42, + "line": 1, }, }, "range": Array [ - 19, - 29, + 42, + 43, ], - "type": "Identifier", - "value": "Observable", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 3, "line": 2, }, "start": Object { - "column": 10, + "column": 2, "line": 2, }, }, "range": Array [ - 29, - 30, + 46, + 47, ], "type": "Punctuator", - "value": ".", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 6, "line": 2, }, "start": Object { - "column": 11, + "column": 3, "line": 2, }, }, "range": Array [ - 30, - 35, + 47, + 50, ], "type": "Identifier", - "value": "empty", + "value": "one", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 8, "line": 2, }, "start": Object { - "column": 16, + "column": 6, "line": 2, }, }, "range": Array [ - 35, - 36, + 50, + 52, ], "type": "Punctuator", - "value": "<", + "value": "?.", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 11, "line": 2, }, "start": Object { - "column": 17, + "column": 8, "line": 2, }, }, "range": Array [ - 36, - 41, + 52, + 55, ], "type": "Identifier", - "value": "never", + "value": "two", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 12, "line": 2, }, "start": Object { - "column": 22, + "column": 11, "line": 2, }, }, "range": Array [ - 41, - 42, + 55, + 56, ], "type": "Punctuator", - "value": ">", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 13, "line": 2, }, "start": Object { - "column": 23, + "column": 12, "line": 2, }, }, "range": Array [ - 42, - 43, + 56, + 57, ], "type": "Punctuator", - "value": "(", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 3, + "line": 3, }, "start": Object { - "column": 24, - "line": 2, + "column": 2, + "line": 3, }, }, "range": Array [ - 43, - 44, + 60, + 61, ], "type": "Punctuator", - "value": ")", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 2, + "column": 6, + "line": 3, }, "start": Object { - "column": 25, - "line": 2, + "column": 3, + "line": 3, }, }, "range": Array [ - 44, - 45, + 61, + 64, + ], + "type": "Identifier", + "value": "one", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 64, + 66, ], "type": "Punctuator", - "value": ";", + "value": "?.", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/non-null-assertion-operator.src 1`] = ` -Object { - "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "expression": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 19, - "line": 2, - }, - }, - "name": "e", - "range": Array [ - 56, - 57, - ], - "type": "Identifier", - }, - ], - "callee": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "validateEntity", - "range": Array [ - 41, - 55, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 41, - 58, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 41, - 59, - ], - "type": "ExpressionStatement", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "name": "s", - "range": Array [ - 68, - 69, - ], - "type": "Identifier", - }, - "init": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "object": Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "name": "e", - "range": Array [ - 72, - 73, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "range": Array [ - 72, - 74, - ], - "type": "TSNonNullExpression", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "name": "name", - "range": Array [ - 75, - 79, - ], - "type": "Identifier", - }, - "range": Array [ - 72, - 79, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 68, - 79, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "let", - "loc": Object { - "end": Object { - "column": 20, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 64, - 80, - ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 35, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, }, - "range": Array [ - 35, - 82, - ], - "type": "BlockStatement", }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, + "range": Array [ + 66, + 69, + ], + "type": "Identifier", + "value": "two", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, }, - "name": "processEntity", - "range": Array [ - 9, - 22, - ], - "type": "Identifier", }, + "range": Array [ + 69, + 70, + ], + "type": "Punctuator", + "value": ")", + }, + Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 13, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 12, + "line": 3, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "name": "e", - "optional": true, - "range": Array [ - 23, - 33, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 33, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "range": Array [ - 27, - 33, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "name": "Entity", - "range": Array [ - 27, - 33, - ], - "type": "Identifier", - }, - }, - }, + "range": Array [ + 70, + 71, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 71, + 76, + ], + "type": "Identifier", + "value": "three", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, }, - ], + }, "range": Array [ - 0, - 82, + 76, + 77, ], - "type": "FunctionDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ";", }, - }, - "range": Array [ - 0, - 82, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 3, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 2, + "line": 4, }, }, "range": Array [ - 0, - 8, + 80, + 81, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 6, + "line": 4, }, "start": Object { - "column": 9, - "line": 1, + "column": 3, + "line": 4, }, }, "range": Array [ - 9, - 22, + 81, + 84, ], "type": "Identifier", - "value": "processEntity", + "value": "one", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 7, + "line": 4, }, "start": Object { - "column": 22, - "line": 1, + "column": 6, + "line": 4, }, }, "range": Array [ - 22, - 23, + 84, + 85, ], "type": "Punctuator", - "value": "(", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 10, + "line": 4, }, "start": Object { - "column": 23, - "line": 1, + "column": 7, + "line": 4, }, }, "range": Array [ - 23, - 24, + 85, + 88, ], "type": "Identifier", - "value": "e", + "value": "two", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 12, + "line": 4, }, "start": Object { - "column": 24, - "line": 1, + "column": 10, + "line": 4, }, }, "range": Array [ - 24, - 25, + 88, + 90, ], "type": "Punctuator", - "value": "?", + "value": "?.", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 17, + "line": 4, }, "start": Object { - "column": 25, - "line": 1, + "column": 12, + "line": 4, }, }, "range": Array [ - 25, - 26, + 90, + 95, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "three", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 1, + "column": 18, + "line": 4, }, "start": Object { - "column": 27, - "line": 1, + "column": 17, + "line": 4, }, }, "range": Array [ - 27, - 33, + 95, + 96, ], - "type": "Identifier", - "value": "Entity", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 1, + "column": 19, + "line": 4, }, "start": Object { - "column": 33, - "line": 1, + "column": 18, + "line": 4, }, }, "range": Array [ - 33, - 34, + 96, + 97, ], "type": "Punctuator", - "value": ")", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 36, - "line": 1, + "column": 3, + "line": 5, }, "start": Object { - "column": 35, - "line": 1, + "column": 2, + "line": 5, }, }, "range": Array [ - 35, - 36, + 100, + 101, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 6, + "line": 5, }, "start": Object { - "column": 4, - "line": 2, + "column": 3, + "line": 5, }, }, "range": Array [ - 41, - 55, + 101, + 104, ], "type": "Identifier", - "value": "validateEntity", + "value": "one", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 7, + "line": 5, }, "start": Object { - "column": 18, - "line": 2, + "column": 6, + "line": 5, }, }, "range": Array [ - 55, - 56, + 104, + 105, ], "type": "Punctuator", - "value": "(", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 10, + "line": 5, }, "start": Object { - "column": 19, - "line": 2, + "column": 7, + "line": 5, }, }, "range": Array [ - 56, - 57, + 105, + 108, ], "type": "Identifier", - "value": "e", + "value": "two", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 2, + "column": 12, + "line": 5, }, "start": Object { - "column": 20, - "line": 2, + "column": 10, + "line": 5, }, }, "range": Array [ - 57, - 58, + 108, + 110, ], "type": "Punctuator", - "value": ")", + "value": "?.", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 17, + "line": 5, }, "start": Object { - "column": 21, - "line": 2, + "column": 12, + "line": 5, }, }, "range": Array [ - 58, - 59, + 110, + 115, + ], + "type": "Identifier", + "value": "three", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "range": Array [ + 115, + 116, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 19, + "line": 5, }, "start": Object { - "column": 4, - "line": 3, + "column": 18, + "line": 5, }, }, "range": Array [ - 64, - 67, + 116, + 117, ], - "type": "Keyword", - "value": "let", + "type": "Punctuator", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 3, + "column": 23, + "line": 5, }, "start": Object { - "column": 8, - "line": 3, + "column": 19, + "line": 5, }, }, "range": Array [ - 68, - 69, + 117, + 121, ], "type": "Identifier", - "value": "s", + "value": "four", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 3, + "column": 24, + "line": 5, }, "start": Object { - "column": 10, - "line": 3, + "column": 23, + "line": 5, }, }, "range": Array [ - 70, - 71, + 121, + 122, ], "type": "Punctuator", - "value": "=", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 3, + "column": 3, + "line": 6, }, "start": Object { - "column": 12, - "line": 3, + "column": 2, + "line": 6, }, }, "range": Array [ - 72, - 73, + 125, + 126, ], - "type": "Identifier", - "value": "e", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 3, + "column": 6, + "line": 6, }, "start": Object { - "column": 13, - "line": 3, + "column": 3, + "line": 6, }, }, "range": Array [ - 73, - 74, + 126, + 129, ], - "type": "Punctuator", - "value": "!", + "type": "Identifier", + "value": "one", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 7, + "line": 6, }, "start": Object { - "column": 14, - "line": 3, + "column": 6, + "line": 6, }, }, "range": Array [ - 74, - 75, + 129, + 130, ], "type": "Punctuator", "value": ".", @@ -64094,873 +84550,1224 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, - "line": 3, + "column": 10, + "line": 6, }, "start": Object { - "column": 15, - "line": 3, + "column": 7, + "line": 6, }, }, "range": Array [ - 75, - 79, + 130, + 133, ], "type": "Identifier", - "value": "name", + "value": "two", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 3, + "column": 12, + "line": 6, }, "start": Object { - "column": 19, - "line": 3, + "column": 10, + "line": 6, }, }, "range": Array [ - 79, - 80, + 133, + 135, ], "type": "Punctuator", - "value": ";", + "value": "?.", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 17, + "line": 6, }, "start": Object { - "column": 0, - "line": 4, + "column": 12, + "line": 6, }, }, "range": Array [ - 81, - 82, + 135, + 140, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "three", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/null-and-undefined-type-annotations.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 4, - 11, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 11, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 11, - ], - "type": "TSNullKeyword", - }, - }, - }, - "init": null, - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 11, - ], - "type": "VariableDeclarator", + "loc": Object { + "end": Object { + "column": 19, + "line": 6, + }, + "start": Object { + "column": 17, + "line": 6, }, + }, + "range": Array [ + 140, + 142, ], - "kind": "let", + "type": "Punctuator", + "value": "?.", + }, + Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 23, + "line": 6, }, "start": Object { - "column": 0, - "line": 1, + "column": 19, + "line": 6, }, }, "range": Array [ - 0, - 12, + 142, + 146, ], - "type": "VariableDeclaration", + "type": "Identifier", + "value": "four", }, Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "y", - "range": Array [ - 17, - 29, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "range": Array [ - 18, - 29, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 7, - "line": 2, - }, - }, - "range": Array [ - 20, - 29, - ], - "type": "TSUndefinedKeyword", - }, - }, - }, - "init": null, - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 17, - 29, - ], - "type": "VariableDeclarator", + "loc": Object { + "end": Object { + "column": 24, + "line": 6, + }, + "start": Object { + "column": 23, + "line": 6, }, + }, + "range": Array [ + 146, + 147, ], - "kind": "let", + "type": "Punctuator", + "value": ")", + }, + Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 25, + "line": 6, }, "start": Object { - "column": 0, - "line": 2, + "column": 24, + "line": 6, }, }, "range": Array [ - 13, - 30, + 147, + 148, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ";", }, - }, - "range": Array [ - 0, - 30, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { "column": 3, - "line": 1, + "line": 7, }, "start": Object { - "column": 0, - "line": 1, + "column": 2, + "line": 7, }, }, "range": Array [ - 0, - 3, + 151, + 152, ], - "type": "Keyword", - "value": "let", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 6, + "line": 7, }, "start": Object { - "column": 4, - "line": 1, + "column": 3, + "line": 7, }, }, "range": Array [ - 4, - 5, + 152, + 155, ], "type": "Identifier", - "value": "x", + "value": "one", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 7, + "line": 7, }, "start": Object { - "column": 5, - "line": 1, + "column": 6, + "line": 7, }, }, "range": Array [ - 5, - 6, + 155, + 156, ], "type": "Punctuator", - "value": ":", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 10, + "line": 7, }, "start": Object { "column": 7, - "line": 1, + "line": 7, }, }, "range": Array [ - 7, - 11, + 156, + 159, ], - "type": "Keyword", - "value": "null", + "type": "Identifier", + "value": "two", }, Object { "loc": Object { "end": Object { "column": 12, - "line": 1, + "line": 7, }, "start": Object { - "column": 11, - "line": 1, + "column": 10, + "line": 7, }, }, "range": Array [ - 11, - 12, + 159, + 161, ], "type": "Punctuator", - "value": ";", + "value": "?.", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 2, + "column": 17, + "line": 7, }, "start": Object { - "column": 0, - "line": 2, + "column": 12, + "line": 7, }, }, "range": Array [ - 13, - 16, + 161, + 166, ], - "type": "Keyword", - "value": "let", + "type": "Identifier", + "value": "three", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 19, + "line": 7, }, "start": Object { - "column": 4, - "line": 2, + "column": 17, + "line": 7, }, }, "range": Array [ - 17, - 18, + 166, + 168, + ], + "type": "Punctuator", + "value": "?.", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 7, + }, + "start": Object { + "column": 19, + "line": 7, + }, + }, + "range": Array [ + 168, + 172, ], "type": "Identifier", - "value": "y", + "value": "four", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 2, + "column": 24, + "line": 7, }, "start": Object { - "column": 5, - "line": 2, + "column": 23, + "line": 7, }, }, "range": Array [ - 18, - 19, + 172, + 173, ], "type": "Punctuator", - "value": ":", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 25, + "line": 7, }, "start": Object { - "column": 7, - "line": 2, + "column": 24, + "line": 7, }, }, "range": Array [ - 20, - 29, + 173, + 174, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 7, + }, + "start": Object { + "column": 25, + "line": 7, + }, + }, + "range": Array [ + 174, + 178, ], "type": "Identifier", - "value": "undefined", + "value": "five", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 30, + "line": 7, }, "start": Object { - "column": 16, - "line": 2, + "column": 29, + "line": 7, }, }, "range": Array [ - 29, - 30, + 178, + 179, ], "type": "Punctuator", "value": ";", }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 8, + }, + }, + "range": Array [ + 180, + 181, + ], + "type": "Punctuator", + "value": "}", + }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/object-with-escaped-properties.src 1`] = ` +exports[`typescript fixtures/basics/parenthesized-use-strict.src 1`] = ` Object { "body": Array [ Object { "expression": Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { "column": 1, - "line": 1, + "line": 2, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "range": Array [ - 3, - 7, - ], - "raw": "'__'", - "type": "Literal", - "value": "__", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 3, - 13, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 13, - ], - "raw": "null", - "type": "Literal", - "value": null, - }, - }, - ], "range": Array [ - 1, - 15, + 46, + 58, ], - "type": "ObjectExpression", + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", }, "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { "column": 0, - "line": 1, + "line": 2, }, }, "range": Array [ - 0, - 17, + 45, + 60, ], "type": "ExpressionStatement", }, + ], + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 45, + 60, + ], + "sourceType": "script", + "tokens": Array [ Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 1, - "line": 3, - }, + "loc": Object { + "end": Object { + "column": 1, + "line": 2, }, - "properties": Array [ + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 2, + }, + }, + "range": Array [ + 46, + 58, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/readonly-arrays.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ Object { - "computed": false, - "key": Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "arr", + "range": Array [ + 45, + 48, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "name": "slice", + "range": Array [ + 49, + 54, + ], + "type": "Identifier", + }, + "range": Array [ + 45, + 54, + ], + "type": "MemberExpression", + }, "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 13, + "line": 2, }, "start": Object { - "column": 3, - "line": 3, + "column": 2, + "line": 2, }, }, + "optional": false, "range": Array [ - 22, - 26, + 45, + 56, ], - "raw": "'__'", - "type": "Literal", - "value": "__", + "type": "CallExpression", }, - "kind": "init", "loc": Object { "end": Object { - "column": 12, - "line": 3, + "column": 14, + "line": 2, }, "start": Object { - "column": 3, - "line": 3, + "column": 2, + "line": 2, }, }, - "method": true, "range": Array [ - 22, - 31, + 45, + 57, ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 84, + 92, + ], + "raw": "\\"hello!\\"", + "type": "Literal", + "value": "hello!", + }, + ], + "callee": Object { + "computed": false, "loc": Object { "end": Object { - "column": 12, + "column": 10, "line": 3, }, "start": Object { - "column": 10, + "column": 2, "line": 3, }, }, + "object": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "name": "arr", + "range": Array [ + 75, + 78, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "name": "push", + "range": Array [ + 79, + 83, + ], + "type": "Identifier", + }, "range": Array [ - 29, - 31, + 75, + 83, ], - "type": "BlockStatement", + "type": "MemberExpression", }, - "expression": false, - "generator": false, - "id": null, "loc": Object { "end": Object { - "column": 12, + "column": 20, "line": 3, }, "start": Object { - "column": 7, + "column": 2, "line": 3, }, }, - "params": Array [], + "optional": false, "range": Array [ - 26, - 31, + 75, + 93, ], - "type": "FunctionExpression", + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, }, + "range": Array [ + 75, + 94, + ], + "type": "ExpressionStatement", }, ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, "range": Array [ - 20, - 33, + 41, + 106, ], - "type": "ObjectExpression", + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 1, + "line": 4, }, "start": Object { "column": 0, - "line": 3, + "line": 1, }, }, - "range": Array [ - 19, - 35, - ], - "type": "ExpressionStatement", - }, - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 5, - }, - "start": Object { - "column": 1, - "line": 5, - }, - }, - "properties": Array [ - Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, - "range": Array [ - 41, - 45, - ], - "raw": "'__'", - "type": "Literal", - "value": "__", + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, }, - "kind": "init", + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "arr", + "range": Array [ + 13, + 39, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 15, - "line": 5, + "column": 39, + "line": 1, }, "start": Object { - "column": 3, - "line": 5, + "column": 16, + "line": 1, }, }, - "method": false, "range": Array [ - 40, - 52, + 16, + 39, ], - "shorthand": false, - "type": "Property", - "value": Object { + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 15, - "line": 5, + "column": 39, + "line": 1, }, "start": Object { - "column": 11, - "line": 5, + "column": 18, + "line": 1, }, }, "range": Array [ - 48, - 52, + 18, + 39, ], - "raw": "null", - "type": "Literal", - "value": null, + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "ReadonlyArray", + "range": Array [ + 18, + 31, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "TSStringKeyword", + }, + ], + "range": Array [ + 31, + 39, + ], + "type": "TSTypeParameterInstantiation", + }, }, }, - ], - "range": Array [ - 38, - 54, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, }, - }, + ], "range": Array [ - 37, - 56, + 0, + 106, ], - "type": "ExpressionStatement", + "type": "FunctionDeclaration", }, Object { + "async": false, "body": Object { "body": Array [ Object { - "computed": false, - "key": Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 11, + "line": 7, + }, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 7, + }, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "name": "arr", + "range": Array [ + 149, + 152, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 7, + }, + "start": Object { + "column": 6, + "line": 7, + }, + }, + "name": "slice", + "range": Array [ + 153, + 158, + ], + "type": "Identifier", + }, + "range": Array [ + 149, + 158, + ], + "type": "MemberExpression", + }, "loc": Object { "end": Object { - "column": 14, + "column": 13, "line": 7, }, "start": Object { - "column": 10, + "column": 2, "line": 7, }, }, + "optional": false, "range": Array [ - 68, - 72, + 149, + 160, ], - "raw": "'__'", - "type": "Literal", - "value": "__", + "type": "CallExpression", }, "loc": Object { "end": Object { - "column": 21, + "column": 14, "line": 7, }, "start": Object { - "column": 10, + "column": 2, "line": 7, }, }, "range": Array [ - 68, - 79, + 149, + 161, ], - "static": false, - "type": "ClassProperty", - "value": Object { + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 8, + }, + "start": Object { + "column": 11, + "line": 8, + }, + }, + "range": Array [ + 188, + 196, + ], + "raw": "\\"hello!\\"", + "type": "Literal", + "value": "hello!", + }, + ], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 2, + "line": 8, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 8, + }, + "start": Object { + "column": 2, + "line": 8, + }, + }, + "name": "arr", + "range": Array [ + 179, + 182, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 6, + "line": 8, + }, + }, + "name": "push", + "range": Array [ + 183, + 187, + ], + "type": "Identifier", + }, + "range": Array [ + 179, + 187, + ], + "type": "MemberExpression", + }, "loc": Object { "end": Object { - "column": 21, - "line": 7, + "column": 20, + "line": 8, }, "start": Object { - "column": 17, - "line": 7, + "column": 2, + "line": 8, }, }, + "optional": false, "range": Array [ - 75, - 79, + 179, + 197, ], - "raw": "null", - "type": "Literal", - "value": null, + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 8, + }, + "start": Object { + "column": 2, + "line": 8, + }, }, + "range": Array [ + 179, + 198, + ], + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 23, - "line": 7, + "column": 1, + "line": 9, }, "start": Object { - "column": 8, - "line": 7, + "column": 37, + "line": 6, }, }, "range": Array [ - 66, - 81, + 145, + 210, ], - "type": "ClassBody", + "type": "BlockStatement", }, + "expression": false, + "generator": false, "id": Object { "loc": Object { "end": Object { - "column": 7, - "line": 7, + "column": 12, + "line": 6, }, "start": Object { - "column": 6, - "line": 7, + "column": 9, + "line": 6, }, }, - "name": "X", + "name": "foo", "range": Array [ - 64, - 65, + 117, + 120, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 23, - "line": 7, + "column": 1, + "line": 9, }, "start": Object { "column": 0, - "line": 7, + "line": 6, }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 6, + }, + "start": Object { + "column": 13, + "line": 6, + }, + }, + "name": "arr", + "range": Array [ + 121, + 143, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 6, + }, + "start": Object { + "column": 16, + "line": 6, + }, + }, + "range": Array [ + 124, + 143, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 6, + }, + "start": Object { + "column": 18, + "line": 6, + }, + }, + "operator": "readonly", + "range": Array [ + 126, + 143, + ], + "type": "TSTypeOperator", + "typeAnnotation": Object { + "elementType": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 6, + }, + "start": Object { + "column": 27, + "line": 6, + }, + }, + "range": Array [ + 135, + 141, + ], + "type": "TSStringKeyword", + }, + "loc": Object { + "end": Object { + "column": 35, + "line": 6, + }, + "start": Object { + "column": 27, + "line": 6, + }, + }, + "range": Array [ + 135, + 143, + ], + "type": "TSArrayType", + }, + }, + }, + }, + ], "range": Array [ - 58, - 81, + 108, + 210, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 8, + "line": 10, }, "start": Object { "column": 0, @@ -64969,14 +85776,14 @@ Object { }, "range": Array [ 0, - 82, + 211, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 8, "line": 1, }, "start": Object { @@ -64986,69 +85793,15 @@ Object { }, "range": Array [ 0, - 1, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "range": Array [ - 1, - 2, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "range": Array [ - 3, - 7, - ], - "type": "String", - "value": "'__'", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, 8, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 12, "line": 1, }, "start": Object { @@ -65058,28 +85811,28 @@ Object { }, "range": Array [ 9, - 13, + 12, ], - "type": "Keyword", - "value": "null", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 13, "line": 1, }, "start": Object { - "column": 14, + "column": 12, "line": 1, }, }, "range": Array [ - 14, - 15, + 12, + 13, ], "type": "Punctuator", - "value": "}", + "value": "(", }, Object { "loc": Object { @@ -65088,16 +85841,16 @@ Object { "line": 1, }, "start": Object { - "column": 15, + "column": 13, "line": 1, }, }, "range": Array [ - 15, + 13, 16, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "arr", }, Object { "loc": Object { @@ -65115,215 +85868,71 @@ Object { 17, ], "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 19, - 20, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 3, - }, - "start": Object { - "column": 1, - "line": 3, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 3, - "line": 3, - }, - }, - "range": Array [ - 22, - 26, - ], - "type": "String", - "value": "'__'", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 3, - }, - }, - "range": Array [ - 26, - 27, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 27, - 28, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 3, - }, - }, - "range": Array [ - 29, - 30, - ], - "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 3, + "column": 31, + "line": 1, }, "start": Object { - "column": 11, - "line": 3, + "column": 18, + "line": 1, }, }, "range": Array [ - 30, + 18, 31, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "ReadonlyArray", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 3, + "column": 32, + "line": 1, }, "start": Object { - "column": 13, - "line": 3, + "column": 31, + "line": 1, }, }, "range": Array [ + 31, 32, - 33, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "range": Array [ - 33, - 34, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "range": Array [ - 34, - 35, ], "type": "Punctuator", - "value": ";", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 38, + "line": 1, }, "start": Object { - "column": 0, - "line": 5, + "column": 32, + "line": 1, }, }, "range": Array [ - 37, + 32, 38, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 5, + "column": 39, + "line": 1, }, "start": Object { - "column": 1, - "line": 5, + "column": 38, + "line": 1, }, }, "range": Array [ @@ -65331,130 +85940,130 @@ Object { 39, ], "type": "Punctuator", - "value": "{", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 5, + "column": 40, + "line": 1, }, "start": Object { - "column": 3, - "line": 5, + "column": 39, + "line": 1, }, }, "range": Array [ + 39, 40, - 41, ], "type": "Punctuator", - "value": "[", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 5, + "column": 42, + "line": 1, }, "start": Object { - "column": 4, - "line": 5, + "column": 41, + "line": 1, }, }, "range": Array [ 41, - 45, + 42, ], - "type": "String", - "value": "'__'", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 5, + "line": 2, }, "start": Object { - "column": 8, - "line": 5, + "column": 2, + "line": 2, }, }, "range": Array [ 45, - 46, + 48, ], - "type": "Punctuator", - "value": "]", + "type": "Identifier", + "value": "arr", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 5, + "column": 6, + "line": 2, }, "start": Object { - "column": 9, - "line": 5, + "column": 5, + "line": 2, }, }, "range": Array [ - 46, - 47, + 48, + 49, ], "type": "Punctuator", - "value": ":", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 5, + "column": 11, + "line": 2, }, "start": Object { - "column": 11, - "line": 5, + "column": 6, + "line": 2, }, }, "range": Array [ - 48, - 52, + 49, + 54, ], - "type": "Keyword", - "value": "null", + "type": "Identifier", + "value": "slice", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 5, + "column": 12, + "line": 2, }, "start": Object { - "column": 16, - "line": 5, + "column": 11, + "line": 2, }, }, "range": Array [ - 53, 54, + 55, ], "type": "Punctuator", - "value": "}", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 5, + "column": 13, + "line": 2, }, "start": Object { - "column": 17, - "line": 5, + "column": 12, + "line": 2, }, }, "range": Array [ - 54, 55, + 56, ], "type": "Punctuator", "value": ")", @@ -65462,17 +86071,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, - "line": 5, + "column": 14, + "line": 2, }, "start": Object { - "column": 18, - "line": 5, + "column": 13, + "line": 2, }, }, "range": Array [ - 55, 56, + 57, ], "type": "Punctuator", "value": ";", @@ -65481,984 +86090,178 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 7, + "line": 3, }, "start": Object { - "column": 0, - "line": 7, + "column": 2, + "line": 3, }, }, "range": Array [ - 58, - 63, + 75, + 78, ], - "type": "Keyword", - "value": "class", + "type": "Identifier", + "value": "arr", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 7, + "column": 6, + "line": 3, }, "start": Object { - "column": 6, - "line": 7, + "column": 5, + "line": 3, }, }, "range": Array [ - 64, - 65, + 78, + 79, ], - "type": "Identifier", - "value": "X", + "type": "Punctuator", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 7, + "column": 10, + "line": 3, }, "start": Object { - "column": 8, - "line": 7, + "column": 6, + "line": 3, }, }, "range": Array [ - 66, - 67, + 79, + 83, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "push", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 7, + "column": 11, + "line": 3, }, "start": Object { "column": 10, - "line": 7, + "line": 3, }, }, "range": Array [ - 68, - 72, + 83, + 84, ], - "type": "String", - "value": "'__'", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 7, + "column": 19, + "line": 3, }, "start": Object { - "column": 15, - "line": 7, + "column": 11, + "line": 3, }, }, "range": Array [ - 73, - 74, + 84, + 92, ], - "type": "Punctuator", - "value": "=", + "type": "String", + "value": "\\"hello!\\"", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 7, + "column": 20, + "line": 3, }, "start": Object { - "column": 17, - "line": 7, + "column": 19, + "line": 3, }, }, "range": Array [ - 75, - 79, + 92, + 93, ], - "type": "Keyword", - "value": "null", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 7, + "column": 21, + "line": 3, }, "start": Object { - "column": 22, - "line": 7, + "column": 20, + "line": 3, }, }, "range": Array [ - 80, - 81, + 93, + 94, ], "type": "Punctuator", - "value": "}", + "value": ";", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/object-with-typed-methods.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 13, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 16, - 29, - ], - "raw": "\\"constructor\\"", - "type": "Literal", - "value": "constructor", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 3, - "line": 4, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "method": true, - "range": Array [ - 16, - 61, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 11, - "line": 3, - }, - }, - "range": Array [ - 56, - 57, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 49, - 57, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 3, - "line": 4, - }, - "start": Object { - "column": 29, - "line": 2, - }, - }, - "range": Array [ - 43, - 61, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 3, - "line": 4, - }, - "start": Object { - "column": 15, - "line": 2, - }, - }, - "params": Array [], - "range": Array [ - 29, - 61, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 2, - }, - "start": Object { - "column": 20, - "line": 2, - }, - }, - "range": Array [ - 34, - 42, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 2, - }, - "start": Object { - "column": 22, - "line": 2, - }, - }, - "range": Array [ - 36, - 42, - ], - "type": "TSNumberKeyword", - }, - }, - "type": "FunctionExpression", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 2, - }, - "start": Object { - "column": 15, - "line": 2, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "name": "T", - "range": Array [ - 30, - 31, - ], - "type": "Identifier", - }, - "range": Array [ - 30, - 31, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 29, - 32, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 5, - }, - "start": Object { - "column": 2, - "line": 5, - }, - }, - "name": "foo", - "range": Array [ - 65, - 68, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 3, - "line": 7, - }, - "start": Object { - "column": 2, - "line": 5, - }, - }, - "method": true, - "range": Array [ - 65, - 100, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 6, - }, - "start": Object { - "column": 11, - "line": 6, - }, - }, - "range": Array [ - 95, - 96, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "loc": Object { - "end": Object { - "column": 12, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "range": Array [ - 88, - 96, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 3, - "line": 7, - }, - "start": Object { - "column": 19, - "line": 5, - }, - }, - "range": Array [ - 82, - 100, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 3, - "line": 7, - }, - "start": Object { - "column": 5, - "line": 5, - }, - }, - "params": Array [], - "range": Array [ - 68, - 100, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 5, - }, - "start": Object { - "column": 10, - "line": 5, - }, - }, - "range": Array [ - 73, - 81, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 5, - }, - "start": Object { - "column": 12, - "line": 5, - }, - }, - "range": Array [ - 75, - 81, - ], - "type": "TSNumberKeyword", - }, - }, - "type": "FunctionExpression", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 5, - }, - "start": Object { - "column": 5, - "line": 5, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 5, - }, - "start": Object { - "column": 6, - "line": 5, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 5, - }, - "start": Object { - "column": 6, - "line": 5, - }, - }, - "name": "T", - "range": Array [ - 69, - 70, - ], - "type": "Identifier", - }, - "range": Array [ - 69, - 70, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 68, - 71, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 8, - }, - "start": Object { - "column": 6, - "line": 8, - }, - }, - "name": "a", - "range": Array [ - 108, - 109, - ], - "type": "Identifier", - }, - "kind": "get", - "loc": Object { - "end": Object { - "column": 3, - "line": 10, - }, - "start": Object { - "column": 2, - "line": 8, - }, - }, - "method": false, - "range": Array [ - 104, - 138, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 9, - }, - "start": Object { - "column": 11, - "line": 9, - }, - }, - "range": Array [ - 133, - 134, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "loc": Object { - "end": Object { - "column": 12, - "line": 9, - }, - "start": Object { - "column": 4, - "line": 9, - }, - }, - "range": Array [ - 126, - 134, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 3, - "line": 10, - }, - "start": Object { - "column": 18, - "line": 8, - }, - }, - "range": Array [ - 120, - 138, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 3, - "line": 10, - }, - "start": Object { - "column": 7, - "line": 8, - }, - }, - "params": Array [], - "range": Array [ - 109, - 138, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 8, - }, - "start": Object { - "column": 9, - "line": 8, - }, - }, - "range": Array [ - 111, - 119, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 8, - }, - "start": Object { - "column": 11, - "line": 8, - }, - }, - "range": Array [ - 113, - 119, - ], - "type": "TSNumberKeyword", - }, - }, - "type": "FunctionExpression", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 11, - }, - "start": Object { - "column": 6, - "line": 11, - }, - }, - "name": "a", - "range": Array [ - 146, - 147, - ], - "type": "Identifier", - }, - "kind": "set", - "loc": Object { - "end": Object { - "column": 3, - "line": 12, - }, - "start": Object { - "column": 2, - "line": 11, - }, - }, - "method": false, - "range": Array [ - 142, - 172, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 3, - "line": 12, - }, - "start": Object { - "column": 27, - "line": 11, - }, - }, - "range": Array [ - 167, - 172, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 3, - "line": 12, - }, - "start": Object { - "column": 7, - "line": 11, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 11, - }, - "start": Object { - "column": 8, - "line": 11, - }, - }, - "name": "x", - "range": Array [ - 148, - 157, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 11, - }, - "start": Object { - "column": 9, - "line": 11, - }, - }, - "range": Array [ - 149, - 157, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 11, - }, - "start": Object { - "column": 11, - "line": 11, - }, - }, - "range": Array [ - 151, - 157, - ], - "type": "TSNumberKeyword", - }, - }, - }, - ], - "range": Array [ - 147, - 172, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 11, - }, - "start": Object { - "column": 18, - "line": 11, - }, - }, - "range": Array [ - 158, - 166, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 11, - }, - "start": Object { - "column": 20, - "line": 11, - }, - }, - "range": Array [ - 160, - 166, - ], - "type": "TSNumberKeyword", - }, - }, - "type": "FunctionExpression", - }, - }, - ], - "range": Array [ - 12, - 174, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 13, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 174, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", "loc": Object { "end": Object { - "column": 2, - "line": 13, + "column": 1, + "line": 4, }, "start": Object { "column": 0, - "line": 1, + "line": 4, }, }, "range": Array [ - 0, - 175, + 105, + 106, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 14, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "}", }, - }, - "range": Array [ - 0, - 176, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 8, + "line": 6, }, "start": Object { "column": 0, - "line": 1, + "line": 6, }, }, "range": Array [ - 0, - 5, + 108, + 116, ], "type": "Keyword", - "value": "const", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 12, + "line": 6, }, "start": Object { - "column": 6, - "line": 1, + "column": 9, + "line": 6, }, }, "range": Array [ - 6, - 9, + 117, + 120, ], "type": "Identifier", "value": "foo", @@ -66466,143 +86269,143 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 13, + "line": 6, }, "start": Object { - "column": 10, - "line": 1, + "column": 12, + "line": 6, }, }, "range": Array [ - 10, - 11, + 120, + 121, ], "type": "Punctuator", - "value": "=", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 16, + "line": 6, }, "start": Object { - "column": 12, - "line": 1, + "column": 13, + "line": 6, }, }, "range": Array [ - 12, - 13, + 121, + 124, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "arr", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 17, + "line": 6, }, "start": Object { - "column": 2, - "line": 2, + "column": 16, + "line": 6, }, }, "range": Array [ - 16, - 29, + 124, + 125, ], - "type": "String", - "value": "\\"constructor\\"", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 26, + "line": 6, }, "start": Object { - "column": 15, - "line": 2, + "column": 18, + "line": 6, }, }, "range": Array [ - 29, - 30, + 126, + 134, ], - "type": "Punctuator", - "value": "<", + "type": "Identifier", + "value": "readonly", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 33, + "line": 6, }, "start": Object { - "column": 16, - "line": 2, + "column": 27, + "line": 6, }, }, "range": Array [ - 30, - 31, + 135, + 141, ], "type": "Identifier", - "value": "T", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 34, + "line": 6, }, "start": Object { - "column": 17, - "line": 2, + "column": 33, + "line": 6, }, }, "range": Array [ - 31, - 32, + 141, + 142, ], "type": "Punctuator", - "value": ">", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 35, + "line": 6, }, "start": Object { - "column": 18, - "line": 2, + "column": 34, + "line": 6, }, }, "range": Array [ - 32, - 33, + 142, + 143, ], "type": "Punctuator", - "value": "(", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 36, + "line": 6, }, "start": Object { - "column": 19, - "line": 2, + "column": 35, + "line": 6, }, }, "range": Array [ - 33, - 34, + 143, + 144, ], "type": "Punctuator", "value": ")", @@ -66610,233 +86413,233 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, - "line": 2, + "column": 38, + "line": 6, }, "start": Object { - "column": 20, - "line": 2, + "column": 37, + "line": 6, }, }, "range": Array [ - 34, - 35, + 145, + 146, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 2, + "column": 5, + "line": 7, }, "start": Object { - "column": 22, - "line": 2, + "column": 2, + "line": 7, }, }, "range": Array [ - 36, - 42, + 149, + 152, ], "type": "Identifier", - "value": "number", + "value": "arr", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 2, + "column": 6, + "line": 7, }, "start": Object { - "column": 29, - "line": 2, + "column": 5, + "line": 7, }, }, "range": Array [ - 43, - 44, + 152, + 153, ], "type": "Punctuator", - "value": "{", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 3, + "column": 11, + "line": 7, }, "start": Object { - "column": 4, - "line": 3, + "column": 6, + "line": 7, }, }, "range": Array [ - 49, - 55, + 153, + 158, ], - "type": "Keyword", - "value": "return", + "type": "Identifier", + "value": "slice", }, Object { "loc": Object { "end": Object { "column": 12, - "line": 3, + "line": 7, }, "start": Object { "column": 11, - "line": 3, + "line": 7, }, }, "range": Array [ - 56, - 57, + 158, + 159, ], - "type": "Numeric", - "value": "1", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 4, + "column": 13, + "line": 7, }, "start": Object { - "column": 2, - "line": 4, + "column": 12, + "line": 7, }, }, "range": Array [ - 60, - 61, + 159, + 160, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 4, + "column": 14, + "line": 7, }, "start": Object { - "column": 3, - "line": 4, + "column": 13, + "line": 7, }, }, "range": Array [ - 61, - 62, + 160, + 161, ], "type": "Punctuator", - "value": ",", + "value": ";", }, Object { "loc": Object { "end": Object { "column": 5, - "line": 5, + "line": 8, }, "start": Object { "column": 2, - "line": 5, + "line": 8, }, }, "range": Array [ - 65, - 68, + 179, + 182, ], "type": "Identifier", - "value": "foo", + "value": "arr", }, Object { "loc": Object { "end": Object { "column": 6, - "line": 5, + "line": 8, }, "start": Object { "column": 5, - "line": 5, + "line": 8, }, }, "range": Array [ - 68, - 69, + 182, + 183, ], "type": "Punctuator", - "value": "<", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 5, + "column": 10, + "line": 8, }, "start": Object { "column": 6, - "line": 5, + "line": 8, }, }, "range": Array [ - 69, - 70, + 183, + 187, ], "type": "Identifier", - "value": "T", + "value": "push", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 5, + "column": 11, + "line": 8, }, "start": Object { - "column": 7, - "line": 5, + "column": 10, + "line": 8, }, }, "range": Array [ - 70, - 71, + 187, + 188, ], "type": "Punctuator", - "value": ">", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 19, + "line": 8, }, "start": Object { - "column": 8, - "line": 5, + "column": 11, + "line": 8, }, }, "range": Array [ - 71, - 72, + 188, + 196, ], - "type": "Punctuator", - "value": "(", + "type": "String", + "value": "\\"hello!\\"", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 5, + "column": 20, + "line": 8, }, "start": Object { - "column": 9, - "line": 5, + "column": 19, + "line": 8, }, }, "range": Array [ - 72, - 73, + 196, + 197, ], "type": "Punctuator", "value": ")", @@ -66844,918 +86647,1070 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, - "line": 5, + "column": 21, + "line": 8, }, "start": Object { - "column": 10, - "line": 5, + "column": 20, + "line": 8, }, }, "range": Array [ - 73, - 74, + 197, + 198, ], "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 5, - }, - "start": Object { - "column": 12, - "line": 5, - }, - }, - "range": Array [ - 75, - 81, - ], - "type": "Identifier", - "value": "number", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 5, + "column": 1, + "line": 9, }, "start": Object { - "column": 19, - "line": 5, + "column": 0, + "line": 9, }, }, "range": Array [ - 82, - 83, + 209, + 210, ], "type": "Punctuator", - "value": "{", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/readonly-tuples.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 6, + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "computed": true, + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "name": "pair", + "range": Array [ + 62, + 66, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 67, + 68, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "range": Array [ + 62, + 69, + ], + "type": "MemberExpression", + }, + ], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "console", + "range": Array [ + 50, + 57, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "name": "log", + "range": Array [ + 58, + 61, + ], + "type": "Identifier", + }, + "range": Array [ + 50, + 61, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "optional": false, + "range": Array [ + 50, + 70, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 50, + 71, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "left": Object { + "computed": true, + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "name": "pair", + "range": Array [ + 84, + 88, + ], + "type": "Identifier", + }, + "optional": false, + "property": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 89, + 90, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "range": Array [ + 84, + 91, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "operator": "=", + "range": Array [ + 84, + 102, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 94, + 102, + ], + "raw": "\\"hello!\\"", + "type": "Literal", + "value": "hello!", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 84, + 103, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 46, + "line": 1, + }, }, - "start": Object { - "column": 4, - "line": 6, + "range": Array [ + 46, + 118, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, }, + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", }, - "range": Array [ - 88, - 94, - ], - "type": "Keyword", - "value": "return", - }, - Object { "loc": Object { "end": Object { - "column": 12, - "line": 6, + "column": 1, + "line": 4, }, "start": Object { - "column": 11, - "line": 6, + "column": 0, + "line": 1, }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "pair", + "range": Array [ + 13, + 44, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 44, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "operator": "readonly", + "range": Array [ + 19, + 44, + ], + "type": "TSTypeOperator", + "typeAnnotation": Object { + "elementTypes": Array [ + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 35, + ], + "type": "TSStringKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 43, + ], + "type": "TSStringKeyword", + }, + ], + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 44, + ], + "type": "TSTupleType", + }, + }, + }, + }, + ], "range": Array [ - 95, - 96, + 0, + 118, ], - "type": "Numeric", - "value": "1", + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 119, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, - "line": 7, + "column": 8, + "line": 1, }, "start": Object { - "column": 2, - "line": 7, + "column": 0, + "line": 1, }, }, "range": Array [ - 99, - 100, + 0, + 8, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 7, + "column": 12, + "line": 1, }, "start": Object { - "column": 3, - "line": 7, + "column": 9, + "line": 1, }, }, "range": Array [ - 100, - 101, + 9, + 12, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 8, + "column": 13, + "line": 1, }, "start": Object { - "column": 2, - "line": 8, + "column": 12, + "line": 1, }, }, "range": Array [ - 104, - 107, + 12, + 13, ], - "type": "Identifier", - "value": "get", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 8, + "column": 17, + "line": 1, }, "start": Object { - "column": 6, - "line": 8, + "column": 13, + "line": 1, }, }, "range": Array [ - 108, - 109, + 13, + 17, ], "type": "Identifier", - "value": "a", + "value": "pair", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 8, + "column": 18, + "line": 1, }, "start": Object { - "column": 7, - "line": 8, + "column": 17, + "line": 1, }, }, "range": Array [ - 109, - 110, + 17, + 18, ], "type": "Punctuator", - "value": "(", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 8, + "column": 27, + "line": 1, }, "start": Object { - "column": 8, - "line": 8, + "column": 19, + "line": 1, }, }, "range": Array [ - 110, - 111, + 19, + 27, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "readonly", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 8, + "column": 29, + "line": 1, }, "start": Object { - "column": 9, - "line": 8, + "column": 28, + "line": 1, }, }, "range": Array [ - 111, - 112, + 28, + 29, ], "type": "Punctuator", - "value": ":", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 8, + "column": 35, + "line": 1, }, "start": Object { - "column": 11, - "line": 8, + "column": 29, + "line": 1, }, }, "range": Array [ - 113, - 119, + 29, + 35, ], "type": "Identifier", - "value": "number", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 8, + "column": 36, + "line": 1, }, "start": Object { - "column": 18, - "line": 8, + "column": 35, + "line": 1, }, }, "range": Array [ - 120, - 121, + 35, + 36, ], "type": "Punctuator", - "value": "{", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 9, + "column": 43, + "line": 1, }, "start": Object { - "column": 4, - "line": 9, + "column": 37, + "line": 1, }, }, "range": Array [ - 126, - 132, + 37, + 43, ], - "type": "Keyword", - "value": "return", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 9, + "column": 44, + "line": 1, }, "start": Object { - "column": 11, - "line": 9, + "column": 43, + "line": 1, }, }, "range": Array [ - 133, - 134, + 43, + 44, ], - "type": "Numeric", - "value": "1", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 10, + "column": 45, + "line": 1, }, "start": Object { - "column": 2, - "line": 10, + "column": 44, + "line": 1, }, }, "range": Array [ - 137, - 138, + 44, + 45, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 10, + "column": 47, + "line": 1, }, "start": Object { - "column": 3, - "line": 10, + "column": 46, + "line": 1, }, }, "range": Array [ - 138, - 139, + 46, + 47, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 11, + "column": 9, + "line": 2, }, "start": Object { "column": 2, - "line": 11, + "line": 2, }, }, "range": Array [ - 142, - 145, + 50, + 57, ], "type": "Identifier", - "value": "set", + "value": "console", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 11, + "column": 10, + "line": 2, }, "start": Object { - "column": 6, - "line": 11, + "column": 9, + "line": 2, }, }, "range": Array [ - 146, - 147, + 57, + 58, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 11, + "column": 13, + "line": 2, }, "start": Object { - "column": 7, - "line": 11, + "column": 10, + "line": 2, }, }, "range": Array [ - 147, - 148, + 58, + 61, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "log", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 11, + "column": 14, + "line": 2, }, "start": Object { - "column": 8, - "line": 11, + "column": 13, + "line": 2, }, }, "range": Array [ - 148, - 149, + 61, + 62, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 11, + "column": 18, + "line": 2, }, "start": Object { - "column": 9, - "line": 11, + "column": 14, + "line": 2, }, }, - "range": Array [ - 149, - 150, + "range": Array [ + 62, + 66, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "pair", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 11, + "column": 19, + "line": 2, }, "start": Object { - "column": 11, - "line": 11, + "column": 18, + "line": 2, }, }, "range": Array [ - 151, - 157, + 66, + 67, ], - "type": "Identifier", - "value": "number", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 11, + "column": 20, + "line": 2, }, "start": Object { - "column": 17, - "line": 11, + "column": 19, + "line": 2, }, }, "range": Array [ - 157, - 158, + 67, + 68, ], - "type": "Punctuator", - "value": ")", + "type": "Numeric", + "value": "0", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 11, + "column": 21, + "line": 2, }, "start": Object { - "column": 18, - "line": 11, + "column": 20, + "line": 2, }, }, "range": Array [ - 158, - 159, + 68, + 69, ], "type": "Punctuator", - "value": ":", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 11, + "column": 22, + "line": 2, }, "start": Object { - "column": 20, - "line": 11, + "column": 21, + "line": 2, }, }, "range": Array [ - 160, - 166, + 69, + 70, ], - "type": "Identifier", - "value": "number", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 11, + "column": 23, + "line": 2, }, "start": Object { - "column": 27, - "line": 11, + "column": 22, + "line": 2, }, }, "range": Array [ - 167, - 168, + 70, + 71, ], "type": "Punctuator", - "value": "{", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 12, + "column": 6, + "line": 3, }, "start": Object { "column": 2, - "line": 12, + "line": 3, }, }, "range": Array [ - 171, - 172, + 84, + 88, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "pair", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 13, + "column": 7, + "line": 3, }, "start": Object { - "column": 0, - "line": 13, + "column": 6, + "line": 3, }, }, "range": Array [ - 173, - 174, + 88, + 89, ], "type": "Punctuator", - "value": "}", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 13, + "column": 8, + "line": 3, }, "start": Object { - "column": 1, - "line": 13, + "column": 7, + "line": 3, }, }, "range": Array [ - 174, - 175, + 89, + 90, ], - "type": "Punctuator", - "value": ";", + "type": "Numeric", + "value": "1", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/parenthesized-use-strict.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 1, - "line": 2, - }, - }, - "range": Array [ - 46, - 58, - ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", - }, "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 9, + "line": 3, }, "start": Object { - "column": 0, - "line": 2, + "column": 8, + "line": 3, }, }, "range": Array [ - 45, - 60, + 90, + 91, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, + "type": "Punctuator", + "value": "]", }, - }, - "range": Array [ - 45, - 60, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, - "line": 2, + "column": 11, + "line": 3, }, "start": Object { - "column": 0, - "line": 2, + "column": 10, + "line": 3, }, }, "range": Array [ - 45, - 46, + 92, + 93, ], "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 2, + "column": 20, + "line": 3, }, "start": Object { - "column": 1, - "line": 2, + "column": 12, + "line": 3, }, }, "range": Array [ - 46, - 58, + 94, + 102, ], "type": "String", - "value": "\\"use strict\\"", + "value": "\\"hello!\\"", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 21, + "line": 3, }, "start": Object { - "column": 13, - "line": 2, + "column": 20, + "line": 3, }, }, "range": Array [ - 58, - 59, + 102, + 103, ], "type": "Punctuator", - "value": ")", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 1, + "line": 4, }, "start": Object { - "column": 14, - "line": 2, + "column": 0, + "line": 4, }, }, "range": Array [ - 59, - 60, + 117, + 118, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/readonly-arrays.src 1`] = ` +exports[`typescript fixtures/basics/symbol-type-param.src 1`] = ` Object { "body": Array [ Object { "async": false, "body": Object { - "body": Array [ - Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "name": "arr", - "range": Array [ - 45, - 48, - ], - "type": "Identifier", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 6, - "line": 2, - }, - }, - "name": "slice", - "range": Array [ - 49, - 54, - ], - "type": "Identifier", - }, - "range": Array [ - 45, - 54, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 45, - 56, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 45, - 57, - ], - "type": "ExpressionStatement", - }, - Object { - "expression": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 11, - "line": 3, - }, - }, - "range": Array [ - 84, - 92, - ], - "raw": "\\"hello!\\"", - "type": "Literal", - "value": "hello!", - }, - ], - "callee": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 10, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "name": "arr", - "range": Array [ - 75, - 78, - ], - "type": "Identifier", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "name": "push", - "range": Array [ - 79, - 83, - ], - "type": "Identifier", - }, - "range": Array [ - 75, - 83, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 20, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "range": Array [ - 75, - 93, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "range": Array [ - 75, - 94, - ], - "type": "ExpressionStatement", - }, - ], + "body": Array [], "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 42, + "line": 1, }, "start": Object { - "column": 41, + "column": 40, "line": 1, }, }, "range": Array [ - 41, - 106, + 40, + 42, ], "type": "BlockStatement", }, @@ -67764,7 +87719,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 12, + "column": 13, "line": 1, }, "start": Object { @@ -67772,17 +87727,17 @@ Object { "line": 1, }, }, - "name": "foo", + "name": "test", "range": Array [ 9, - 12, + 13, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 42, + "line": 1, }, "start": Object { "column": 0, @@ -67793,78 +87748,78 @@ Object { Object { "loc": Object { "end": Object { - "column": 39, + "column": 38, "line": 1, }, "start": Object { - "column": 13, + "column": 14, "line": 1, }, }, - "name": "arr", + "name": "abc", "range": Array [ - 13, - 39, + 14, + 38, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 39, + "column": 38, "line": 1, }, "start": Object { - "column": 16, + "column": 17, "line": 1, }, }, "range": Array [ - 16, - 39, + 17, + 38, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 39, + "column": 38, "line": 1, }, "start": Object { - "column": 18, + "column": 19, "line": 1, }, }, "range": Array [ - 18, - 39, + 19, + 38, ], "type": "TSTypeReference", "typeName": Object { "loc": Object { "end": Object { - "column": 31, + "column": 22, "line": 1, }, "start": Object { - "column": 18, + "column": 19, "line": 1, }, }, - "name": "ReadonlyArray", + "name": "Map", "range": Array [ - 18, - 31, + 19, + 22, ], "type": "Identifier", }, "typeParameters": Object { "loc": Object { "end": Object { - "column": 39, + "column": 38, "line": 1, }, "start": Object { - "column": 31, + "column": 22, "line": 1, }, }, @@ -67872,24 +87827,41 @@ Object { Object { "loc": Object { "end": Object { - "column": 38, + "column": 29, "line": 1, }, "start": Object { - "column": 32, + "column": 23, "line": 1, }, }, "range": Array [ - 32, - 38, + 23, + 29, + ], + "type": "TSSymbolKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 37, ], "type": "TSStringKeyword", }, ], "range": Array [ - 31, - 39, + 22, + 38, ], "type": "TSTypeParameterInstantiation", }, @@ -67899,359 +87871,524 @@ Object { ], "range": Array [ 0, - 106, + 42, ], "type": "FunctionDeclaration", }, + ], + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 42, + ], + "sourceType": "script", + "tokens": Array [ Object { - "async": false, - "body": Object { - "body": Array [ + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 13, + ], + "type": "Identifier", + "value": "test", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "abc", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + "value": "Map", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 29, + ], + "type": "Identifier", + "value": "symbol", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/type-alias-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Result", + "range": Array [ + 5, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 37, + ], + "type": "TSUnionType", + "types": Array [ Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 11, - "line": 7, - }, - "start": Object { - "column": 2, - "line": 7, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 7, - }, - "start": Object { - "column": 2, - "line": 7, - }, - }, - "name": "arr", - "range": Array [ - 149, - 152, - ], - "type": "Identifier", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 7, - }, - "start": Object { - "column": 6, - "line": 7, - }, - }, - "name": "slice", - "range": Array [ - 153, - 158, - ], - "type": "Identifier", - }, - "range": Array [ - 149, - 158, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 7, - }, - "start": Object { - "column": 2, - "line": 7, - }, - }, - "range": Array [ - 149, - 160, - ], - "type": "CallExpression", - }, "loc": Object { "end": Object { - "column": 14, - "line": 7, + "column": 27, + "line": 1, }, "start": Object { - "column": 2, - "line": 7, + "column": 17, + "line": 1, }, }, "range": Array [ - 149, - 161, + 17, + 27, ], - "type": "ExpressionStatement", - }, - Object { - "expression": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 8, - }, - "start": Object { - "column": 11, - "line": 8, - }, - }, - "range": Array [ - 188, - 196, - ], - "raw": "\\"hello!\\"", - "type": "Literal", - "value": "hello!", + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, }, - ], - "callee": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 10, - "line": 8, - }, - "start": Object { - "column": 2, - "line": 8, - }, + "start": Object { + "column": 17, + "line": 1, }, - "object": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 8, - }, - "start": Object { - "column": 2, - "line": 8, - }, - }, - "name": "arr", - "range": Array [ - 179, - 182, - ], - "type": "Identifier", + }, + "name": "Success", + "range": Array [ + 17, + 24, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, }, - "property": Object { + "start": Object { + "column": 24, + "line": 1, + }, + }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 10, - "line": 8, + "column": 26, + "line": 1, }, "start": Object { - "column": 6, - "line": 8, + "column": 25, + "line": 1, }, }, - "name": "push", "range": Array [ - 183, - 187, + 25, + 26, ], - "type": "Identifier", - }, - "range": Array [ - 179, - 187, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 20, - "line": 8, - }, - "start": Object { - "column": 2, - "line": 8, + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, }, - }, + ], "range": Array [ - 179, - 197, + 24, + 27, ], - "type": "CallExpression", + "type": "TSTypeParameterInstantiation", }, + }, + Object { "loc": Object { "end": Object { - "column": 21, - "line": 8, + "column": 37, + "line": 1, }, "start": Object { - "column": 2, - "line": 8, + "column": 30, + "line": 1, }, }, "range": Array [ - 179, - 198, + 30, + 37, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 37, - "line": 6, + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "name": "Failure", + "range": Array [ + 30, + 37, + ], + "type": "Identifier", + }, }, - }, - "range": Array [ - 145, - 210, ], - "type": "BlockStatement", }, - "expression": false, - "generator": false, - "id": Object { + "typeParameters": Object { "loc": Object { "end": Object { - "column": 12, - "line": 6, + "column": 14, + "line": 1, }, "start": Object { - "column": 9, - "line": 6, + "column": 11, + "line": 1, }, }, - "name": "foo", - "range": Array [ - 117, - 120, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 0, - "line": 6, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 6, - }, - "start": Object { - "column": 13, - "line": 6, - }, - }, - "name": "arr", - "range": Array [ - 121, - 143, - ], - "type": "Identifier", - "typeAnnotation": Object { + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 35, - "line": 6, + "column": 13, + "line": 1, }, "start": Object { - "column": 16, - "line": 6, + "column": 12, + "line": 1, }, }, - "range": Array [ - 124, - 143, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "name": Object { "loc": Object { "end": Object { - "column": 35, - "line": 6, + "column": 13, + "line": 1, }, "start": Object { - "column": 18, - "line": 6, + "column": 12, + "line": 1, }, }, - "operator": "readonly", + "name": "T", "range": Array [ - 126, - 143, + 12, + 13, ], - "type": "TSTypeOperator", - "typeAnnotation": Object { - "elementType": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 6, - }, - "start": Object { - "column": 27, - "line": 6, - }, - }, - "range": Array [ - 135, - 141, - ], - "type": "TSStringKeyword", - }, - "loc": Object { - "end": Object { - "column": 35, - "line": 6, - }, - "start": Object { - "column": 27, - "line": 6, - }, - }, - "range": Array [ - 135, - 143, - ], - "type": "TSArrayType", - }, + "type": "Identifier", }, + "range": Array [ + 12, + 13, + ], + "type": "TSTypeParameter", }, - }, - ], - "range": Array [ - 108, - 210, - ], - "type": "FunctionDeclaration", + ], + "range": Array [ + 11, + 14, + ], + "type": "TSTypeParameterDeclaration", + }, }, ], "loc": Object { "end": Object { - "column": 0, - "line": 10, + "column": 37, + "line": 1, }, "start": Object { "column": 0, @@ -68260,14 +88397,14 @@ Object { }, "range": Array [ 0, - 211, + 37, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 4, "line": 1, }, "start": Object { @@ -68277,10 +88414,28 @@ Object { }, "range": Array [ 0, - 8, + 4, ], - "type": "Keyword", - "value": "function", + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "type": "Identifier", + "value": "Result", }, Object { "loc": Object { @@ -68289,16 +88444,16 @@ Object { "line": 1, }, "start": Object { - "column": 9, + "column": 11, "line": 1, }, }, "range": Array [ - 9, + 11, 12, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { @@ -68315,13 +88470,13 @@ Object { 12, 13, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 14, "line": 1, }, "start": Object { @@ -68331,61 +88486,61 @@ Object { }, "range": Array [ 13, - 16, + 14, ], - "type": "Identifier", - "value": "arr", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 16, "line": 1, }, "start": Object { - "column": 16, + "column": 15, "line": 1, }, }, "range": Array [ + 15, 16, - 17, ], "type": "Punctuator", - "value": ":", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 24, "line": 1, }, "start": Object { - "column": 18, + "column": 17, "line": 1, }, }, "range": Array [ - 18, - 31, + 17, + 24, ], "type": "Identifier", - "value": "ReadonlyArray", + "value": "Success", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 25, "line": 1, }, "start": Object { - "column": 31, + "column": 24, "line": 1, }, }, "range": Array [ - 31, - 32, + 24, + 25, ], "type": "Punctuator", "value": "<", @@ -68393,35 +88548,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 38, + "column": 26, "line": 1, }, "start": Object { - "column": 32, + "column": 25, "line": 1, }, }, "range": Array [ - 32, - 38, + 25, + 26, ], "type": "Identifier", - "value": "string", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 39, + "column": 27, "line": 1, }, "start": Object { - "column": 38, + "column": 26, "line": 1, }, }, "range": Array [ - 38, - 39, + 26, + 27, ], "type": "Punctuator", "value": ">", @@ -68429,737 +88584,1479 @@ Object { Object { "loc": Object { "end": Object { - "column": 40, + "column": 29, "line": 1, }, "start": Object { - "column": 39, + "column": 28, "line": 1, }, }, "range": Array [ - 39, - 40, + 28, + 29, ], "type": "Punctuator", - "value": ")", + "value": "|", }, Object { "loc": Object { "end": Object { - "column": 42, + "column": 37, "line": 1, }, "start": Object { - "column": 41, + "column": 30, "line": 1, }, }, "range": Array [ - 41, - 42, + 30, + 37, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "Failure", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/type-alias-declaration-with-constrained-type-parameter.src 1`] = ` +Object { + "body": Array [ Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Result", + "range": Array [ + 5, + 11, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 48, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 45, + 0, 48, ], - "type": "Identifier", - "value": "arr", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 48, + ], + "type": "TSUnionType", + "types": Array [ + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 38, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "Success", + "range": Array [ + 28, + 35, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 36, + 37, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 35, + 38, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 48, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "name": "Failure", + "range": Array [ + 41, + 48, + ], + "type": "Identifier", + }, + }, + ], + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "params": Array [ + Object { + "constraint": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "members": Array [], + "range": Array [ + 22, + 24, + ], + "type": "TSTypeLiteral", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "range": Array [ + 12, + 24, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 11, + 25, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 48, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, - "line": 2, + "column": 4, + "line": 1, }, "start": Object { - "column": 5, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 48, - 49, + 0, + 4, ], - "type": "Punctuator", - "value": ".", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { "column": 11, - "line": 2, + "line": 1, }, "start": Object { - "column": 6, - "line": 2, + "column": 5, + "line": 1, }, }, "range": Array [ - 49, - 54, + 5, + 11, ], "type": "Identifier", - "value": "slice", + "value": "Result", }, Object { "loc": Object { "end": Object { "column": 12, - "line": 2, + "line": 1, }, "start": Object { "column": 11, - "line": 2, + "line": 1, }, }, "range": Array [ - 54, - 55, + 11, + 12, ], "type": "Punctuator", - "value": "(", + "value": "<", }, Object { "loc": Object { "end": Object { "column": 13, - "line": 2, + "line": 1, }, "start": Object { "column": 12, - "line": 2, + "line": 1, }, }, "range": Array [ - 55, - 56, + 12, + 13, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { "column": 14, - "line": 2, + "line": 1, + }, + }, + "range": Array [ + 14, + 21, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, }, "start": Object { - "column": 13, - "line": 2, + "column": 22, + "line": 1, }, }, "range": Array [ - 56, - 57, + 22, + 23, ], "type": "Punctuator", - "value": ";", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 24, + "line": 1, }, "start": Object { - "column": 2, - "line": 3, + "column": 23, + "line": 1, }, }, "range": Array [ - 75, - 78, + 23, + 24, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 35, ], "type": "Identifier", - "value": "arr", + "value": "Success", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 3, + "column": 36, + "line": 1, }, "start": Object { - "column": 5, - "line": 3, + "column": 35, + "line": 1, }, }, "range": Array [ - 78, - 79, + 35, + 36, ], "type": "Punctuator", - "value": ".", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 3, + "column": 37, + "line": 1, }, "start": Object { - "column": 6, - "line": 3, + "column": 36, + "line": 1, }, }, "range": Array [ - 79, - 83, + 36, + 37, ], "type": "Identifier", - "value": "push", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 3, + "column": 38, + "line": 1, }, "start": Object { - "column": 10, - "line": 3, + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": "|", + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 48, + ], + "type": "Identifier", + "value": "Failure", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/type-alias-object-without-annotation.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "members": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 24, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 23, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 23, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 28, + ], + "type": "TSPropertySignature", + }, + ], + "range": Array [ + 11, + 29, + ], + "type": "TSTypeLiteral", }, - "range": Array [ - 83, - 84, - ], - "type": "Punctuator", - "value": "(", }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 19, - "line": 3, + "column": 4, + "line": 1, }, "start": Object { - "column": 11, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 84, - 92, + 0, + 4, ], - "type": "String", - "value": "\\"hello!\\"", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 3, + "column": 8, + "line": 1, }, "start": Object { - "column": 19, - "line": 3, + "column": 5, + "line": 1, }, }, "range": Array [ - 92, - 93, + 5, + 8, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 3, + "column": 10, + "line": 1, }, "start": Object { - "column": 20, - "line": 3, + "column": 9, + "line": 1, }, }, "range": Array [ - 93, - 94, + 9, + 10, ], "type": "Punctuator", - "value": ";", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 12, + "line": 1, }, "start": Object { - "column": 0, - "line": 4, + "column": 11, + "line": 1, }, }, "range": Array [ - 105, - 106, + 11, + 12, ], "type": "Punctuator", - "value": "}", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 6, + "column": 15, + "line": 1, }, "start": Object { - "column": 0, - "line": 6, - }, - }, - "range": Array [ - 108, - 116, - ], - "type": "Keyword", - "value": "function", - }, - Object { - "loc": Object { - "end": Object { "column": 12, - "line": 6, - }, - "start": Object { - "column": 9, - "line": 6, + "line": 1, }, }, "range": Array [ - 117, - 120, + 12, + 15, ], "type": "Identifier", - "value": "foo", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 6, + "column": 16, + "line": 1, }, "start": Object { - "column": 12, - "line": 6, + "column": 15, + "line": 1, }, }, "range": Array [ - 120, - 121, + 15, + 16, ], "type": "Punctuator", - "value": "(", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 6, + "column": 23, + "line": 1, }, "start": Object { - "column": 13, - "line": 6, + "column": 17, + "line": 1, }, }, "range": Array [ - 121, - 124, + 17, + 23, ], "type": "Identifier", - "value": "arr", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 6, + "column": 24, + "line": 1, }, "start": Object { - "column": 16, - "line": 6, + "column": 23, + "line": 1, }, }, "range": Array [ - 124, - 125, + 23, + 24, ], "type": "Punctuator", - "value": ":", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 6, + "column": 28, + "line": 1, }, "start": Object { - "column": 18, - "line": 6, + "column": 25, + "line": 1, }, }, "range": Array [ - 126, - 134, + 25, + 28, ], "type": "Identifier", - "value": "readonly", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 6, + "column": 29, + "line": 1, }, "start": Object { - "column": 27, - "line": 6, + "column": 28, + "line": 1, }, }, "range": Array [ - 135, - 141, + 28, + 29, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 6, + "column": 30, + "line": 1, }, "start": Object { - "column": 33, - "line": 6, + "column": 29, + "line": 1, }, }, "range": Array [ - 141, - 142, + 29, + 30, ], "type": "Punctuator", - "value": "[", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/type-assertion-in-arrow-function.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 6, - }, - "start": Object { - "column": 34, - "line": 6, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "assertString", + "range": Array [ + 6, + 18, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": null, + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 50, + 56, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 58, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 22, + 28, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 28, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 28, + ], + "type": "TSAnyKeyword", + }, + }, + }, + ], + "range": Array [ + 21, + 58, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 40, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "asserts": true, + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "parameterName": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 39, + 40, + ], + "type": "Identifier", + }, + "range": Array [ + 31, + 40, + ], + "type": "TSTypePredicate", + "typeAnnotation": null, + }, + }, + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 58, + ], + "type": "VariableDeclarator", }, - }, - "range": Array [ - 142, - 143, ], - "type": "Punctuator", - "value": "]", - }, - Object { + "kind": "const", "loc": Object { "end": Object { - "column": 36, - "line": 6, + "column": 1, + "line": 3, }, "start": Object { - "column": 35, - "line": 6, + "column": 0, + "line": 1, }, }, "range": Array [ - 143, - 144, + 0, + 58, ], - "type": "Punctuator", - "value": ")", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 59, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 38, - "line": 6, + "column": 5, + "line": 1, }, "start": Object { - "column": 37, - "line": 6, + "column": 0, + "line": 1, }, }, "range": Array [ - 145, - 146, + 0, + 5, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 7, + "column": 18, + "line": 1, }, "start": Object { - "column": 2, - "line": 7, + "column": 6, + "line": 1, }, }, "range": Array [ - 149, - 152, + 6, + 18, ], "type": "Identifier", - "value": "arr", + "value": "assertString", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 7, + "column": 20, + "line": 1, }, "start": Object { - "column": 5, - "line": 7, + "column": 19, + "line": 1, }, }, "range": Array [ - 152, - 153, + 19, + 20, ], "type": "Punctuator", - "value": ".", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 7, + "column": 22, + "line": 1, }, "start": Object { - "column": 6, - "line": 7, + "column": 21, + "line": 1, }, }, "range": Array [ - 153, - 158, + 21, + 22, ], - "type": "Identifier", - "value": "slice", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 7, + "column": 23, + "line": 1, }, "start": Object { - "column": 11, - "line": 7, + "column": 22, + "line": 1, }, }, "range": Array [ - 158, - 159, + 22, + 23, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 7, + "column": 24, + "line": 1, }, "start": Object { - "column": 12, - "line": 7, + "column": 23, + "line": 1, }, }, "range": Array [ - 159, - 160, + 23, + 24, ], "type": "Punctuator", - "value": ")", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 7, + "column": 28, + "line": 1, }, "start": Object { - "column": 13, - "line": 7, + "column": 25, + "line": 1, }, }, "range": Array [ - 160, - 161, + 25, + 28, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "any", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 8, + "column": 29, + "line": 1, }, "start": Object { - "column": 2, - "line": 8, + "column": 28, + "line": 1, }, }, "range": Array [ - 179, - 182, + 28, + 29, ], - "type": "Identifier", - "value": "arr", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 8, + "column": 30, + "line": 1, }, "start": Object { - "column": 5, - "line": 8, + "column": 29, + "line": 1, }, }, "range": Array [ - 182, - 183, + 29, + 30, ], "type": "Punctuator", - "value": ".", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 8, + "column": 38, + "line": 1, }, "start": Object { - "column": 6, - "line": 8, + "column": 31, + "line": 1, }, }, "range": Array [ - 183, - 187, + 31, + 38, ], "type": "Identifier", - "value": "push", + "value": "asserts", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 8, + "column": 40, + "line": 1, }, "start": Object { - "column": 10, - "line": 8, + "column": 39, + "line": 1, }, }, "range": Array [ - 187, - 188, + 39, + 40, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 8, + "column": 43, + "line": 1, }, "start": Object { - "column": 11, - "line": 8, + "column": 41, + "line": 1, }, }, "range": Array [ - 188, - 196, + 41, + 43, ], - "type": "String", - "value": "\\"hello!\\"", + "type": "Punctuator", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 8, + "column": 45, + "line": 1, }, "start": Object { - "column": 19, - "line": 8, + "column": 44, + "line": 1, }, }, "range": Array [ - 196, - 197, + 44, + 45, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 8, + "column": 10, + "line": 2, }, "start": Object { - "column": 20, - "line": 8, + "column": 4, + "line": 2, }, }, "range": Array [ - 197, - 198, + 50, + 56, ], - "type": "Punctuator", - "value": ";", + "type": "Keyword", + "value": "return", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 9, + "line": 3, }, "start": Object { "column": 0, - "line": 9, + "line": 3, }, }, "range": Array [ - 209, - 210, + 57, + 58, ], "type": "Punctuator", "value": "}", @@ -69169,7 +90066,7 @@ Object { } `; -exports[`typescript fixtures/basics/readonly-tuples.src 1`] = ` +exports[`typescript fixtures/basics/type-assertion-in-function.src 1`] = ` Object { "body": Array [ Object { @@ -69177,273 +90074,37 @@ Object { "body": Object { "body": Array [ Object { - "expression": Object { - "arguments": Array [ - Object { - "computed": true, - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "name": "pair", - "range": Array [ - 62, - 66, - ], - "type": "Identifier", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 19, - "line": 2, - }, - }, - "range": Array [ - 67, - 68, - ], - "raw": "0", - "type": "Literal", - "value": 0, - }, - "range": Array [ - 62, - 69, - ], - "type": "MemberExpression", - }, - ], - "callee": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "name": "console", - "range": Array [ - 50, - 57, - ], - "type": "Identifier", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "name": "log", - "range": Array [ - 58, - 61, - ], - "type": "Identifier", - }, - "range": Array [ - 50, - 61, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 50, - 70, - ], - "type": "CallExpression", - }, + "argument": null, "loc": Object { "end": Object { - "column": 23, + "column": 10, "line": 2, }, "start": Object { - "column": 2, + "column": 4, "line": 2, }, }, "range": Array [ - 50, - 71, - ], - "type": "ExpressionStatement", - }, - Object { - "expression": Object { - "left": Object { - "computed": true, - "loc": Object { - "end": Object { - "column": 9, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "name": "pair", - "range": Array [ - 84, - 88, - ], - "type": "Identifier", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 3, - }, - }, - "range": Array [ - 89, - 90, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "range": Array [ - 84, - 91, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 20, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "operator": "=", - "range": Array [ - 84, - 102, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "range": Array [ - 94, - 102, - ], - "raw": "\\"hello!\\"", - "type": "Literal", - "value": "hello!", - }, - "type": "AssignmentExpression", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "range": Array [ - 84, - 103, + 48, + 54, ], - "type": "ExpressionStatement", + "type": "ReturnStatement", }, ], "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 3, }, "start": Object { - "column": 46, + "column": 42, "line": 1, }, }, "range": Array [ - 46, - 118, + 42, + 56, ], "type": "BlockStatement", }, @@ -69452,7 +90113,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 12, + "column": 22, "line": 1, }, "start": Object { @@ -69460,17 +90121,17 @@ Object { "line": 1, }, }, - "name": "foo", + "name": "assertsString", "range": Array [ 9, - 12, + 22, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 3, }, "start": Object { "column": 0, @@ -69481,121 +90142,121 @@ Object { Object { "loc": Object { "end": Object { - "column": 44, + "column": 29, "line": 1, }, "start": Object { - "column": 13, + "column": 23, "line": 1, }, }, - "name": "pair", + "name": "x", "range": Array [ - 13, - 44, + 23, + 29, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 44, + "column": 29, "line": 1, }, "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 44, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "operator": "readonly", - "range": Array [ - 19, - 44, - ], - "type": "TSTypeOperator", - "typeAnnotation": Object { - "elementTypes": Array [ - Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 35, - ], - "type": "TSStringKeyword", - }, - Object { - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 37, - "line": 1, - }, - }, - "range": Array [ - 37, - 43, - ], - "type": "TSStringKeyword", - }, - ], - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 29, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, }, - "range": Array [ - 28, - 44, - ], - "type": "TSTupleType", }, + "range": Array [ + 26, + 29, + ], + "type": "TSAnyKeyword", }, }, }, ], "range": Array [ 0, - 118, + 56, ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 41, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "asserts": true, + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "parameterName": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + "range": Array [ + 32, + 41, + ], + "type": "TSTypePredicate", + "typeAnnotation": null, + }, + }, "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 5, + "line": 4, }, "start": Object { "column": 0, @@ -69604,7 +90265,7 @@ Object { }, "range": Array [ 0, - 119, + 57, ], "sourceType": "script", "tokens": Array [ @@ -69629,7 +90290,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 22, "line": 1, }, "start": Object { @@ -69639,25 +90300,25 @@ Object { }, "range": Array [ 9, - 12, + 22, ], "type": "Identifier", - "value": "foo", + "value": "assertsString", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 23, "line": 1, }, "start": Object { - "column": 12, + "column": 22, "line": 1, }, }, "range": Array [ - 12, - 13, + 22, + 23, ], "type": "Punctuator", "value": "(", @@ -69665,35 +90326,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 24, "line": 1, }, "start": Object { - "column": 13, + "column": 23, "line": 1, }, }, "range": Array [ - 13, - 17, + 23, + 24, ], "type": "Identifier", - "value": "pair", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 25, "line": 1, }, "start": Object { - "column": 17, + "column": 24, "line": 1, }, }, "range": Array [ - 17, - 18, + 24, + 25, ], "type": "Punctuator", "value": ":", @@ -69701,449 +90362,600 @@ Object { Object { "loc": Object { "end": Object { - "column": 27, + "column": 29, "line": 1, }, "start": Object { - "column": 19, + "column": 26, "line": 1, }, }, "range": Array [ - 19, - 27, + 26, + 29, ], "type": "Identifier", - "value": "readonly", + "value": "any", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 30, "line": 1, }, "start": Object { - "column": 28, + "column": 29, "line": 1, }, }, "range": Array [ - 28, 29, + 30, ], "type": "Punctuator", - "value": "[", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 35, + "column": 31, "line": 1, }, "start": Object { - "column": 29, + "column": 30, "line": 1, }, }, "range": Array [ - 29, - 35, + 30, + 31, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 36, + "column": 39, "line": 1, }, "start": Object { - "column": 35, + "column": 32, "line": 1, }, }, "range": Array [ - 35, - 36, + 32, + 39, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "asserts", }, Object { "loc": Object { "end": Object { - "column": 43, + "column": 41, "line": 1, }, "start": Object { - "column": 37, + "column": 40, "line": 1, }, }, "range": Array [ - 37, - 43, + 40, + 41, ], "type": "Identifier", - "value": "string", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 44, + "column": 43, "line": 1, }, "start": Object { - "column": 43, + "column": 42, "line": 1, }, }, "range": Array [ + 42, 43, - 44, ], "type": "Punctuator", - "value": "]", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 45, - "line": 1, + "column": 10, + "line": 2, }, "start": Object { - "column": 44, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 44, - 45, + 48, + 54, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "return", }, Object { "loc": Object { "end": Object { - "column": 47, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 46, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 46, - 47, + 55, + 56, ], "type": "Punctuator", - "value": "{", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/type-assertion-in-interface.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "isString", + "range": Array [ + 24, + 32, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 36, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "node", + "range": Array [ + 33, + 42, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 37, + 42, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 39, + 42, + ], + "type": "TSAnyKeyword", + }, + }, + }, + ], + "range": Array [ + 24, + 58, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 43, + 57, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "asserts": true, + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "parameterName": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 31, + "line": 2, + }, + }, + "name": "node", + "range": Array [ + 53, + 57, + ], + "type": "Identifier", + }, + "range": Array [ + 45, + 57, + ], + "type": "TSTypePredicate", + "typeAnnotation": null, + }, + }, + "type": "TSMethodSignature", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 60, + ], + "type": "TSInterfaceBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "AssertFoo", + "range": Array [ + 10, + 19, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 1, + "line": 3, }, "start": Object { - "column": 2, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 50, - 57, + 0, + 60, ], - "type": "Identifier", - "value": "console", + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 61, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 9, + "line": 1, }, "start": Object { - "column": 9, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 57, - 58, + 0, + 9, ], - "type": "Punctuator", - "value": ".", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 2, + "column": 19, + "line": 1, }, "start": Object { "column": 10, - "line": 2, + "line": 1, }, }, "range": Array [ - 58, - 61, + 10, + 19, ], "type": "Identifier", - "value": "log", + "value": "AssertFoo", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { - "column": 13, - "line": 2, + "column": 20, + "line": 1, }, }, "range": Array [ - 61, - 62, + 20, + 21, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 10, "line": 2, }, "start": Object { - "column": 14, + "column": 2, "line": 2, }, }, "range": Array [ - 62, - 66, + 24, + 32, ], "type": "Identifier", - "value": "pair", + "value": "isString", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 11, "line": 2, }, "start": Object { - "column": 18, + "column": 10, "line": 2, }, }, "range": Array [ - 66, - 67, + 32, + 33, ], "type": "Punctuator", - "value": "[", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 15, "line": 2, }, "start": Object { - "column": 19, + "column": 11, "line": 2, }, }, "range": Array [ - 67, - 68, + 33, + 37, ], - "type": "Numeric", - "value": "0", + "type": "Identifier", + "value": "node", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 16, "line": 2, }, "start": Object { - "column": 20, + "column": 15, "line": 2, }, }, "range": Array [ - 68, - 69, + 37, + 38, ], "type": "Punctuator", - "value": "]", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 20, "line": 2, }, "start": Object { - "column": 21, + "column": 17, "line": 2, }, }, "range": Array [ - 69, - 70, + 39, + 42, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "any", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 21, "line": 2, }, "start": Object { - "column": 22, + "column": 20, "line": 2, }, }, "range": Array [ - 70, - 71, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "range": Array [ - 84, - 88, - ], - "type": "Identifier", - "value": "pair", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "range": Array [ - 88, - 89, + 42, + 43, ], "type": "Punctuator", - "value": "[", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 3, - }, - }, - "range": Array [ - 89, - 90, - ], - "type": "Numeric", - "value": "1", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 3, + "column": 22, + "line": 2, }, "start": Object { - "column": 8, - "line": 3, + "column": 21, + "line": 2, }, }, "range": Array [ - 90, - 91, + 43, + 44, ], "type": "Punctuator", - "value": "]", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 3, + "column": 30, + "line": 2, }, "start": Object { - "column": 10, - "line": 3, + "column": 23, + "line": 2, }, }, "range": Array [ - 92, - 93, + 45, + 52, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "asserts", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 3, + "column": 35, + "line": 2, }, "start": Object { - "column": 12, - "line": 3, + "column": 31, + "line": 2, }, }, "range": Array [ - 94, - 102, + 53, + 57, ], - "type": "String", - "value": "\\"hello!\\"", + "type": "Identifier", + "value": "node", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 3, + "column": 36, + "line": 2, }, "start": Object { - "column": 20, - "line": 3, + "column": 35, + "line": 2, }, }, "range": Array [ - 102, - 103, + 57, + 58, ], "type": "Punctuator", "value": ";", @@ -70152,16 +90964,16 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 3, }, "start": Object { "column": 0, - "line": 4, + "line": 3, }, }, "range": Array [ - 117, - 118, + 59, + 60, ], "type": "Punctuator", "value": "}", @@ -70171,195 +90983,369 @@ Object { } `; -exports[`typescript fixtures/basics/symbol-type-param.src 1`] = ` +exports[`typescript fixtures/basics/type-assertion-in-method.src 1`] = ` Object { "body": Array [ Object { - "async": false, "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 40, - "line": 1, - }, - }, - "range": Array [ - 40, - 42, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "test", - "range": Array [ - 9, - 13, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "isBar", + "range": Array [ + 21, + 26, + ], + "type": "Identifier", }, - }, - "name": "abc", - "range": Array [ - 14, - 38, - ], - "type": "Identifier", - "typeAnnotation": Object { + "kind": "method", "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 3, + "line": 4, }, "start": Object { - "column": 17, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 17, - 38, + 21, + 60, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": null, + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 49, + 56, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 43, + 60, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 3, + "line": 4, }, "start": Object { - "column": 19, - "line": 1, + "column": 7, + "line": 2, }, }, + "params": Array [], "range": Array [ - 19, - 38, + 26, + 60, ], - "type": "TSTypeReference", - "typeName": Object { + "returnType": Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 23, + "line": 2, }, "start": Object { - "column": 19, - "line": 1, + "column": 9, + "line": 2, }, }, - "name": "Map", "range": Array [ - 19, - 22, + 28, + 42, ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "asserts": true, + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, }, - }, - "params": Array [ - Object { + "parameterName": Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 23, + "line": 2, }, "start": Object { - "column": 23, - "line": 1, + "column": 19, + "line": 2, }, }, "range": Array [ - 23, - 29, + 38, + 42, ], - "type": "TSSymbolKeyword", + "type": "TSThisType", }, + "range": Array [ + 30, + 42, + ], + "type": "TSTypePredicate", + "typeAnnotation": null, + }, + }, + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "declare": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "name": "isBaz", + "range": Array [ + 63, + 68, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 3, + "line": 7, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 63, + 108, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "async": false, + "body": Object { + "body": Array [ Object { + "argument": null, "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 11, + "line": 6, }, "start": Object { - "column": 31, - "line": 1, + "column": 4, + "line": 6, }, }, "range": Array [ - 31, - 37, + 97, + 104, ], - "type": "TSStringKeyword", + "type": "ReturnStatement", }, ], + "loc": Object { + "end": Object { + "column": 3, + "line": 7, + }, + "start": Object { + "column": 30, + "line": 5, + }, + }, "range": Array [ - 22, - 38, + 91, + 108, ], - "type": "TSTypeParameterInstantiation", + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 7, + }, + "start": Object { + "column": 10, + "line": 5, + }, + }, + "params": Array [], + "range": Array [ + 71, + 108, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "range": Array [ + 73, + 87, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "asserts": true, + "loc": Object { + "end": Object { + "column": 26, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "parameterName": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 5, + }, + "start": Object { + "column": 22, + "line": 5, + }, + }, + "range": Array [ + 83, + 87, + ], + "type": "TSThisType", + }, + "range": Array [ + 75, + 87, + ], + "type": "TSTypePredicate", + "typeAnnotation": null, + }, }, + "type": "ArrowFunctionExpression", }, }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 110, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, }, - ], + "name": "AssertsFoo", + "range": Array [ + 6, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, "range": Array [ 0, - 42, + 110, ], - "type": "FunctionDeclaration", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 0, + "line": 9, }, "start": Object { "column": 0, @@ -70368,14 +91354,14 @@ Object { }, "range": Array [ 0, - 42, + 111, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 5, "line": 1, }, "start": Object { @@ -70385,981 +91371,728 @@ Object { }, "range": Array [ 0, - 8, + 5, ], "type": "Keyword", - "value": "function", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 16, "line": 1, }, "start": Object { - "column": 9, + "column": 6, "line": 1, }, }, "range": Array [ - 9, - 13, + 6, + 16, ], "type": "Identifier", - "value": "test", + "value": "AssertsFoo", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 18, "line": 1, }, "start": Object { - "column": 13, + "column": 17, "line": 1, }, }, "range": Array [ - 13, - 14, + 17, + 18, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 14, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 14, - 17, + 21, + 26, ], "type": "Identifier", - "value": "abc", + "value": "isBar", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 17, - "line": 1, + "column": 7, + "line": 2, }, }, "range": Array [ - 17, - 18, + 26, + 27, ], "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - "value": "Map", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ - 22, - 23, + 27, + 28, ], "type": "Punctuator", - "value": "<", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 10, + "line": 2, }, "start": Object { - "column": 23, - "line": 1, + "column": 9, + "line": 2, }, }, "range": Array [ - 23, + 28, 29, ], - "type": "Identifier", - "value": "symbol", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 29, - "line": 1, + "column": 11, + "line": 2, }, }, "range": Array [ - 29, 30, + 37, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "asserts", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 23, + "line": 2, }, "start": Object { - "column": 31, - "line": 1, + "column": 19, + "line": 2, }, }, "range": Array [ - 31, - 37, + 38, + 42, ], - "type": "Identifier", - "value": "string", + "type": "Keyword", + "value": "this", }, Object { "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 25, + "line": 2, }, "start": Object { - "column": 37, - "line": 1, + "column": 24, + "line": 2, }, }, "range": Array [ - 37, - 38, + 43, + 44, ], "type": "Punctuator", - "value": ">", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 39, - "line": 1, + "column": 10, + "line": 3, }, "start": Object { - "column": 38, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 38, - 39, + 49, + 55, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "return", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 1, + "column": 11, + "line": 3, }, "start": Object { - "column": 40, - "line": 1, + "column": 10, + "line": 3, }, }, "range": Array [ - 40, - 41, + 55, + 56, ], "type": "Punctuator", - "value": "{", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 3, + "line": 4, }, "start": Object { - "column": 41, - "line": 1, + "column": 2, + "line": 4, }, }, "range": Array [ - 41, - 42, + 59, + 60, ], "type": "Punctuator", "value": "}", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/type-alias-declaration.src 1`] = ` -Object { - "body": Array [ Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "Result", - "range": Array [ - 5, - 11, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 7, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 2, + "line": 5, }, }, "range": Array [ - 0, - 37, + 63, + 68, ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 37, - ], - "type": "TSUnionType", - "types": Array [ - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 27, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "Success", - "range": Array [ - 17, - 24, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 26, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - }, - ], - "range": Array [ - 24, - 27, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "range": Array [ - 30, - 37, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "name": "Failure", - "range": Array [ - 30, - 37, - ], - "type": "Identifier", - }, - }, - ], - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "range": Array [ - 12, - 13, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 11, - 14, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "isBaz", }, - }, - "range": Array [ - 0, - 37, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, - "line": 1, + "column": 9, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 8, + "line": 5, }, }, "range": Array [ - 0, - 4, + 69, + 70, ], - "type": "Identifier", - "value": "type", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { "column": 11, - "line": 1, + "line": 5, }, "start": Object { - "column": 5, - "line": 1, + "column": 10, + "line": 5, }, }, "range": Array [ - 5, - 11, + 71, + 72, ], - "type": "Identifier", - "value": "Result", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { "column": 12, - "line": 1, + "line": 5, }, "start": Object { "column": 11, - "line": 1, + "line": 5, }, }, "range": Array [ - 11, - 12, + 72, + 73, ], "type": "Punctuator", - "value": "<", + "value": ")", }, Object { "loc": Object { "end": Object { "column": 13, - "line": 1, + "line": 5, }, "start": Object { "column": 12, - "line": 1, + "line": 5, }, }, "range": Array [ - 12, - 13, + 73, + 74, ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 21, + "line": 5, }, "start": Object { - "column": 13, - "line": 1, + "column": 14, + "line": 5, }, }, "range": Array [ - 13, - 14, + 75, + 82, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "asserts", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 26, + "line": 5, }, "start": Object { - "column": 15, - "line": 1, + "column": 22, + "line": 5, }, }, "range": Array [ - 15, - 16, + 83, + 87, ], - "type": "Punctuator", - "value": "=", + "type": "Keyword", + "value": "this", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 29, + "line": 5, }, "start": Object { - "column": 17, - "line": 1, + "column": 27, + "line": 5, }, }, "range": Array [ - 17, - 24, + 88, + 90, ], - "type": "Identifier", - "value": "Success", + "type": "Punctuator", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 31, + "line": 5, }, "start": Object { - "column": 24, - "line": 1, + "column": 30, + "line": 5, }, }, "range": Array [ - 24, - 25, + 91, + 92, ], "type": "Punctuator", - "value": "<", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 10, + "line": 6, }, "start": Object { - "column": 25, - "line": 1, + "column": 4, + "line": 6, }, }, "range": Array [ - 25, - 26, + 97, + 103, ], - "type": "Identifier", - "value": "T", + "type": "Keyword", + "value": "return", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 11, + "line": 6, }, "start": Object { - "column": 26, - "line": 1, + "column": 10, + "line": 6, }, }, "range": Array [ - 26, - 27, + 103, + 104, ], "type": "Punctuator", - "value": ">", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 3, + "line": 7, }, "start": Object { - "column": 28, - "line": 1, + "column": 2, + "line": 7, }, }, "range": Array [ - 28, - 29, + 107, + 108, ], "type": "Punctuator", - "value": "|", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 1, + "line": 8, }, "start": Object { - "column": 30, - "line": 1, + "column": 0, + "line": 8, }, }, "range": Array [ - 30, - 37, + 109, + 110, ], - "type": "Identifier", - "value": "Failure", + "type": "Punctuator", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/type-alias-declaration-with-constrained-type-parameter.src 1`] = ` +exports[`typescript fixtures/basics/type-assertion-with-guard-in-arrow-function.src 1`] = ` Object { "body": Array [ Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "Result", - "range": Array [ - 5, - 11, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 48, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 48, - ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 48, - ], - "type": "TSUnionType", - "types": Array [ - Object { + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { - "column": 38, + "column": 18, "line": 1, }, "start": Object { - "column": 28, + "column": 6, "line": 1, }, }, + "name": "assertString", "range": Array [ - 28, - 38, + 6, + 18, ], - "type": "TSTypeReference", - "typeName": Object { + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": null, + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 60, + 66, + ], + "type": "ReturnStatement", + }, + ], "loc": Object { "end": Object { - "column": 35, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 28, + "column": 54, "line": 1, }, }, - "name": "Success", "range": Array [ - 28, - 35, + 54, + 68, ], - "type": "Identifier", + "type": "BlockStatement", }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, }, - "params": Array [ - Object { + "start": Object { + "column": 21, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 22, + 28, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 37, + "column": 28, "line": 1, }, "start": Object { - "column": 36, + "column": 23, "line": 1, }, }, "range": Array [ - 36, - 37, + 23, + 28, ], - "type": "TSTypeReference", - "typeName": Object { + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 37, + "column": 28, "line": 1, }, "start": Object { - "column": 36, + "column": 25, "line": 1, }, }, - "name": "T", "range": Array [ - 36, - 37, + 25, + 28, ], - "type": "Identifier", + "type": "TSAnyKeyword", }, }, - ], - "range": Array [ - 35, - 38, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 1, - }, - "start": Object { - "column": 41, - "line": 1, }, - }, + ], "range": Array [ - 41, - 48, + 21, + 68, ], - "type": "TSTypeReference", - "typeName": Object { + "returnType": Object { "loc": Object { "end": Object { - "column": 48, + "column": 50, "line": 1, }, "start": Object { - "column": 41, + "column": 29, "line": 1, }, }, - "name": "Failure", "range": Array [ - 41, - 48, + 29, + 50, ], - "type": "Identifier", - }, - }, - ], - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "params": Array [ - Object { - "constraint": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "asserts": true, + "loc": Object { + "end": Object { + "column": 50, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, }, - "start": Object { - "column": 22, - "line": 1, + "parameterName": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 39, + 40, + ], + "type": "Identifier", + }, + "range": Array [ + 31, + 50, + ], + "type": "TSTypePredicate", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 50, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 50, + ], + "type": "TSStringKeyword", + }, }, }, - "members": Array [], - "range": Array [ - 22, - 24, - ], - "type": "TSTypeLiteral", }, - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, }, - "name": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", + "start": Object { + "column": 6, + "line": 1, }, - "range": Array [ - 12, - 24, - ], - "type": "TSTypeParameter", }, - ], - "range": Array [ - 11, - 25, - ], - "type": "TSTypeParameterDeclaration", + "range": Array [ + 6, + 68, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, }, + "range": Array [ + 0, + 68, + ], + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 48, - "line": 1, + "column": 0, + "line": 4, }, "start": Object { "column": 0, @@ -71368,14 +92101,14 @@ Object { }, "range": Array [ 0, - 48, + 69, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, + "column": 5, "line": 1, }, "start": Object { @@ -71385,436 +92118,528 @@ Object { }, "range": Array [ 0, - 4, + 5, ], - "type": "Identifier", - "value": "type", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 18, "line": 1, }, "start": Object { - "column": 5, + "column": 6, "line": 1, }, }, "range": Array [ - 5, - 11, + 6, + 18, ], "type": "Identifier", - "value": "Result", + "value": "assertString", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 20, "line": 1, }, "start": Object { - "column": 11, + "column": 19, "line": 1, }, }, "range": Array [ - 11, - 12, + 19, + 20, ], "type": "Punctuator", - "value": "<", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 22, "line": 1, }, "start": Object { - "column": 12, + "column": 21, "line": 1, }, }, "range": Array [ - 12, - 13, + 21, + 22, ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 23, "line": 1, }, "start": Object { - "column": 14, + "column": 22, "line": 1, }, }, "range": Array [ - 14, - 21, + 22, + 23, ], - "type": "Keyword", - "value": "extends", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 24, "line": 1, }, "start": Object { - "column": 22, + "column": 23, "line": 1, }, }, "range": Array [ - 22, 23, + 24, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 28, "line": 1, }, "start": Object { - "column": 23, + "column": 25, "line": 1, }, }, "range": Array [ - 23, - 24, + 25, + 28, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "any", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 29, "line": 1, }, "start": Object { - "column": 24, + "column": 28, "line": 1, }, }, "range": Array [ - 24, - 25, + 28, + 29, ], "type": "Punctuator", - "value": ">", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 30, "line": 1, }, "start": Object { - "column": 26, + "column": 29, "line": 1, }, }, "range": Array [ - 26, - 27, + 29, + 30, ], "type": "Punctuator", - "value": "=", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 35, + "column": 38, "line": 1, }, "start": Object { - "column": 28, + "column": 31, "line": 1, }, }, "range": Array [ - 28, - 35, + 31, + 38, ], "type": "Identifier", - "value": "Success", + "value": "asserts", }, Object { "loc": Object { "end": Object { - "column": 36, + "column": 40, "line": 1, }, "start": Object { - "column": 35, + "column": 39, "line": 1, }, }, "range": Array [ - 35, - 36, + 39, + 40, ], - "type": "Punctuator", - "value": "<", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 37, + "column": 43, "line": 1, }, "start": Object { - "column": 36, + "column": 41, "line": 1, }, }, "range": Array [ - 36, - 37, + 41, + 43, ], "type": "Identifier", - "value": "T", + "value": "is", }, Object { "loc": Object { "end": Object { - "column": 38, + "column": 50, "line": 1, }, "start": Object { - "column": 37, + "column": 44, "line": 1, }, }, "range": Array [ - 37, - 38, + 44, + 50, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 40, + "column": 53, "line": 1, }, "start": Object { - "column": 39, + "column": 51, "line": 1, }, }, "range": Array [ - 39, - 40, + 51, + 53, ], "type": "Punctuator", - "value": "|", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 48, + "column": 55, "line": 1, }, "start": Object { - "column": 41, + "column": 54, "line": 1, }, }, "range": Array [ - 41, - 48, + 54, + 55, ], - "type": "Identifier", - "value": "Failure", + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 60, + 66, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 67, + 68, + ], + "type": "Punctuator", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/type-alias-object-without-annotation.src 1`] = ` +exports[`typescript fixtures/basics/type-assertion-with-guard-in-function.src 1`] = ` Object { "body": Array [ Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": null, + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 63, + 69, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 57, + "line": 1, + }, + }, + "range": Array [ + 57, + 71, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, "id": Object { "loc": Object { "end": Object { - "column": 8, + "column": 27, "line": 1, }, "start": Object { - "column": 5, + "column": 9, "line": 1, }, }, - "name": "foo", + "name": "assertsStringGuard", "range": Array [ - 5, - 8, + 9, + 27, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { "column": 0, "line": 1, }, }, - "range": Array [ - 0, - 30, - ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "members": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 12, - 15, - ], - "type": "Identifier", + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, }, + }, + "name": "x", + "range": Array [ + 28, + 34, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 24, + "column": 34, "line": 1, }, "start": Object { - "column": 12, + "column": 29, "line": 1, }, }, "range": Array [ - 12, - 24, + 29, + 34, ], - "type": "TSPropertySignature", + "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 23, + "column": 34, "line": 1, }, "start": Object { - "column": 15, + "column": 31, "line": 1, }, }, "range": Array [ - 15, - 23, + 31, + 34, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 23, - ], - "type": "TSStringKeyword", - }, + "type": "TSAnyKeyword", }, }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, + }, + ], + "range": Array [ + 0, + 71, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 56, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "asserts": true, + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "parameterName": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 45, + "line": 1, }, - "name": "baz", - "range": Array [ - 25, - 28, - ], - "type": "Identifier", }, + "name": "x", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + "range": Array [ + 37, + 56, + ], + "type": "TSTypePredicate", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 28, + "column": 56, "line": 1, }, "start": Object { - "column": 25, + "column": 50, "line": 1, }, }, "range": Array [ - 25, - 28, + 50, + 56, ], - "type": "TSPropertySignature", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 50, + "line": 1, + }, + }, + "range": Array [ + 50, + 56, + ], + "type": "TSStringKeyword", + }, }, - ], - "range": Array [ - 11, - 29, - ], - "type": "TSTypeLiteral", + }, }, + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 4, }, "start": Object { "column": 0, @@ -71823,14 +92648,14 @@ Object { }, "range": Array [ 0, - 31, + 72, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, + "column": 8, "line": 1, }, "start": Object { @@ -71840,97 +92665,133 @@ Object { }, "range": Array [ 0, - 4, + 8, ], - "type": "Identifier", - "value": "type", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 27, "line": 1, }, "start": Object { - "column": 5, + "column": 9, "line": 1, }, }, "range": Array [ - 5, - 8, + 9, + 27, ], "type": "Identifier", - "value": "foo", + "value": "assertsStringGuard", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 28, "line": 1, }, "start": Object { - "column": 9, + "column": 27, "line": 1, }, }, "range": Array [ - 9, - 10, + 27, + 28, ], "type": "Punctuator", - "value": "=", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 29, "line": 1, }, "start": Object { - "column": 11, + "column": 28, "line": 1, }, }, "range": Array [ - 11, - 12, + 28, + 29, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 34, "line": 1, }, "start": Object { - "column": 12, + "column": 31, "line": 1, }, }, "range": Array [ - 12, - 15, + 31, + 34, ], "type": "Identifier", - "value": "bar", + "value": "any", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 35, "line": 1, }, "start": Object { - "column": 15, + "column": 34, "line": 1, }, }, "range": Array [ - 15, - 16, + 34, + 35, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, ], "type": "Punctuator", "value": ":", @@ -71938,453 +92799,757 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, + "column": 44, "line": 1, }, "start": Object { - "column": 17, + "column": 37, "line": 1, }, }, "range": Array [ - 17, - 23, + 37, + 44, ], "type": "Identifier", - "value": "string", + "value": "asserts", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 46, "line": 1, }, "start": Object { - "column": 23, + "column": 45, "line": 1, }, }, "range": Array [ - 23, - 24, + 45, + 46, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 49, "line": 1, }, "start": Object { - "column": 25, + "column": 47, "line": 1, }, }, "range": Array [ - 25, - 28, + 47, + 49, ], "type": "Identifier", - "value": "baz", + "value": "is", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 56, "line": 1, }, "start": Object { - "column": 28, + "column": 50, "line": 1, }, }, "range": Array [ - 28, - 29, + 50, + 56, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 58, "line": 1, }, "start": Object { - "column": 29, + "column": 57, "line": 1, }, }, "range": Array [ - 29, - 30, + 57, + 58, ], "type": "Punctuator", - "value": ";", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 63, + 69, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 70, + 71, + ], + "type": "Punctuator", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/type-assertion.src 1`] = ` +exports[`typescript fixtures/basics/type-assertion-with-guard-in-interface.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "init": Object { - "expression": Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 10, + "line": 2, }, "start": Object { - "column": 26, - "line": 1, + "column": 2, + "line": 2, }, }, + "name": "isString", "range": Array [ - 26, - 27, + 24, + 32, ], - "raw": "2", - "type": "Literal", - "value": 2, + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 46, + "line": 2, }, "start": Object { - "column": 12, - "line": 1, + "column": 2, + "line": 2, }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "node", + "range": Array [ + 33, + 42, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 37, + 42, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 39, + 42, + ], + "type": "TSAnyKeyword", + }, + }, + }, + ], "range": Array [ - 12, - 27, + 24, + 68, ], - "type": "TSTypeAssertion", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 45, + "line": 2, }, "start": Object { - "column": 13, - "line": 1, + "column": 21, + "line": 2, }, }, "range": Array [ - 13, - 16, + 43, + 67, ], - "type": "TSAnyKeyword", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "asserts": true, + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "parameterName": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 31, + "line": 2, + }, + }, + "name": "node", + "range": Array [ + 53, + 57, + ], + "type": "Identifier", + }, + "range": Array [ + 45, + 67, + ], + "type": "TSTypePredicate", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 39, + "line": 2, + }, + }, + "range": Array [ + 61, + 67, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 39, + "line": 2, + }, + }, + "range": Array [ + 61, + 67, + ], + "type": "TSStringKeyword", + }, + }, + }, }, + "type": "TSMethodSignature", }, - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, }, - "range": Array [ - 6, - 27, - ], - "type": "VariableDeclarator", + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 70, + ], + "type": "TSInterfaceBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "AssertFoo", + "range": Array [ + 10, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 70, ], - "kind": "const", + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 71, + ], + "sourceType": "script", + "tokens": Array [ + Object { "loc": Object { "end": Object { - "column": 28, + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 19, + ], + "type": "Identifier", + "value": "AssertFoo", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, "line": 1, }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 24, + 32, + ], + "type": "Identifier", + "value": "isString", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 33, + 37, + ], + "type": "Identifier", + "value": "node", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, "start": Object { - "column": 0, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 0, - 28, + 39, + 42, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "any", }, - }, - "range": Array [ - 0, - 29, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 21, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 20, + "line": 2, }, }, "range": Array [ - 0, - 5, + 42, + 43, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 22, + "line": 2, }, "start": Object { - "column": 6, - "line": 1, + "column": 21, + "line": 2, }, }, "range": Array [ - 6, - 9, + 43, + 44, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 30, + "line": 2, }, "start": Object { - "column": 10, - "line": 1, + "column": 23, + "line": 2, }, }, "range": Array [ - 10, - 11, + 45, + 52, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "asserts", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 35, + "line": 2, }, "start": Object { - "column": 12, - "line": 1, + "column": 31, + "line": 2, }, }, "range": Array [ - 12, - 13, + 53, + 57, ], - "type": "Punctuator", - "value": "<", + "type": "Identifier", + "value": "node", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 38, + "line": 2, }, "start": Object { - "column": 13, - "line": 1, + "column": 36, + "line": 2, }, }, "range": Array [ - 13, - 16, + 58, + 60, ], "type": "Identifier", - "value": "any", + "value": "is", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 45, + "line": 2, }, "start": Object { - "column": 16, - "line": 1, + "column": 39, + "line": 2, }, }, "range": Array [ - 16, - 17, + 61, + 67, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 46, + "line": 2, }, "start": Object { - "column": 26, - "line": 1, + "column": 45, + "line": 2, }, }, "range": Array [ - 26, - 27, + 67, + 68, ], - "type": "Numeric", - "value": "2", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 27, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 27, - 28, + 69, + 70, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/type-assertion-arrow-function.src 1`] = ` +exports[`typescript fixtures/basics/type-assertion-with-guard-in-method.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "isBar", + "range": Array [ + 21, + 26, + ], + "type": "Identifier", + }, + "kind": "method", "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 3, + "line": 4, }, "start": Object { - "column": 4, - "line": 1, + "column": 2, + "line": 2, }, }, - "name": "asserted2", "range": Array [ - 4, - 13, + 21, + 70, ], - "type": "Identifier", - }, - "init": Object { - "expression": Object { + "static": false, + "type": "MethodDefinition", + "value": Object { "async": false, "body": Object { "body": Array [ Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 1, - }, - "start": Object { - "column": 38, - "line": 1, - }, - }, - "name": "n", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, + "argument": null, "loc": Object { "end": Object { - "column": 40, - "line": 1, + "column": 11, + "line": 3, }, "start": Object { - "column": 31, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 31, - 40, + 59, + 66, ], "type": "ReturnStatement", }, ], "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 3, + "line": 4, }, "start": Object { - "column": 29, - "line": 1, + "column": 34, + "line": 2, }, }, "range": Array [ - 29, - 42, + 53, + 70, ], "type": "BlockStatement", }, @@ -72393,95 +93558,330 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 3, + "line": 4, }, "start": Object { - "column": 22, - "line": 1, + "column": 7, + "line": 2, }, }, - "params": Array [ - Object { + "params": Array [], + "range": Array [ + 26, + 70, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 28, + 52, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "asserts": true, "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 33, + "line": 2, }, "start": Object { - "column": 23, - "line": 1, + "column": 11, + "line": 2, }, }, - "name": "n", + "parameterName": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 38, + 42, + ], + "type": "TSThisType", + }, "range": Array [ - 23, - 24, + 30, + 52, ], - "type": "Identifier", + "type": "TSTypePredicate", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 46, + 52, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 46, + 52, + ], + "type": "TSStringKeyword", + }, + }, }, - ], + }, + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "declare": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "name": "isBaz", "range": Array [ - 22, - 42, + 73, + 78, ], - "type": "ArrowFunctionExpression", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 43, - "line": 1, + "column": 3, + "line": 7, }, "start": Object { - "column": 16, - "line": 1, + "column": 2, + "line": 5, }, }, "range": Array [ - 16, - 43, + 73, + 128, ], - "type": "TSTypeAssertion", - "typeAnnotation": Object { + "static": false, + "type": "ClassProperty", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": null, + "loc": Object { + "end": Object { + "column": 11, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 117, + 124, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 7, + }, + "start": Object { + "column": 40, + "line": 5, + }, + }, + "range": Array [ + 111, + 128, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 3, + "line": 7, }, "start": Object { - "column": 17, - "line": 1, + "column": 10, + "line": 5, }, }, + "params": Array [], "range": Array [ - 17, - 20, + 81, + 128, ], - "type": "TSAnyKeyword", + "returnType": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "range": Array [ + 83, + 107, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "asserts": true, + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "parameterName": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 5, + }, + "start": Object { + "column": 22, + "line": 5, + }, + }, + "range": Array [ + 93, + 97, + ], + "type": "TSThisType", + }, + "range": Array [ + 85, + 107, + ], + "type": "TSTypePredicate", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 30, + "line": 5, + }, + }, + "range": Array [ + 101, + 107, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 30, + "line": 5, + }, + }, + "range": Array [ + 101, + 107, + ], + "type": "TSStringKeyword", + }, + }, + }, + }, + "type": "ArrowFunctionExpression", }, }, - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 17, + "line": 1, }, - "range": Array [ - 4, - 43, - ], - "type": "VariableDeclarator", }, - ], - "kind": "var", + "range": Array [ + 17, + 130, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "AssertsFoo", + "range": Array [ + 6, + 16, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 44, - "line": 1, + "column": 1, + "line": 8, }, "start": Object { "column": 0, @@ -72490,15 +93890,16 @@ Object { }, "range": Array [ 0, - 44, + 130, ], - "type": "VariableDeclaration", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 9, }, "start": Object { "column": 0, @@ -72507,14 +93908,14 @@ Object { }, "range": Array [ 0, - 45, + 131, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 1, }, "start": Object { @@ -72524,317 +93925,533 @@ Object { }, "range": Array [ 0, - 3, + 5, ], "type": "Keyword", - "value": "var", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 16, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, "range": Array [ - 4, - 13, + 6, + 16, ], "type": "Identifier", - "value": "asserted2", + "value": "AssertsFoo", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 18, "line": 1, }, "start": Object { - "column": 14, + "column": 17, "line": 1, }, }, "range": Array [ - 14, - 15, + 17, + 18, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 16, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 16, - 17, + 21, + 26, + ], + "type": "Identifier", + "value": "isBar", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, ], "type": "Punctuator", - "value": "<", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { - "column": 17, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ - 17, - 20, + 27, + 28, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 30, + 37, ], "type": "Identifier", - "value": "any", + "value": "asserts", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 23, + "line": 2, }, "start": Object { - "column": 20, - "line": 1, + "column": 19, + "line": 2, }, }, "range": Array [ - 20, - 21, + 38, + 42, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 43, + 45, + ], + "type": "Identifier", + "value": "is", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 46, + 52, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 53, + 54, ], "type": "Punctuator", - "value": ">", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 10, + "line": 3, }, "start": Object { - "column": 21, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 21, - 22, + 59, + 65, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 65, + 66, ], "type": "Punctuator", - "value": "(", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 3, + "line": 4, }, "start": Object { - "column": 22, - "line": 1, + "column": 2, + "line": 4, }, }, "range": Array [ - 22, - 23, + 69, + 70, ], "type": "Punctuator", - "value": "(", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 7, + "line": 5, }, "start": Object { - "column": 23, - "line": 1, + "column": 2, + "line": 5, }, }, "range": Array [ - 23, - 24, + 73, + 78, ], "type": "Identifier", - "value": "n", + "value": "isBaz", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 9, + "line": 5, }, "start": Object { - "column": 24, - "line": 1, + "column": 8, + "line": 5, }, }, "range": Array [ - 24, - 25, + 79, + 80, ], "type": "Punctuator", - "value": ")", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 11, + "line": 5, }, "start": Object { - "column": 26, - "line": 1, + "column": 10, + "line": 5, }, }, "range": Array [ - 26, - 28, + 81, + 82, ], "type": "Punctuator", - "value": "=>", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 12, + "line": 5, }, "start": Object { - "column": 29, - "line": 1, + "column": 11, + "line": 5, }, }, "range": Array [ - 29, - 30, + 82, + 83, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 13, + "line": 5, }, "start": Object { - "column": 31, - "line": 1, + "column": 12, + "line": 5, }, }, "range": Array [ - 31, - 37, + 83, + 84, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "range": Array [ + 85, + 92, + ], + "type": "Identifier", + "value": "asserts", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 5, + }, + "start": Object { + "column": 22, + "line": 5, + }, + }, + "range": Array [ + 93, + 97, ], "type": "Keyword", - "value": "return", + "value": "this", }, Object { "loc": Object { "end": Object { - "column": 39, - "line": 1, + "column": 29, + "line": 5, }, "start": Object { - "column": 38, - "line": 1, + "column": 27, + "line": 5, }, }, "range": Array [ - 38, - 39, + 98, + 100, ], "type": "Identifier", - "value": "n", + "value": "is", }, Object { "loc": Object { "end": Object { - "column": 40, - "line": 1, + "column": 36, + "line": 5, }, "start": Object { + "column": 30, + "line": 5, + }, + }, + "range": Array [ + 101, + 107, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { "column": 39, - "line": 1, + "line": 5, + }, + "start": Object { + "column": 37, + "line": 5, }, }, "range": Array [ - 39, - 40, + 108, + 110, ], "type": "Punctuator", - "value": ";", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 41, + "line": 5, }, "start": Object { - "column": 41, - "line": 1, + "column": 40, + "line": 5, }, }, "range": Array [ - 41, - 42, + 111, + 112, ], "type": "Punctuator", - "value": "}", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 43, - "line": 1, + "column": 10, + "line": 6, }, "start": Object { - "column": 42, - "line": 1, + "column": 4, + "line": 6, }, }, "range": Array [ - 42, - 43, + 117, + 123, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "return", }, Object { "loc": Object { "end": Object { - "column": 44, - "line": 1, + "column": 11, + "line": 6, }, "start": Object { - "column": 43, - "line": 1, + "column": 10, + "line": 6, }, }, "range": Array [ - 43, - 44, + 123, + 124, ], "type": "Punctuator", "value": ";", }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 7, + }, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "range": Array [ + 127, + 128, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 8, + }, + }, + "range": Array [ + 129, + 130, + ], + "type": "Punctuator", + "value": "}", + }, ], "type": "Program", } @@ -73064,6 +94681,7 @@ Object { ], "type": "TSTypeAnnotation", "typeAnnotation": Object { + "asserts": false, "loc": Object { "end": Object { "column": 38, @@ -73771,6 +95389,7 @@ Object { ], "type": "TSTypeAnnotation", "typeAnnotation": Object { + "asserts": false, "loc": Object { "end": Object { "column": 38, @@ -74299,6 +95918,7 @@ Object { ], "type": "TSTypeAnnotation", "typeAnnotation": Object { + "asserts": false, "loc": Object { "end": Object { "column": 37, @@ -74882,6 +96502,7 @@ Object { ], "type": "TSTypeAnnotation", "typeAnnotation": Object { + "asserts": false, "loc": Object { "end": Object { "column": 25, @@ -74955,6 +96576,7 @@ Object { }, Object { "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -75115,6 +96737,7 @@ Object { ], "type": "TSTypeAnnotation", "typeAnnotation": Object { + "asserts": false, "loc": Object { "end": Object { "column": 28, @@ -75906,6 +97529,7 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 0, 42, @@ -78542,6 +100166,7 @@ Object { "body": Array [ Object { "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -86557,6 +108182,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 19, 38, @@ -86649,6 +108275,7 @@ Object { ], "type": "ThisExpression", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -87279,6 +108906,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 19, 37, @@ -87371,6 +108999,7 @@ Object { ], "type": "ThisExpression", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -88087,6 +109716,7 @@ Object { ], "type": "ThisExpression", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -88660,6 +110290,7 @@ Object { ], "type": "ThisExpression", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -89582,6 +111213,7 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 1, 36, @@ -89974,6 +111606,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 15, 30, @@ -90459,6 +112092,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 15, 25, @@ -91836,6 +113470,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 19, 32, @@ -92431,6 +114066,7 @@ Object { ], "type": "ThisExpression", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -92500,6 +114136,7 @@ Object { ], "type": "Identifier", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -92625,6 +114262,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 33, 51, @@ -93379,6 +115017,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 21, 34, @@ -93971,6 +115610,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 34, 47, @@ -96071,6 +117711,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 19, 32, @@ -96775,6 +118416,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 19, 32, @@ -97262,6 +118904,7 @@ Object { "body": Array [ Object { "computed": false, + "declare": false, "decorators": Array [ Object { "expression": Object { @@ -97294,6 +118937,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 27, 34, @@ -97355,6 +118999,7 @@ Object { }, Object { "computed": false, + "declare": false, "decorators": Array [ Object { "expression": Object { @@ -97387,6 +119032,7 @@ Object { "line": 3, }, }, + "optional": false, "range": Array [ 46, 54, @@ -97941,6 +119587,7 @@ Object { "body": Array [ Object { "computed": false, + "declare": false, "decorators": Array [ Object { "expression": Object { @@ -97993,6 +119640,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 15, 33, @@ -98054,6 +119702,7 @@ Object { }, Object { "computed": false, + "declare": false, "decorators": Array [ Object { "expression": Object { @@ -98106,6 +119755,7 @@ Object { "line": 4, }, }, + "optional": false, "range": Array [ 54, 73, @@ -98607,6 +120257,7 @@ Object { "body": Array [ Object { "computed": false, + "declare": false, "decorators": Array [ Object { "expression": Object { @@ -98682,6 +120333,7 @@ Object { }, Object { "computed": false, + "declare": false, "decorators": Array [ Object { "expression": Object { @@ -99053,6 +120705,7 @@ Object { "body": Array [ Object { "computed": false, + "declare": false, "decorators": Array [ Object { "expression": Object { @@ -99128,6 +120781,7 @@ Object { }, Object { "computed": false, + "declare": false, "decorators": Array [ Object { "expression": Object { @@ -100944,6 +122598,7 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 1, 7, @@ -101259,6 +122914,7 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 1, 7, @@ -101758,6 +123414,7 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 0, 7, @@ -113119,6 +134776,7 @@ Object { "line": 1, }, }, + "optional": false, "range": Array [ 0, 8, @@ -113226,6 +134884,7 @@ Object { "line": 2, }, }, + "optional": false, "range": Array [ 10, 23, @@ -134543,6 +156202,7 @@ Object { Object { "accessibility": "public", "computed": false, + "declare": false, "key": Object { "loc": Object { "end": Object { @@ -134685,6 +156345,7 @@ Object { ], "type": "ThisExpression", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -134922,6 +156583,7 @@ Object { ], "type": "ThisExpression", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -135199,6 +156861,7 @@ Object { ], "type": "ThisExpression", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -135308,6 +156971,7 @@ Object { "line": 14, }, }, + "optional": false, "range": Array [ 228, 232, @@ -135549,6 +157213,7 @@ Object { ], "type": "ThisExpression", }, + "optional": false, "property": Object { "loc": Object { "end": Object { @@ -135658,6 +157323,7 @@ Object { "line": 19, }, }, + "optional": false, "range": Array [ 313, 317, @@ -135894,6 +157560,7 @@ Object { ], "type": "ThisExpression", }, + "optional": false, "property": Object { "loc": Object { "end": Object { diff --git a/packages/typescript-estree/tests/lib/jsx.ts b/packages/typescript-estree/tests/lib/jsx.ts index a3e0148907cc..cfcc68284ccd 100644 --- a/packages/typescript-estree/tests/lib/jsx.ts +++ b/packages/typescript-estree/tests/lib/jsx.ts @@ -1,3 +1,4 @@ +import filesWithKnownIssues from '@typescript-eslint/shared-fixtures/dist/jsx-known-issues'; import { readFileSync } from 'fs'; import glob from 'glob'; import { TSESTreeOptions } from '../../src/parser-options'; @@ -5,7 +6,6 @@ import { createSnapshotTestBlock, formatSnapshotName, } from '../../tools/test-utils'; -import filesWithKnownIssues from '../../../shared-fixtures/jsx-known-issues'; const JSX_FIXTURES_DIR = '../../node_modules/@typescript-eslint/shared-fixtures/fixtures/jsx'; diff --git a/packages/typescript-estree/tests/lib/parse.ts b/packages/typescript-estree/tests/lib/parse.ts index 6ed8db76cbc9..ebfb922b8392 100644 --- a/packages/typescript-estree/tests/lib/parse.ts +++ b/packages/typescript-estree/tests/lib/parse.ts @@ -1,4 +1,4 @@ -import { join, resolve, relative } from 'path'; +import { join, resolve } from 'path'; import * as parser from '../../src/parser'; import * as astConverter from '../../src/ast-converter'; import { TSESTreeOptions } from '../../src/parser-options'; @@ -37,6 +37,22 @@ describe('parse()', () => { 'output tokens, comments, locs, and ranges when called with those options', createSnapshotTestBlock(code, config), ); + + it( + 'output should not contain loc', + createSnapshotTestBlock(code, { + range: true, + loc: false, + }), + ); + + it( + 'output should not contain range', + createSnapshotTestBlock(code, { + range: false, + loc: true, + }), + ); }); describe('non string code', () => { @@ -75,29 +91,16 @@ describe('parse()', () => { loc: true, }); - expect(spy).toHaveBeenCalledWith( - expect.any(Object), - { - code: 'let foo = bar;', - comment: true, - comments: [], - errorOnTypeScriptSyntacticAndSemanticIssues: false, - errorOnUnknownASTType: false, - extraFileExtensions: [], - jsx: false, - loc: true, - log: loggerFn, - projects: [], - range: true, - strict: false, - tokens: expect.any(Array), - tsconfigRootDir: expect.any(String), - useJSXTextNode: false, - preserveNodeMaps: false, - createDefaultProgram: false, - }, - false, - ); + expect(spy).toHaveBeenCalled(); + expect(spy.mock.calls[0][1]).toMatchObject({ + code: 'let foo = bar;', + comment: true, + comments: [], + loc: true, + log: loggerFn, + range: true, + tokens: expect.any(Array), + }); }); }); @@ -242,6 +245,156 @@ describe('parse()', () => { }); }); + describe('isolated parsing', () => { + const config: TSESTreeOptions = { + comment: true, + tokens: true, + range: true, + loc: true, + }; + const testParse = ({ + ext, + jsxContent, + jsxSetting, + shouldThrow = false, + }: { + ext: '.js' | '.jsx' | '.ts' | '.tsx' | '.vue'; + jsxContent: boolean; + jsxSetting: boolean; + shouldThrow?: boolean; + }): void => { + const code = jsxContent ? 'const x =
;' : 'const x = 1'; + it(`should parse ${ext} file - ${ + jsxContent ? 'with' : 'without' + } JSX content - parserOptions.jsx = ${jsxSetting}`, () => { + let result; + let exp = expect(() => { + result = parser.parseAndGenerateServices(code, { + ...config, + jsx: jsxSetting, + filePath: join(FIXTURES_DIR, `file${ext}`), + }); + }); + if (!shouldThrow) { + exp = exp.not; + } + exp.toThrow(); + + if (!shouldThrow) { + expect(result).toMatchSnapshot(); + } + }); + }; + + testParse({ + ext: '.js', + jsxContent: false, + jsxSetting: false, + }); + testParse({ + ext: '.js', + jsxContent: false, + jsxSetting: true, + }); + testParse({ + ext: '.js', + jsxContent: true, + jsxSetting: false, + }); + testParse({ + ext: '.js', + jsxContent: true, + jsxSetting: true, + }); + + testParse({ + ext: '.jsx', + jsxContent: false, + jsxSetting: false, + }); + testParse({ + ext: '.jsx', + jsxContent: false, + jsxSetting: true, + }); + testParse({ + ext: '.jsx', + jsxContent: true, + jsxSetting: false, + }); + testParse({ + ext: '.jsx', + jsxContent: true, + jsxSetting: true, + }); + + testParse({ + ext: '.ts', + jsxContent: false, + jsxSetting: false, + }); + testParse({ + ext: '.ts', + jsxContent: false, + jsxSetting: true, + }); + testParse({ + ext: '.ts', + jsxContent: true, + jsxSetting: false, + shouldThrow: true, // Typescript does not allow JSX in a .ts file + }); + testParse({ + ext: '.ts', + jsxContent: true, + jsxSetting: true, + shouldThrow: true, + }); + + testParse({ + ext: '.tsx', + jsxContent: false, + jsxSetting: false, + }); + testParse({ + ext: '.tsx', + jsxContent: false, + jsxSetting: true, + }); + testParse({ + ext: '.tsx', + jsxContent: true, + jsxSetting: false, + }); + testParse({ + ext: '.tsx', + jsxContent: true, + jsxSetting: true, + }); + + testParse({ + ext: '.vue', + jsxContent: false, + jsxSetting: false, + }); + testParse({ + ext: '.vue', + jsxContent: false, + jsxSetting: true, + }); + testParse({ + ext: '.vue', + jsxContent: true, + jsxSetting: false, + shouldThrow: true, // "Unknown" filetype means we respect the JSX setting + }); + testParse({ + ext: '.vue', + jsxContent: true, + jsxSetting: true, + }); + }); + describe('invalid file error messages', () => { const PROJECT_DIR = resolve(FIXTURES_DIR, '../invalidFileErrors'); const code = 'var a = true'; @@ -257,7 +410,7 @@ describe('parse()', () => { const testParse = (filePath: string) => (): void => { parser.parseAndGenerateServices(code, { ...config, - filePath: relative(process.cwd(), join(PROJECT_DIR, filePath)), + filePath: join(PROJECT_DIR, filePath), }); }; diff --git a/packages/typescript-estree/tests/lib/persistentParse.ts b/packages/typescript-estree/tests/lib/persistentParse.ts new file mode 100644 index 000000000000..e1cb8b9f9b76 --- /dev/null +++ b/packages/typescript-estree/tests/lib/persistentParse.ts @@ -0,0 +1,178 @@ +import fs from 'fs'; +import path from 'path'; +import tmp from 'tmp'; +import { clearCaches, parseAndGenerateServices } from '../../src/parser'; + +const tsConfigExcludeBar = { + include: ['src'], + exclude: ['./src/bar.ts'], +}; +const tsConfigIncludeAll = { + include: ['src'], + exclude: [], +}; +const CONTENTS = { + foo: 'console.log("foo")', + bar: 'console.log("bar")', + 'baz/bar': 'console.log("baz bar")', +}; + +const tmpDirs = new Set(); +afterEach(() => { + // stop watching the files and folders + clearCaches(); + + // clean up the temporary files and folders + tmpDirs.forEach(t => t.removeCallback()); + tmpDirs.clear(); +}); + +function writeTSConfig(dirName: string, config: Record): void { + fs.writeFileSync(path.join(dirName, 'tsconfig.json'), JSON.stringify(config)); +} +function writeFile(dirName: string, file: 'foo' | 'bar' | 'baz/bar'): void { + fs.writeFileSync(path.join(dirName, 'src', `${file}.ts`), CONTENTS[file]); +} +function renameFile(dirName: string, src: 'bar', dest: 'baz/bar'): void { + fs.renameSync( + path.join(dirName, 'src', `${src}.ts`), + path.join(dirName, 'src', `${dest}.ts`), + ); +} + +function createTmpDir(): tmp.DirResult { + const tmpDir = tmp.dirSync({ + keep: false, + unsafeCleanup: true, + }); + tmpDirs.add(tmpDir); + return tmpDir; +} +function setup(tsconfig: Record, writeBar = true): string { + const tmpDir = createTmpDir(); + + writeTSConfig(tmpDir.name, tsconfig); + + fs.mkdirSync(path.join(tmpDir.name, 'src')); + fs.mkdirSync(path.join(tmpDir.name, 'src', 'baz')); + writeFile(tmpDir.name, 'foo'); + writeBar && writeFile(tmpDir.name, 'bar'); + + return tmpDir.name; +} + +function parseFile(filename: 'foo' | 'bar' | 'baz/bar', tmpDir: string): void { + parseAndGenerateServices(CONTENTS.foo, { + project: './tsconfig.json', + tsconfigRootDir: tmpDir, + filePath: path.join(tmpDir, 'src', `${filename}.ts`), + }); +} + +describe('persistent lint session', () => { + it('parses both files successfully when included', () => { + const PROJECT_DIR = setup(tsConfigIncludeAll); + + expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow(); + expect(() => parseFile('bar', PROJECT_DIR)).not.toThrow(); + }); + + it('parses included files, and throws on excluded files', () => { + const PROJECT_DIR = setup(tsConfigExcludeBar); + + expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow(); + expect(() => parseFile('bar', PROJECT_DIR)).toThrow(); + }); + + it('allows parsing of new files', () => { + const PROJECT_DIR = setup(tsConfigIncludeAll, false); + + // parse once to: assert the config as correct, and to make sure the program is setup + expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow(); + // bar should throw because it doesn't exist yet + expect(() => parseFile('bar', PROJECT_DIR)).toThrow(); + + // write a new file and attempt to parse it + writeFile(PROJECT_DIR, 'bar'); + + // both files should parse fine now + expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow(); + expect(() => parseFile('bar', PROJECT_DIR)).not.toThrow(); + }); + + it('allows parsing of deeply nested new files', () => { + const PROJECT_DIR = setup(tsConfigIncludeAll, false); + + // parse once to: assert the config as correct, and to make sure the program is setup + expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow(); + // bar should throw because it doesn't exist yet + expect(() => parseFile('baz/bar', PROJECT_DIR)).toThrow(); + + // write a new file and attempt to parse it + writeFile(PROJECT_DIR, 'baz/bar'); + + // both files should parse fine now + expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow(); + expect(() => parseFile('baz/bar', PROJECT_DIR)).not.toThrow(); + }); + + it('allows renaming of files', () => { + const PROJECT_DIR = setup(tsConfigIncludeAll, true); + + // parse once to: assert the config as correct, and to make sure the program is setup + expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow(); + // bar should throw because it doesn't exist yet + expect(() => parseFile('baz/bar', PROJECT_DIR)).toThrow(); + + // write a new file and attempt to parse it + renameFile(PROJECT_DIR, 'bar', 'baz/bar'); + + // both files should parse fine now + expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow(); + expect(() => parseFile('baz/bar', PROJECT_DIR)).not.toThrow(); + }); + + it('reacts to changes in the tsconfig', () => { + const PROJECT_DIR = setup(tsConfigExcludeBar); + + // parse once to: assert the config as correct, and to make sure the program is setup + expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow(); + expect(() => parseFile('bar', PROJECT_DIR)).toThrow(); + + // change the config file so it now includes all files + writeTSConfig(PROJECT_DIR, tsConfigIncludeAll); + + expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow(); + expect(() => parseFile('bar', PROJECT_DIR)).not.toThrow(); + }); + + it('handles tsconfigs with no includes/excludes (single level)', () => { + const PROJECT_DIR = setup({}, false); + + // parse once to: assert the config as correct, and to make sure the program is setup + expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow(); + expect(() => parseFile('bar', PROJECT_DIR)).toThrow(); + + // write a new file and attempt to parse it + writeFile(PROJECT_DIR, 'bar'); + + expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow(); + expect(() => parseFile('bar', PROJECT_DIR)).not.toThrow(); + }); + + it('handles tsconfigs with no includes/excludes (nested)', () => { + const PROJECT_DIR = setup({}, false); + + // parse once to: assert the config as correct, and to make sure the program is setup + expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow(); + expect(() => parseFile('baz/bar', PROJECT_DIR)).toThrow(); + + // write a new file and attempt to parse it + writeFile(PROJECT_DIR, 'baz/bar'); + + expect(() => parseFile('foo', PROJECT_DIR)).not.toThrow(); + expect(() => parseFile('baz/bar', PROJECT_DIR)).not.toThrow(); + }); + + // TODO - support the complex monorepo case with a tsconfig with no include/exclude +}); diff --git a/packages/typescript-estree/tests/lib/semanticInfo.ts b/packages/typescript-estree/tests/lib/semanticInfo.ts index 157edec74126..05e65137db43 100644 --- a/packages/typescript-estree/tests/lib/semanticInfo.ts +++ b/packages/typescript-estree/tests/lib/semanticInfo.ts @@ -9,11 +9,11 @@ import { parseCodeAndGenerateServices, } from '../../tools/test-utils'; import { + clearCaches, parseAndGenerateServices, ParseAndGenerateServicesResult, } from '../../src/parser'; import { TSESTree } from '../../src/ts-estree'; -import { clearCaches } from '../../src/tsconfig-parser'; const FIXTURES_DIR = './tests/fixtures/semanticInfo'; const testFiles = glob.sync(`${FIXTURES_DIR}/**/*.src.ts`); @@ -236,7 +236,7 @@ describe('semanticInfo', () => { `function M() { return Base }`, createOptions(''), ), - ).toThrow(/The file does not match your project config: /); + ).toThrow(/The file does not match your project config: estree.ts/); }); it('non-existent project file', () => { @@ -254,7 +254,10 @@ describe('semanticInfo', () => { badConfig.project = '.'; expect(() => parseCodeAndGenerateServices(readFileSync(fileName, 'utf8'), badConfig), - ).toThrow(/File .+semanticInfo' not found/); + ).toThrow( + // case insensitive because unix based systems are case insensitive + /File .+semanticInfo' not found/i, + ); }); it('malformed project file', () => { @@ -335,8 +338,7 @@ function checkNumberArrayType(checker: ts.TypeChecker, tsNode: ts.Node): void { expect((nodeType as ts.ObjectType).objectFlags).toBe( ts.ObjectFlags.Reference, ); - expect((nodeType as ts.TypeReference).typeArguments).toHaveLength(1); - expect((nodeType as ts.TypeReference).typeArguments![0].flags).toBe( - ts.TypeFlags.Number, - ); + const typeArguments = checker.getTypeArguments(nodeType as ts.TypeReference); + expect(typeArguments).toHaveLength(1); + expect(typeArguments[0].flags).toBe(ts.TypeFlags.Number); } diff --git a/packages/parser/tests/lib/visitor-keys.ts b/packages/typescript-estree/tests/lib/visitor-keys.ts similarity index 92% rename from packages/parser/tests/lib/visitor-keys.ts rename to packages/typescript-estree/tests/lib/visitor-keys.ts index fd8ab4970f9b..6d16e90d00bf 100644 --- a/packages/parser/tests/lib/visitor-keys.ts +++ b/packages/typescript-estree/tests/lib/visitor-keys.ts @@ -1,4 +1,4 @@ -import { AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; +import { AST_NODE_TYPES } from '../../src/ts-estree'; import { visitorKeys } from '../../src/visitor-keys'; //------------------------------------------------------------------------------ diff --git a/packages/typescript-estree/tests/lib/warn-on-unsupported-ts.ts b/packages/typescript-estree/tests/lib/warn-on-unsupported-ts.ts index 97493a5915ae..581d28a7e961 100644 --- a/packages/typescript-estree/tests/lib/warn-on-unsupported-ts.ts +++ b/packages/typescript-estree/tests/lib/warn-on-unsupported-ts.ts @@ -3,20 +3,34 @@ import * as parser from '../../src/parser'; jest.mock('semver'); +const resetIsTTY = process.stdout.isTTY; + describe('Warn on unsupported TypeScript version', () => { afterEach(() => { jest.resetModules(); jest.resetAllMocks(); + process.stdout.isTTY = resetIsTTY; }); it('should warn the user if they are using an unsupported TypeScript version', () => { (semver.satisfies as jest.Mock).mockReturnValue(false); jest.spyOn(console, 'log').mockImplementation(); + process.stdout.isTTY = true; + parser.parse(''); expect(console.log).toHaveBeenCalledWith( expect.stringContaining( - 'WARNING: You are currently running a version of TypeScript which is not officially supported by typescript-estree', + 'WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree', ), ); }); + + it('should not warn the user when the user is running on a non TTY process', () => { + (semver.satisfies as jest.Mock).mockReturnValue(false); + jest.spyOn(console, 'log').mockImplementation(); + process.stdout.isTTY = false; + + parser.parse(''); + expect(console.log).not.toHaveBeenCalled(); + }); }); diff --git a/packages/typescript-estree/tsconfig.build.json b/packages/typescript-estree/tsconfig.build.json index 792172fb82f6..145fd09f633b 100644 --- a/packages/typescript-estree/tsconfig.build.json +++ b/packages/typescript-estree/tsconfig.build.json @@ -1,8 +1,10 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { + "composite": true, "outDir": "./dist", - "rootDir": "./src" + "rootDir": "./src", + "resolveJsonModule": true }, "include": ["src"] } diff --git a/packages/typescript-estree/tsconfig.json b/packages/typescript-estree/tsconfig.json index 2ea9199d2638..9c39ef4a085c 100644 --- a/packages/typescript-estree/tsconfig.json +++ b/packages/typescript-estree/tsconfig.json @@ -1,8 +1,10 @@ { - "extends": "../../tsconfig.base.json", + "extends": "./tsconfig.build.json", "compilerOptions": { - "outDir": "./dist" + "composite": false, + "rootDir": "." }, "include": ["src", "tests", "tools"], - "exclude": ["tests/fixtures/**/*"] + "exclude": ["tests/fixtures/**/*"], + "references": [{ "path": "../shared-fixtures/tsconfig.build.json" }] } diff --git a/tests/integration/README.md b/tests/integration/README.md new file mode 100644 index 000000000000..eb33e8bd62df --- /dev/null +++ b/tests/integration/README.md @@ -0,0 +1,18 @@ +# Integration Tests + +We have a set of integration tests defined in this project to help ensure we don't inadvertently break downstream packages that depend on us. + +These tests are setup to run within docker containers to ensure that each test is completely isolated; we don't want them to affect our local environment, and similarly we don't want them to be effected by our local environment. + +## Adding a new integration test + +1. [Install docker for your platform](https://docs.docker.com/v17.09/engine/installation/#supported-platforms). +1. Add a new folder in `/tests/integration/fixtures` +1. Add a `.eslintrc.yml`, and a `tsconfig.json` to your folder, with the config required. +1. Create the necessary files to test the integration. +1. Copy+paste the `Dockerfile` from an existing fixture (they are all the same). +1. Copy+paste the `test.sh` from an existing fixture, and adjust the `eslint` command as required. +1. Add a new entry to `docker-compose.yml` by copy+pasting an existing section, and changing the name to match your new folder. +1. Add a new entry to `run-all-tests.sh` by copy+pasting an existing command, and changing the name to match your new folder. +1. Run your integration test by running the single command you copied in . + - If your test finishes successfully, a `test.js.snap` will be created. diff --git a/tests/integration/docker-compose.yml b/tests/integration/docker-compose.yml index 74bfb63dab22..c3a0b450d65f 100644 --- a/tests/integration/docker-compose.yml +++ b/tests/integration/docker-compose.yml @@ -3,7 +3,7 @@ version: '3' services: typescript-and-tslint-plugins-together: build: ./fixtures/typescript-and-tslint-plugins-together - container_name: "typescript-and-tslint-plugins-together" + container_name: 'typescript-and-tslint-plugins-together' volumes: # Runtime link to the relevant built @typescript-eslint packages and integration test utils, # but apply an empty volume for the package tests, we don't need those. @@ -22,7 +22,7 @@ services: vue-sfc: build: ./fixtures/vue-sfc - container_name: "vue-sfc" + container_name: 'vue-sfc' volumes: # Runtime link to the relevant built @typescript-eslint packages and integration test utils, # but apply an empty volume for the package tests, we don't need those. @@ -37,9 +37,26 @@ services: # Runtime link to all the specific integration test files, so that most updates don't require a rebuild. - ./fixtures/vue-sfc:/usr/linked + vue-jsx: + build: ./fixtures/vue-jsx + container_name: 'vue-jsx' + volumes: + # Runtime link to the relevant built @typescript-eslint packages and integration test utils, + # but apply an empty volume for the package tests, we don't need those. + - ../../package.json/:/usr/root-package.json + - ./utils/:/usr/utils + - ../../packages/parser/:/usr/parser + - /usr/parser/tests + - ../../packages/typescript-estree/:/usr/typescript-estree + - /usr/typescript-estree/tests + - ../../packages/eslint-plugin/:/usr/eslint-plugin + - /usr/eslint-plugin/tests + # Runtime link to all the specific integration test files, so that most updates don't require a rebuild. + - ./fixtures/vue-jsx:/usr/linked + recommended-does-not-require-program: build: ./fixtures/recommended-does-not-require-program - container_name: "recommended-does-not-require-program" + container_name: 'recommended-does-not-require-program' volumes: # Runtime link to the relevant built @typescript-eslint packages and integration test utils, # but apply an empty volume for the package tests, we don't need those. @@ -53,3 +70,20 @@ services: - /usr/eslint-plugin/tests # Runtime link to all the specific integration test files, so that most updates don't require a rebuild. - ./fixtures/recommended-does-not-require-program:/usr/linked + + markdown: + build: ./fixtures/markdown + container_name: 'markdown' + volumes: + # Runtime link to the relevant built @typescript-eslint packages and integration test utils, + # but apply an empty volume for the package tests, we don't need those. + - ../../package.json/:/usr/root-package.json + - ./utils/:/usr/utils + - ../../packages/parser/:/usr/parser + - /usr/parser/tests + - ../../packages/typescript-estree/:/usr/typescript-estree + - /usr/typescript-estree/tests + - ../../packages/eslint-plugin/:/usr/eslint-plugin + - /usr/eslint-plugin/tests + # Runtime link to all the specific integration test files, so that most updates don't require a rebuild. + - ./fixtures/markdown:/usr/linked diff --git a/tests/integration/fixtures/markdown/.eslintrc.yml b/tests/integration/fixtures/markdown/.eslintrc.yml new file mode 100644 index 000000000000..92575183cd91 --- /dev/null +++ b/tests/integration/fixtures/markdown/.eslintrc.yml @@ -0,0 +1,23 @@ +root: true + +# Local version of @typescript-eslint/parser +parser: '@typescript-eslint/parser' + +env: + es6: true + node: true + +parserOptions: + sourceType: module + extraFileExtensions: ['.vue'] + ecmaFeatures: + jsx: true + +plugins: +- 'markdown' +# Local version of @typescript-eslint/eslint-plugin +- '@typescript-eslint' + +rules: + '@typescript-eslint/no-explicit-any': 'error' + 'no-console': 'error' diff --git a/tests/integration/fixtures/markdown/Doc.md b/tests/integration/fixtures/markdown/Doc.md new file mode 100644 index 000000000000..0d6eabe455ee --- /dev/null +++ b/tests/integration/fixtures/markdown/Doc.md @@ -0,0 +1,71 @@ +Some extra text to verify that the markdown plugin is ignoring anything that is not a code block. + +expected no-console error: +```jsx +import { Button } from 'antd'; + +function MyComp() { + console.log('test'); + return ( +
+ + + + + +
+ ); +} +``` + +expected no-explicit-any error: +expected no-console error: +```jsx +import { Button } from 'antd'; + +function MyComp(): any { + console.log('test'); + return ( +
+ + + + + +
+ ); +} +``` + +expected no-console error: +```js +function foo() { + console.log('test'); +} +``` + +expected no-explicit-any error: +expected no-console error: +```js +function foo(): any { + console.log('test'); +} +``` + + +expected no-explicit-any error: +expected no-console error: +```javascript +function foo(): any { + console.log('test'); +} +``` + + +expected no-explicit-any error: +expected no-console error: +```node +function foo(): any { + console.log('test'); +} +``` diff --git a/tests/integration/fixtures/markdown/Dockerfile b/tests/integration/fixtures/markdown/Dockerfile new file mode 100644 index 000000000000..3b281e624c87 --- /dev/null +++ b/tests/integration/fixtures/markdown/Dockerfile @@ -0,0 +1,17 @@ +FROM node:carbon + +# Copy the test.sh into the container. Every other file will be linked, rather +# than copied to allow for changes without rebuilds wherever possible +WORKDIR /usr +COPY ./test.sh /usr/ + +# Create file which will be executed by jest +# to assert that the lint output is what we expect +RUN echo "const actualLintOutput = require('./lint-output.json');\n" \ + "\n" \ + "test('it should produce the expected lint ouput', () => {\n" \ + " expect(actualLintOutput).toMatchSnapshot();\n" \ + "});\n" > test.js + +# Run the integration test +CMD [ "./test.sh" ] diff --git a/tests/integration/fixtures/markdown/test.js.snap b/tests/integration/fixtures/markdown/test.js.snap new file mode 100644 index 000000000000..4fc96f79abc7 --- /dev/null +++ b/tests/integration/fixtures/markdown/test.js.snap @@ -0,0 +1,197 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`it should produce the expected lint ouput 1`] = ` +Array [ + Object { + "errorCount": 10, + "filePath": "/usr/linked/Doc.md", + "fixableErrorCount": 0, + "fixableWarningCount": 0, + "messages": Array [ + Object { + "column": 3, + "endColumn": 14, + "endLine": 8, + "line": 8, + "message": "Unexpected console statement.", + "messageId": "unexpected", + "nodeType": "MemberExpression", + "ruleId": "no-console", + "severity": 2, + }, + Object { + "column": 20, + "endColumn": 23, + "endLine": 26, + "line": 26, + "message": "Unexpected any. Specify a different type.", + "messageId": "unexpectedAny", + "nodeType": "TSAnyKeyword", + "ruleId": "@typescript-eslint/no-explicit-any", + "severity": 2, + }, + Object { + "column": 3, + "endColumn": 14, + "endLine": 27, + "line": 27, + "message": "Unexpected console statement.", + "messageId": "unexpected", + "nodeType": "MemberExpression", + "ruleId": "no-console", + "severity": 2, + }, + Object { + "column": 3, + "endColumn": 14, + "endLine": 43, + "line": 43, + "message": "Unexpected console statement.", + "messageId": "unexpected", + "nodeType": "MemberExpression", + "ruleId": "no-console", + "severity": 2, + }, + Object { + "column": 17, + "endColumn": 20, + "endLine": 50, + "line": 50, + "message": "Unexpected any. Specify a different type.", + "messageId": "unexpectedAny", + "nodeType": "TSAnyKeyword", + "ruleId": "@typescript-eslint/no-explicit-any", + "severity": 2, + }, + Object { + "column": 3, + "endColumn": 14, + "endLine": 51, + "line": 51, + "message": "Unexpected console statement.", + "messageId": "unexpected", + "nodeType": "MemberExpression", + "ruleId": "no-console", + "severity": 2, + }, + Object { + "column": 17, + "endColumn": 20, + "endLine": 59, + "line": 59, + "message": "Unexpected any. Specify a different type.", + "messageId": "unexpectedAny", + "nodeType": "TSAnyKeyword", + "ruleId": "@typescript-eslint/no-explicit-any", + "severity": 2, + }, + Object { + "column": 3, + "endColumn": 14, + "endLine": 60, + "line": 60, + "message": "Unexpected console statement.", + "messageId": "unexpected", + "nodeType": "MemberExpression", + "ruleId": "no-console", + "severity": 2, + }, + Object { + "column": 17, + "endColumn": 20, + "endLine": 68, + "line": 68, + "message": "Unexpected any. Specify a different type.", + "messageId": "unexpectedAny", + "nodeType": "TSAnyKeyword", + "ruleId": "@typescript-eslint/no-explicit-any", + "severity": 2, + }, + Object { + "column": 3, + "endColumn": 14, + "endLine": 69, + "line": 69, + "message": "Unexpected console statement.", + "messageId": "unexpected", + "nodeType": "MemberExpression", + "ruleId": "no-console", + "severity": 2, + }, + ], + "source": "Some extra text to verify that the markdown plugin is ignoring anything that is not a code block. + +expected no-console error: +\`\`\`jsx +import { Button } from 'antd'; + +function MyComp() { + console.log('test'); + return ( +
+ + + + + +
+ ); +} +\`\`\` + +expected no-explicit-any error: +expected no-console error: +\`\`\`jsx +import { Button } from 'antd'; + +function MyComp(): any { + console.log('test'); + return ( +
+ + + + + +
+ ); +} +\`\`\` + +expected no-console error: +\`\`\`js +function foo() { + console.log('test'); +} +\`\`\` + +expected no-explicit-any error: +expected no-console error: +\`\`\`js +function foo(): any { + console.log('test'); +} +\`\`\` + + +expected no-explicit-any error: +expected no-console error: +\`\`\`javascript +function foo(): any { + console.log('test'); +} +\`\`\` + + +expected no-explicit-any error: +expected no-console error: +\`\`\`node +function foo(): any { + console.log('test'); +} +\`\`\` +", + "warningCount": 0, + }, +] +`; diff --git a/tests/integration/fixtures/markdown/test.sh b/tests/integration/fixtures/markdown/test.sh new file mode 100755 index 000000000000..4641a6b33f45 --- /dev/null +++ b/tests/integration/fixtures/markdown/test.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Generate the package.json to use +node /usr/utils/generate-package-json.js + +# Install dependencies +npm install + +# Use the local volumes for our own packages +npm install $(npm pack /usr/typescript-estree | tail -1) +npm install $(npm pack /usr/parser | tail -1) +npm install $(npm pack /usr/eslint-plugin | tail -1) + +# Install the latest vue-eslint-parser (this may break us occassionally, but it's probably good to get that feedback early) +npm install eslint-plugin-markdown@latest + +# Run the linting +# (the "|| true" helps make sure that we run our tests on failed linting runs as well) +npx eslint --format json --output-file /usr/lint-output.json --config /usr/linked/.eslintrc.yml /usr/linked/**/*.md || true + +# Run our assertions against the linting output +npx jest /usr/test.js --snapshotResolver=/usr/utils/jest-snapshot-resolver.js diff --git a/tests/integration/fixtures/markdown/tsconfig.json b/tests/integration/fixtures/markdown/tsconfig.json new file mode 100644 index 000000000000..45234bf35aa2 --- /dev/null +++ b/tests/integration/fixtures/markdown/tsconfig.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "strict": true + }, + "include": [] +} diff --git a/tests/integration/fixtures/vue-jsx/.eslintrc.yml b/tests/integration/fixtures/vue-jsx/.eslintrc.yml new file mode 100644 index 000000000000..ea4319ac718e --- /dev/null +++ b/tests/integration/fixtures/vue-jsx/.eslintrc.yml @@ -0,0 +1,25 @@ +root: true + +parser: 'vue-eslint-parser' + +env: + es6: true + node: true + +extends: + plugin:vue/essential + +parserOptions: + # Local version of @typescript-eslint/parser + parser: '@typescript-eslint/parser' + sourceType: module + extraFileExtensions: ['.vue'] + ecmaFeatures: + jsx: true + +plugins: +# Local version of @typescript-eslint/eslint-plugin +- '@typescript-eslint' + +rules: + '@typescript-eslint/no-explicit-any': 'error' diff --git a/tests/integration/fixtures/vue-jsx/Dockerfile b/tests/integration/fixtures/vue-jsx/Dockerfile new file mode 100644 index 000000000000..3b281e624c87 --- /dev/null +++ b/tests/integration/fixtures/vue-jsx/Dockerfile @@ -0,0 +1,17 @@ +FROM node:carbon + +# Copy the test.sh into the container. Every other file will be linked, rather +# than copied to allow for changes without rebuilds wherever possible +WORKDIR /usr +COPY ./test.sh /usr/ + +# Create file which will be executed by jest +# to assert that the lint output is what we expect +RUN echo "const actualLintOutput = require('./lint-output.json');\n" \ + "\n" \ + "test('it should produce the expected lint ouput', () => {\n" \ + " expect(actualLintOutput).toMatchSnapshot();\n" \ + "});\n" > test.js + +# Run the integration test +CMD [ "./test.sh" ] diff --git a/tests/integration/fixtures/vue-jsx/Jsx.vue b/tests/integration/fixtures/vue-jsx/Jsx.vue new file mode 100644 index 000000000000..c08599249c39 --- /dev/null +++ b/tests/integration/fixtures/vue-jsx/Jsx.vue @@ -0,0 +1,36 @@ + diff --git a/tests/integration/fixtures/vue-jsx/test.js.snap b/tests/integration/fixtures/vue-jsx/test.js.snap new file mode 100644 index 000000000000..d4432e47428a --- /dev/null +++ b/tests/integration/fixtures/vue-jsx/test.js.snap @@ -0,0 +1,63 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`it should produce the expected lint ouput 1`] = ` +Array [ + Object { + "errorCount": 1, + "filePath": "/usr/linked/Jsx.vue", + "fixableErrorCount": 0, + "fixableWarningCount": 0, + "messages": Array [ + Object { + "column": 17, + "endColumn": 20, + "endLine": 17, + "line": 17, + "message": "Unexpected any. Specify a different type.", + "messageId": "unexpectedAny", + "nodeType": "TSAnyKeyword", + "ruleId": "@typescript-eslint/no-explicit-any", + "severity": 2, + }, + ], + "source": " +", + "warningCount": 0, + }, +] +`; diff --git a/tests/integration/fixtures/vue-jsx/test.sh b/tests/integration/fixtures/vue-jsx/test.sh new file mode 100755 index 000000000000..f59b6348fd6b --- /dev/null +++ b/tests/integration/fixtures/vue-jsx/test.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# Generate the package.json to use +node /usr/utils/generate-package-json.js + +# Install dependencies +npm install + +# Use the local volumes for our own packages +npm install $(npm pack /usr/typescript-estree | tail -1) +npm install $(npm pack /usr/parser | tail -1) +npm install $(npm pack /usr/eslint-plugin | tail -1) + +# Install the latest vue-eslint-parser (this may break us occassionally, but it's probably good to get that feedback early) +npm install vue-eslint-parser@latest + +# Install the latest eslint-plugin-vue (this may break us occassionally, but it's probably good to get that feedback early) +npm install eslint-plugin-vue@latest + +# Install the latest some other vue utilities +npm install vuex@latest +npm install vue-property-decorator@latest + +# Run the linting +# (the "|| true" helps make sure that we run our tests on failed linting runs as well) +npx eslint --format json --output-file /usr/lint-output.json --config /usr/linked/.eslintrc.yml /usr/linked/**/*.vue || true + +# Run our assertions against the linting output +npx jest /usr/test.js --snapshotResolver=/usr/utils/jest-snapshot-resolver.js diff --git a/tests/integration/fixtures/vue-jsx/tsconfig.json b/tests/integration/fixtures/vue-jsx/tsconfig.json new file mode 100644 index 000000000000..861b7d99bedf --- /dev/null +++ b/tests/integration/fixtures/vue-jsx/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "strict": true + }, + "include": [ + "*.vue" + ] +} diff --git a/tests/integration/fixtures/vue-sfc/.eslintrc.yml b/tests/integration/fixtures/vue-sfc/.eslintrc.yml index f20f5baf1746..7b9b183b59bc 100644 --- a/tests/integration/fixtures/vue-sfc/.eslintrc.yml +++ b/tests/integration/fixtures/vue-sfc/.eslintrc.yml @@ -6,6 +6,9 @@ env: es6: true node: true +extends: + plugin:vue/essential + parserOptions: # Local version of @typescript-eslint/parser parser: '@typescript-eslint/parser' diff --git a/tests/integration/fixtures/vue-sfc/World.vue b/tests/integration/fixtures/vue-sfc/World.vue new file mode 100644 index 000000000000..ade2b409a3b6 --- /dev/null +++ b/tests/integration/fixtures/vue-sfc/World.vue @@ -0,0 +1,30 @@ + + + + diff --git a/tests/integration/fixtures/vue-sfc/test.js.snap b/tests/integration/fixtures/vue-sfc/test.js.snap index 49bd30cc3897..df23862a1253 100644 --- a/tests/integration/fixtures/vue-sfc/test.js.snap +++ b/tests/integration/fixtures/vue-sfc/test.js.snap @@ -59,5 +59,13 @@ export default Vue.extend({ ", "warningCount": 0, }, + Object { + "errorCount": 0, + "filePath": "/usr/linked/World.vue", + "fixableErrorCount": 0, + "fixableWarningCount": 0, + "messages": Array [], + "warningCount": 0, + }, ] `; diff --git a/tests/integration/fixtures/vue-sfc/test.sh b/tests/integration/fixtures/vue-sfc/test.sh index ba89362dcd13..f59b6348fd6b 100755 --- a/tests/integration/fixtures/vue-sfc/test.sh +++ b/tests/integration/fixtures/vue-sfc/test.sh @@ -14,6 +14,13 @@ npm install $(npm pack /usr/eslint-plugin | tail -1) # Install the latest vue-eslint-parser (this may break us occassionally, but it's probably good to get that feedback early) npm install vue-eslint-parser@latest +# Install the latest eslint-plugin-vue (this may break us occassionally, but it's probably good to get that feedback early) +npm install eslint-plugin-vue@latest + +# Install the latest some other vue utilities +npm install vuex@latest +npm install vue-property-decorator@latest + # Run the linting # (the "|| true" helps make sure that we run our tests on failed linting runs as well) npx eslint --format json --output-file /usr/lint-output.json --config /usr/linked/.eslintrc.yml /usr/linked/**/*.vue || true diff --git a/tests/integration/fixtures/vue-sfc/tsconfig.json b/tests/integration/fixtures/vue-sfc/tsconfig.json index 86423f3e4aa2..861b7d99bedf 100644 --- a/tests/integration/fixtures/vue-sfc/tsconfig.json +++ b/tests/integration/fixtures/vue-sfc/tsconfig.json @@ -1,5 +1,8 @@ { "compilerOptions": { "strict": true - } -} \ No newline at end of file + }, + "include": [ + "*.vue" + ] +} diff --git a/tests/integration/run-all-tests.sh b/tests/integration/run-all-tests.sh index 4506da773492..8964e3198690 100755 --- a/tests/integration/run-all-tests.sh +++ b/tests/integration/run-all-tests.sh @@ -10,5 +10,11 @@ docker-compose -f tests/integration/docker-compose.yml up --build --abort-on-con # vue-sfc docker-compose -f tests/integration/docker-compose.yml up --build --abort-on-container-exit vue-sfc +# vue-jsx +docker-compose -f tests/integration/docker-compose.yml up --build --abort-on-container-exit vue-jsx + # recommended-does-not-require-program docker-compose -f tests/integration/docker-compose.yml up --build --abort-on-container-exit recommended-does-not-require-program + +# markdown +docker-compose -f tests/integration/docker-compose.yml up --build --abort-on-container-exit markdown diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json new file mode 100644 index 000000000000..2d9938163eac --- /dev/null +++ b/tsconfig.eslint.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig.base.json", + "include": ["tests/**/*.ts", "tools/**/*.ts"] +} diff --git a/yarn.lock b/yarn.lock index 9f41d090fe99..58e28ad5ec0a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10,17 +10,17 @@ "@babel/highlight" "^7.0.0" "@babel/core@^7.1.0": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.5.5.tgz#17b2686ef0d6bc58f963dddd68ab669755582c30" - integrity sha512-i4qoSr2KTtce0DmkuuQBV4AuQgGPUcPXMr9L5MyYAtk06z068lQ10a4O009fe5OB/DfNV+h+qqT7ddNV8UnRjg== + version "7.6.2" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.6.2.tgz#069a776e8d5e9eefff76236bc8845566bd31dd91" + integrity sha512-l8zto/fuoZIbncm+01p8zPSDZu/VuuJhAfA7d/AbzM09WR7iVhavvfNDYCNpo1VvLk6E6xgAoP9P+/EMJHuRkQ== dependencies: "@babel/code-frame" "^7.5.5" - "@babel/generator" "^7.5.5" - "@babel/helpers" "^7.5.5" - "@babel/parser" "^7.5.5" - "@babel/template" "^7.4.4" - "@babel/traverse" "^7.5.5" - "@babel/types" "^7.5.5" + "@babel/generator" "^7.6.2" + "@babel/helpers" "^7.6.2" + "@babel/parser" "^7.6.2" + "@babel/template" "^7.6.0" + "@babel/traverse" "^7.6.2" + "@babel/types" "^7.6.0" convert-source-map "^1.1.0" debug "^4.1.0" json5 "^2.1.0" @@ -29,16 +29,15 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.4.0", "@babel/generator@^7.5.5": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.5.5.tgz#873a7f936a3c89491b43536d12245b626664e3cf" - integrity sha512-ETI/4vyTSxTzGnU2c49XHv2zhExkv9JHLTwDAFz85kmcwuShvYG2H08FwgIguQf4JC75CBnXAUM5PqeF4fj0nQ== +"@babel/generator@^7.4.0", "@babel/generator@^7.6.2": + version "7.6.2" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.6.2.tgz#dac8a3c2df118334c2a29ff3446da1636a8f8c03" + integrity sha512-j8iHaIW4gGPnViaIHI7e9t/Hl8qLjERI6DcV9kEpAIDJsAOrcnXqRS7t+QbhL76pwbtqP+QCQLL0z1CyVmtjjQ== dependencies: - "@babel/types" "^7.5.5" + "@babel/types" "^7.6.0" jsesc "^2.5.1" lodash "^4.17.13" source-map "^0.5.0" - trim-right "^1.0.1" "@babel/helper-function-name@^7.1.0": version "7.1.0" @@ -68,14 +67,14 @@ dependencies: "@babel/types" "^7.4.4" -"@babel/helpers@^7.5.5": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.5.5.tgz#63908d2a73942229d1e6685bc2a0e730dde3b75e" - integrity sha512-nRq2BUhxZFnfEn/ciJuhklHvFOqjJUD5wpx+1bxUF2axL9C+v4DE/dmp5sT2dKnpOs4orZWzpAZqlCy8QqE/7g== +"@babel/helpers@^7.6.2": + version "7.6.2" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.6.2.tgz#681ffe489ea4dcc55f23ce469e58e59c1c045153" + integrity sha512-3/bAUL8zZxYs1cdX2ilEE0WobqbCmKWr/889lf2SS0PpDcpEIY8pb1CCyz0pEcX3pEb+MCbks1jIokz2xLtGTA== dependencies: - "@babel/template" "^7.4.4" - "@babel/traverse" "^7.5.5" - "@babel/types" "^7.5.5" + "@babel/template" "^7.6.0" + "@babel/traverse" "^7.6.2" + "@babel/types" "^7.6.0" "@babel/highlight@^7.0.0": version "7.5.0" @@ -86,11 +85,16 @@ esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@7.5.5", "@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.4.4", "@babel/parser@^7.5.5": +"@babel/parser@7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.5.5.tgz#02f077ac8817d3df4a832ef59de67565e71cca4b" integrity sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g== +"@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.6.0", "@babel/parser@^7.6.2": + version "7.6.2" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.6.2.tgz#205e9c95e16ba3b8b96090677a67c9d6075b70a1" + integrity sha512-mdFqWrSPCmikBoaBYMuBulzTIKuXVPtEISFbRRVNwMWpCms/hmE2kRq0bblUHaNRKrjRlmVbx1sDHmjmRgD2Xg== + "@babel/plugin-syntax-object-rest-spread@^7.0.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e" @@ -98,41 +102,41 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/runtime@^7.2.0", "@babel/runtime@^7.4.5": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.5.5.tgz#74fba56d35efbeca444091c7850ccd494fd2f132" - integrity sha512-28QvEGyQyNkB0/m2B4FU7IEZGK2NUrcMtT6BZEFALTguLk+AUT6ofsHtPk5QyjAdUkpMJ+/Em+quwz4HOt30AQ== +"@babel/runtime@^7.2.0", "@babel/runtime@^7.5.5": + version "7.6.2" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.6.2.tgz#c3d6e41b304ef10dcf13777a33e7694ec4a9a6dd" + integrity sha512-EXxN64agfUqqIGeEjI5dL5z0Sw0ZwWo1mLTi4mQowCZ42O59b7DRpZAnTC6OqdF28wMBMFKNb/4uFGrVaigSpg== dependencies: regenerator-runtime "^0.13.2" -"@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237" - integrity sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw== +"@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.6.0.tgz#7f0159c7f5012230dad64cca42ec9bdb5c9536e6" + integrity sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.4.4" - "@babel/types" "^7.4.4" + "@babel/parser" "^7.6.0" + "@babel/types" "^7.6.0" -"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.5.5": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.5.5.tgz#f664f8f368ed32988cd648da9f72d5ca70f165bb" - integrity sha512-MqB0782whsfffYfSjH4TM+LMjrJnhCNEDMDIjeTpl+ASaUvxcjoiVCo/sM1GhS1pHOXYfWVCYneLjMckuUxDaQ== +"@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.6.2": + version "7.6.2" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.6.2.tgz#b0e2bfd401d339ce0e6c05690206d1e11502ce2c" + integrity sha512-8fRE76xNwNttVEF2TwxJDGBLWthUkHWSldmfuBzVRmEDWOtu4XdINTgN7TDWzuLg4bbeIMLvfMFD9we5YcWkRQ== dependencies: "@babel/code-frame" "^7.5.5" - "@babel/generator" "^7.5.5" + "@babel/generator" "^7.6.2" "@babel/helper-function-name" "^7.1.0" "@babel/helper-split-export-declaration" "^7.4.4" - "@babel/parser" "^7.5.5" - "@babel/types" "^7.5.5" + "@babel/parser" "^7.6.2" + "@babel/types" "^7.6.0" debug "^4.1.0" globals "^11.1.0" lodash "^4.17.13" -"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.3.2", "@babel/types@^7.4.0", "@babel/types@^7.4.4", "@babel/types@^7.5.5": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.5.5.tgz#97b9f728e182785909aa4ab56264f090a028d18a" - integrity sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw== +"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.3.2", "@babel/types@^7.4.0", "@babel/types@^7.4.4", "@babel/types@^7.6.0": + version "7.6.1" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.6.1.tgz#53abf3308add3ac2a2884d539151c57c4b3ac648" + integrity sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g== dependencies: esutils "^2.0.2" lodash "^4.17.13" @@ -146,17 +150,17 @@ exec-sh "^0.3.2" minimist "^1.2.0" -"@commitlint/cli@^8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-8.1.0.tgz#a3d4236c0ac961d7026a53d728b179c696d6a045" - integrity sha512-83K5C2nIAgoZlzMegf0/MEBjX+ampUyc/u79RxgX9ZYjzos+RQtNyO7I43dztVxPXSwAnX9XRgoOfkGWA4nbig== +"@commitlint/cli@^8.1.0", "@commitlint/cli@^8.2.0": + version "8.2.0" + resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-8.2.0.tgz#fbf9969e04e2162d985eaa644fdad6ce807aadb6" + integrity sha512-8fJ5pmytc38yw2QWbTTJmXLfSiWPwMkHH4govo9zJ/+ERPBF2jvlxD/dQvk24ezcizjKc6LFka2edYC4OQ+Dgw== dependencies: - "@commitlint/format" "^8.1.0" - "@commitlint/lint" "^8.1.0" - "@commitlint/load" "^8.1.0" - "@commitlint/read" "^8.1.0" + "@commitlint/format" "^8.2.0" + "@commitlint/lint" "^8.2.0" + "@commitlint/load" "^8.2.0" + "@commitlint/read" "^8.2.0" babel-polyfill "6.26.0" - chalk "2.3.1" + chalk "2.4.2" get-stdin "7.0.0" lodash "4.17.14" meow "5.0.0" @@ -164,89 +168,89 @@ resolve-global "1.0.0" "@commitlint/config-conventional@^8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@commitlint/config-conventional/-/config-conventional-8.1.0.tgz#ba61fbf0ad4df52da2b5ee3034470371a2cbf039" - integrity sha512-/JY+FNBnrT91qzDVIoV1Buiigvj7Le7ezFw+oRqu0nYREX03k7xnaG/7t7rUSvm7hM6dnLSOlaUsevjgMI9AEw== + version "8.2.0" + resolved "https://registry.yarnpkg.com/@commitlint/config-conventional/-/config-conventional-8.2.0.tgz#886a5538e3708e017ec2871e0cbce00f635d3102" + integrity sha512-HuwlHQ3DyVhpK9GHgTMhJXD8Zp8PGIQVpQGYh/iTrEU6TVxdRC61BxIDZvfWatCaiG617Z/U8maRAFrqFM4TqA== -"@commitlint/ensure@^8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@commitlint/ensure/-/ensure-8.1.0.tgz#6c669f85c3005ed15c8141d83cf5312c43001613" - integrity sha512-dBU4CcjN0vJSDNOeSpaHNgQ1ra444u4USvI6PTaHVAS4aeDpZ5Cds1rxkZNsocu48WNycUu0jP84+zjcw2pPLQ== +"@commitlint/ensure@^8.2.0": + version "8.2.0" + resolved "https://registry.yarnpkg.com/@commitlint/ensure/-/ensure-8.2.0.tgz#fad0c81c3d3bd09aa5fbcbcc483ae1f39bc8af8f" + integrity sha512-XZZih/kcRrqK7lEORbSYCfqQw6byfsFbLygRGVdJMlCPGu9E2MjpwCtoj5z7y/lKfUB3MJaBhzn2muJqS1gC6A== dependencies: lodash "4.17.14" -"@commitlint/execute-rule@^8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@commitlint/execute-rule/-/execute-rule-8.1.0.tgz#e8386bd0836b3dcdd41ebb9d5904bbeb447e4715" - integrity sha512-+vpH3RFuO6ypuCqhP2rSqTjFTQ7ClzXtUvXphpROv9v9+7zH4L+Ex+wZLVkL8Xj2cxefSLn/5Kcqa9XyJTn3kg== +"@commitlint/execute-rule@^8.2.0": + version "8.2.0" + resolved "https://registry.yarnpkg.com/@commitlint/execute-rule/-/execute-rule-8.2.0.tgz#aefb3744e22613660adefb7ebcccaa60bd24e78d" + integrity sha512-9MBRthHaulbWTa8ReG2Oii2qc117NuvzhZdnkuKuYLhker7sUXGFcVhLanuWUKGyfyI2o9zVr/NHsNbCCsTzAA== -"@commitlint/format@^8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@commitlint/format/-/format-8.1.0.tgz#c3f3ca78bb74cbc1cce1368c0974b0cb8f31b98e" - integrity sha512-D0cmabUTQIKdABgt08d9JAvO9+lMRAmkcsZx8TMScY502R67HCw77JhzRDcw1RmqX5rN8JO6ZjDHO92Pbwlt+Q== +"@commitlint/format@^8.2.0": + version "8.2.0" + resolved "https://registry.yarnpkg.com/@commitlint/format/-/format-8.2.0.tgz#0a2447fadac7c0421ce8a8d7e27dfa2172c737d4" + integrity sha512-sA77agkDEMsEMrlGhrLtAg8vRexkOofEEv/CZX+4xlANyAz2kNwJvMg33lcL65CBhqKEnRRJRxfZ1ZqcujdKcQ== dependencies: chalk "^2.0.1" -"@commitlint/is-ignored@^8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@commitlint/is-ignored/-/is-ignored-8.1.0.tgz#c0583fa3c641b2d4898be1443e70e9c467429de2" - integrity sha512-HUSxx6kuLbqrQ8jb5QRzo+yR+CIXgA9HNcIcZ1qWrb+O9GOixt3mlW8li1IcfIgfODlaWoxIz0jYCxR08IoQLg== +"@commitlint/is-ignored@^8.2.0": + version "8.2.0" + resolved "https://registry.yarnpkg.com/@commitlint/is-ignored/-/is-ignored-8.2.0.tgz#b6409ab28bf5a80f25e14da17da3916adb230a89" + integrity sha512-ADaGnKfbfV6KD1pETp0Qf7XAyc75xTy3WJlbvPbwZ4oPdBMsXF0oXEEGMis6qABfU2IXan5/KAJgAFX3vdd0jA== dependencies: "@types/semver" "^6.0.1" - semver "6.1.1" + semver "6.2.0" -"@commitlint/lint@^8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@commitlint/lint/-/lint-8.1.0.tgz#ad10f4885c06f14c71de11dcd6bf2ca54a395141" - integrity sha512-WYjbUgtqvnlVH3S3XPZMAa+N7KO0yQ+GuUG20Qra+EtER6SRYawykmEs4wAyrmY8VcFXUnKgSlIQUsqmGKwNZQ== +"@commitlint/lint@^8.2.0": + version "8.2.0" + resolved "https://registry.yarnpkg.com/@commitlint/lint/-/lint-8.2.0.tgz#aadc606379f3550eb877f16d4f5b103639cbf92a" + integrity sha512-ch9JN8aR37ufdjoWv50jLfvFz9rWMgLW5HEkMGLsM/51gjekmQYS5NJg8S2+6F5+jmralAO7VkUMI6FukXKX0A== dependencies: - "@commitlint/is-ignored" "^8.1.0" - "@commitlint/parse" "^8.1.0" - "@commitlint/rules" "^8.1.0" + "@commitlint/is-ignored" "^8.2.0" + "@commitlint/parse" "^8.2.0" + "@commitlint/rules" "^8.2.0" babel-runtime "^6.23.0" lodash "4.17.14" -"@commitlint/load@>6.1.1", "@commitlint/load@^8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@commitlint/load/-/load-8.1.0.tgz#63b72ae5bb9152b8fa5b17c5428053032a9a49c8" - integrity sha512-ra02Dvmd7Gp1+uFLzTY3yGOpHjPzl5T9wYg/xrtPJNiOWXvQ0Mw7THw+ucd1M5iLUWjvdavv2N87YDRc428wHg== +"@commitlint/load@>6.1.1", "@commitlint/load@^8.2.0": + version "8.2.0" + resolved "https://registry.yarnpkg.com/@commitlint/load/-/load-8.2.0.tgz#9ca53a0c795e4f63d796b4d42279e856549add1a" + integrity sha512-EV6PfAY/p83QynNd1llHxJiNxKmp43g8+7dZbyfHFbsGOdokrCnoelAVZ+WGgktXwLN/uXyfkcIAxwac015UYw== dependencies: - "@commitlint/execute-rule" "^8.1.0" - "@commitlint/resolve-extends" "^8.1.0" + "@commitlint/execute-rule" "^8.2.0" + "@commitlint/resolve-extends" "^8.2.0" babel-runtime "^6.23.0" chalk "2.4.2" cosmiconfig "^5.2.0" lodash "4.17.14" resolve-from "^5.0.0" -"@commitlint/message@^8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@commitlint/message/-/message-8.1.0.tgz#8fb8046ddaa7e5c846a79da7cdbd15cf1a7770ae" - integrity sha512-AjHq022G8jQQ/3YrBOjwVBD4xF75hvC3vcvFoBIb7cC8vad1QWq+1w+aks0KlEK5IW+/+7ORZXIH+oyW7h3+8A== +"@commitlint/message@^8.2.0": + version "8.2.0" + resolved "https://registry.yarnpkg.com/@commitlint/message/-/message-8.2.0.tgz#bdc0388183f6bc6006c7e7e197a721683011907a" + integrity sha512-LNsSwDLIFgE3nb/Sb1PIluYNy4Q8igdf4tpJCdv5JJDf7CZCZt3ZTglj0YutZZorpRRuHJsVIB2+dI4bVH3bFw== -"@commitlint/parse@^8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@commitlint/parse/-/parse-8.1.0.tgz#833243c6d848e7a7e775a283b38697166ed2fd22" - integrity sha512-n4fEbZ5kdK5HChvne7Mj8rGGkKMfA4H11IuWiWmmMzgmZTNb/B04LPrzdUm4lm3f10XzM2JMM7PLXqofQJOGvA== +"@commitlint/parse@^8.2.0": + version "8.2.0" + resolved "https://registry.yarnpkg.com/@commitlint/parse/-/parse-8.2.0.tgz#de80137e89ee5a2d3029656c9b33e90c88c6f56c" + integrity sha512-vzouqroTXG6QXApkrps0gbeSYW6w5drpUk7QAeZIcaCSPsQXDM8eqqt98ZzlzLJHo5oPNXPX1AAVSTrssvHemA== dependencies: conventional-changelog-angular "^1.3.3" conventional-commits-parser "^2.1.0" lodash "^4.17.11" -"@commitlint/read@^8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@commitlint/read/-/read-8.1.0.tgz#effe07c965ba1735a5f7f8b7b19ac4d98c887507" - integrity sha512-PKsGMQFEr2sX/+orI71b82iyi8xFqb7F4cTvsLxzB5x6/QutxPVM3rg+tEVdi6rBKIDuqRIp2puDZQuREZs3vg== +"@commitlint/read@^8.2.0": + version "8.2.0" + resolved "https://registry.yarnpkg.com/@commitlint/read/-/read-8.2.0.tgz#54c6549723d532c74434ee0d74e0459032dc9159" + integrity sha512-1tBai1VuSQmsOTsvJr3Fi/GZqX3zdxRqYe/yN4i3cLA5S2Y4QGJ5I3l6nGZlKgm/sSelTCVKHltrfWU8s5H7SA== dependencies: - "@commitlint/top-level" "^8.1.0" + "@commitlint/top-level" "^8.2.0" "@marionebl/sander" "^0.6.0" babel-runtime "^6.23.0" git-raw-commits "^1.3.0" -"@commitlint/resolve-extends@^8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@commitlint/resolve-extends/-/resolve-extends-8.1.0.tgz#ed67f2ee484160ac8e0078bae52f172625157472" - integrity sha512-r/y+CeKW72Oa9BUctS1+I/MFCDiI3lfhwfQ65Tpfn6eZ4CuBYKzrCRi++GTHeAFKE3y8q1epJq5Rl/1GBejtBw== +"@commitlint/resolve-extends@^8.2.0": + version "8.2.0" + resolved "https://registry.yarnpkg.com/@commitlint/resolve-extends/-/resolve-extends-8.2.0.tgz#b7f2f0c71c10f24b98a199ed11d2c14cfd7a318f" + integrity sha512-cwi0HUsDcD502HBP8huXfTkVuWmeo1Fiz3GKxNwMBBsJV4+bKa7QrtxbNpXhVuarX7QjWfNTvmW6KmFS7YK9uw== dependencies: "@types/node" "^12.0.2" import-fresh "^3.0.0" @@ -254,36 +258,36 @@ resolve-from "^5.0.0" resolve-global "^1.0.0" -"@commitlint/rules@^8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@commitlint/rules/-/rules-8.1.0.tgz#009c64a8a23feb4647e5a25057997be62a272c8a" - integrity sha512-hlM8VfNjsOkbvMteFyqn0c3akiUjqG09Iid28MBLrXl/d+8BR3eTzwJ4wMta4oz/iqGyrIywvg1FpHrV977MPA== +"@commitlint/rules@^8.2.0": + version "8.2.0" + resolved "https://registry.yarnpkg.com/@commitlint/rules/-/rules-8.2.0.tgz#4cd6a323ca1a3f3d33ae6dc723f8c88f3dcde347" + integrity sha512-FlqSBBP2Gxt5Ibw+bxdYpzqYR6HI8NIBpaTBhAjSEAduQtdWFMOhF0zsgkwH7lHN7opaLcnY2fXxAhbzTmJQQA== dependencies: - "@commitlint/ensure" "^8.1.0" - "@commitlint/message" "^8.1.0" - "@commitlint/to-lines" "^8.1.0" + "@commitlint/ensure" "^8.2.0" + "@commitlint/message" "^8.2.0" + "@commitlint/to-lines" "^8.2.0" babel-runtime "^6.23.0" -"@commitlint/to-lines@^8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@commitlint/to-lines/-/to-lines-8.1.0.tgz#5bf2597f46acacec4b1b3dba832ac8934798b22a" - integrity sha512-Lh4OH1bInI8GME/7FggS0/XkIMEJdTObMbXRyPRGaPcWH5S7zpB6y+b4qjzBHXAbEv2O46QAAMjZ+ywPQCpmYQ== +"@commitlint/to-lines@^8.2.0": + version "8.2.0" + resolved "https://registry.yarnpkg.com/@commitlint/to-lines/-/to-lines-8.2.0.tgz#dddb5916a457e1a79e437115a9b8eac7bf9ad52a" + integrity sha512-LXTYG3sMenlN5qwyTZ6czOULVcx46uMy+MEVqpvCgptqr/MZcV/C2J+S2o1DGwj1gOEFMpqrZaE3/1R2Q+N8ng== -"@commitlint/top-level@^8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@commitlint/top-level/-/top-level-8.1.0.tgz#f1950de73a1f76ef5c9e753a6b77402e0755d677" - integrity sha512-EvQuofuA/+0l1w9pkG/PRyIwACmZdIh9qxyax7w7mR8qqmSHscqf2jARIylh1TOx0uI9egO8MuPLiwC1RwyREA== +"@commitlint/top-level@^8.2.0": + version "8.2.0" + resolved "https://registry.yarnpkg.com/@commitlint/top-level/-/top-level-8.2.0.tgz#206e7cbc54dbe9494190677f887dd60943fed5b0" + integrity sha512-Yaw4KmYNy31/HhRUuZ+fupFcDalnfpdu4JGBgGAqS9aBHdMSSWdWqtAaDaxdtWjTZeN3O0sA2gOhXwvKwiDwvw== dependencies: find-up "^4.0.0" "@commitlint/travis-cli@^8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@commitlint/travis-cli/-/travis-cli-8.1.0.tgz#0c8dc099644cd2da8bd3e55ac9cc3055f1906504" - integrity sha512-HSeinF08sstSTXDIPvTx5evAd4U49NLF1n0eAXu9rzyHA+ELc6gVSiW3HnIdNx83WkTV+nuQIPQGXqXYx9vleA== + version "8.2.0" + resolved "https://registry.yarnpkg.com/@commitlint/travis-cli/-/travis-cli-8.2.0.tgz#ad916afee6c3cb4c120119e7acc6aca35a911cfe" + integrity sha512-SXZh9qpAWwvzW2KlG5HOxnci1KMkUZOqr2wKMzgXuV+BS5jhkZaPsKvrrs85FZtUWdJuqFNHTVXKoetgWgMXpQ== dependencies: - "@commitlint/cli" "^8.1.0" + "@commitlint/cli" "^8.2.0" babel-runtime "6.26.0" - execa "0.9.0" + execa "0.11.0" "@evocateur/libnpmaccess@^3.1.2": version "3.1.2" @@ -359,16 +363,7 @@ unique-filename "^1.1.1" which "^1.3.1" -"@jest/console@^24.7.1": - version "24.7.1" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.7.1.tgz#32a9e42535a97aedfe037e725bd67e954b459545" - integrity sha512-iNhtIy2M8bXlAOULWVTUxmnelTLFneTNEkHCgPmgd+zNwy9zVddJ6oS5rZ9iwoscNdT5mMwUd0C51v/fSlzItg== - dependencies: - "@jest/source-map" "^24.3.0" - chalk "^2.0.1" - slash "^2.0.0" - -"@jest/console@^24.9.0": +"@jest/console@^24.7.1", "@jest/console@^24.9.0": version "24.9.0" resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.9.0.tgz#79b1bc06fb74a8cfb01cbdedf945584b1b9707f0" integrity sha512-Zuj6b8TnKXi3q4ymac8EQfc3ea/uhLeCGThFqXeC8H9/raaH8ARPUTdId+XyGd03Z4In0/VjD2OYFcBF09fNLQ== @@ -457,16 +452,7 @@ source-map "^0.6.0" string-length "^2.0.0" -"@jest/source-map@^24.3.0": - version "24.3.0" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-24.3.0.tgz#563be3aa4d224caf65ff77edc95cd1ca4da67f28" - integrity sha512-zALZt1t2ou8le/crCeeiRYzvdnTzaIlpOWaet45lNSqNJUnXbppUUFR4ZUAlzgDmKee4Q5P/tKXypI1RiHwgag== - dependencies: - callsites "^3.0.0" - graceful-fs "^4.1.15" - source-map "^0.6.0" - -"@jest/source-map@^24.9.0": +"@jest/source-map@^24.3.0", "@jest/source-map@^24.9.0": version "24.9.0" resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-24.9.0.tgz#0e263a94430be4b41da683ccc1e6bffe2a191714" integrity sha512-/Xw7xGlsZb4MJzNDgB7PW5crou5JqWiBQaz6xyPd3ArOg2nfn/PunV8+olXbbEZzNl591o5rWKE9BRDaFAuIBg== @@ -1220,18 +1206,18 @@ call-me-maybe "^1.0.1" glob-to-regexp "^0.3.0" -"@nodelib/fs.scandir@2.1.2": - version "2.1.2" - resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.2.tgz#1f981cd5b83e85cfdeb386fc693d4baab392fa54" - integrity sha512-wrIBsjA5pl13f0RN4Zx4FNWmU71lv03meGKnqRUoCyan17s4V3WL92f3w3AIuWbNnpcrQyFBU5qMavJoB8d27w== +"@nodelib/fs.scandir@2.1.3": + version "2.1.3" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz#3a582bdb53804c6ba6d146579c46e52130cf4a3b" + integrity sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw== dependencies: - "@nodelib/fs.stat" "2.0.2" + "@nodelib/fs.stat" "2.0.3" run-parallel "^1.1.9" -"@nodelib/fs.stat@2.0.2", "@nodelib/fs.stat@^2.0.1": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.2.tgz#2762aea8fe78ea256860182dcb52d61ee4b8fda6" - integrity sha512-z8+wGWV2dgUhLqrtRYa03yDx4HWMvXKi1z8g3m2JyxAx8F7xk74asqPk5LAETjqDSGLFML/6CDl0+yFunSYicw== +"@nodelib/fs.stat@2.0.3", "@nodelib/fs.stat@^2.0.1": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz#34dc5f4cabbc720f4e60f75a747e7ecd6c175bd3" + integrity sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA== "@nodelib/fs.stat@^1.1.2": version "1.1.3" @@ -1239,22 +1225,20 @@ integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== "@nodelib/fs.walk@^1.2.1": - version "1.2.3" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.3.tgz#a555dc256acaf00c62b0db29529028dd4d4cb141" - integrity sha512-l6t8xEhfK9Sa4YO5mIRdau7XSOADfmh3jCr0evNHdY+HNkW6xuQhgMH7D73VV6WpZOagrW0UludvMTiifiwTfA== + version "1.2.4" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz#011b9202a70a6366e436ca5c065844528ab04976" + integrity sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ== dependencies: - "@nodelib/fs.scandir" "2.1.2" + "@nodelib/fs.scandir" "2.1.3" fastq "^1.6.0" "@octokit/endpoint@^5.1.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-5.3.0.tgz#7c4a8d74e88176206817bf513b63b1859a84c475" - integrity sha512-D7u80EdZHlHzYl81PgoKXFFIl121eLahKI6WFvuhwE4ih+U+YWrE1fGiH9eybr8l3mGgZ9iITYGBR+7UR5S9QA== + version "5.3.6" + resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-5.3.6.tgz#58a67b75b853127568e0db533cdd10f3bdca2e23" + integrity sha512-XuerByak8H+jW9J/rVMEdBXfI4UTsDWUwAKgIP/uhQjXIUVdPRwt2Zg+SmbWQ+WY7pRkw/hFVES8C4G/Kle7oA== dependencies: - deepmerge "4.0.0" is-plain-object "^3.0.0" - universal-user-agent "^3.0.0" - url-template "^2.0.8" + universal-user-agent "^4.0.0" "@octokit/plugin-enterprise-rest@^3.6.1": version "3.6.2" @@ -1270,9 +1254,9 @@ once "^1.4.0" "@octokit/request@^5.0.0": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.0.1.tgz#6705c9a883db0ac0f58cee717e806b6575d4a199" - integrity sha512-SHOk/APYpfrzV1RNf7Ux8SZi+vZXhMIB2dBr4TQR6ExMX8R4jcy/0gHw26HLe1dWV7Wxe9WzYyDSEC0XwnoCSQ== + version "5.1.0" + resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.1.0.tgz#5609dcc7b5323e529f29d535214383d9eaf0c05c" + integrity sha512-I15T9PwjFs4tbWyhtFU2Kq7WDPidYMvRB7spmxoQRZfxSmiqullG+Nz+KbSmpkfnlvHwTr1e31R5WReFRKMXjg== dependencies: "@octokit/endpoint" "^5.1.0" "@octokit/request-error" "^1.0.1" @@ -1280,12 +1264,12 @@ is-plain-object "^3.0.0" node-fetch "^2.3.0" once "^1.4.0" - universal-user-agent "^3.0.0" + universal-user-agent "^4.0.0" "@octokit/rest@^16.28.4": - version "16.28.7" - resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-16.28.7.tgz#a2c2db5b318da84144beba82d19c1a9dbdb1a1fa" - integrity sha512-cznFSLEhh22XD3XeqJw51OLSfyL2fcFKUO+v2Ep9MTAFfFLS1cK1Zwd1yEgQJmJoDnj4/vv3+fGGZweG+xsbIA== + version "16.30.2" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-16.30.2.tgz#da379a6f4f7e7e152733d38a9cba21da5c76ef7c" + integrity sha512-6YN4N/uWjjBUx4TNfWAxkrzCy1i7M4agdHs2g/sOTdSY/Va3T1v/f/ME5EnNfd64AMpBWee6rcLHQe5fki89lg== dependencies: "@octokit/request" "^5.0.0" "@octokit/request-error" "^1.0.2" @@ -1298,8 +1282,7 @@ lodash.uniq "^4.5.0" octokit-pagination-methods "^1.1.0" once "^1.4.0" - universal-user-agent "^3.0.0" - url-template "^2.0.8" + universal-user-agent "^4.0.0" "@samverschueren/stream-to-observable@^0.3.0": version "0.3.0" @@ -1314,9 +1297,9 @@ integrity sha512-HAdhFeYOZKIkrR2jbonCJxp3I/o2G/kxY+CIx7qX9Kmv5jY+9D7OgmgSLdRqeHacB5RlqE5efj2WIDFL9NXCyg== "@types/babel__core@^7.1.0": - version "7.1.2" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.2.tgz#608c74f55928033fce18b99b213c16be4b3d114f" - integrity sha512-cfCCrFmiGY/yq0NuKNxIQvZFy9kY/1immpSpTngOnyIbD4+eJOG5mxphhHDv3CHL9GltO4GcKr54kGBg3RNdbg== + version "7.1.3" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.3.tgz#e441ea7df63cd080dfcd02ab199e6d16a735fc30" + integrity sha512-8fBo0UR2CcwWxeX7WIIgJ7lXjasFxoYgRnFHUj+hRvKkpiBJbxhdAPTCY6/ZKM0uxANFVzt4yObSLuTiTnazDA== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" @@ -1325,9 +1308,9 @@ "@types/babel__traverse" "*" "@types/babel__generator@*": - version "7.0.2" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.0.2.tgz#d2112a6b21fad600d7674274293c85dce0cb47fc" - integrity sha512-NHcOfab3Zw4q5sEE2COkpfXjoE7o+PmqD9DQW4koUT3roNxwziUdXGnRndMat/LJNUtePwn1TlP4do3uoe3KZQ== + version "7.6.0" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.0.tgz#f1ec1c104d1bb463556ecb724018ab788d0c172a" + integrity sha512-c1mZUu4up5cp9KROs/QAw0gTeHrw/x7m52LcnvMxxOZ03DmLwPV0MlGmlgzV3cnSdjhJOZsj7E7FHeioai+egw== dependencies: "@babel/types" "^7.0.0" @@ -1346,6 +1329,11 @@ dependencies: "@babel/types" "^7.3.0" +"@types/debug@^4.1.5": + version "4.1.5" + resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.5.tgz#b14efa8852b7768d898906613c23f688713e02cd" + integrity sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ== + "@types/eslint-visitor-keys@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" @@ -1429,9 +1417,9 @@ "@types/lodash" "*" "@types/lodash@*": - version "4.14.136" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.136.tgz#413e85089046b865d960c9ff1d400e04c31ab60f" - integrity sha512-0GJhzBdvsW2RUccNHOBkabI8HZVdOXmXbXhuKlDEd5Vv12P7oAVGfomGp3Ne21o5D/qu1WmthlNKFaoZJJeErA== + version "4.14.141" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.141.tgz#d81f4d0c562abe28713406b571ffb27692a82ae6" + integrity sha512-v5NYIi9qEbFEUpCyikmnOYe4YlP8BMUdTcNCAquAKzu+FA7rZ1onj9x80mbnDdOW/K5bFf3Tv5kJplP33+gAbQ== "@types/marked@^0.6.5": version "0.6.5" @@ -1443,15 +1431,10 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== -"@types/node@*", "@types/node@^12.0.2": - version "12.6.8" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.6.8.tgz#e469b4bf9d1c9832aee4907ba8a051494357c12c" - integrity sha512-aX+gFgA5GHcDi89KG5keey2zf0WfZk/HAQotEamsK2kbey+8yGKcson0hbK8E+v0NArlCJQCqMP161YhV6ZXLg== - -"@types/node@^12.7.2": - version "12.7.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.7.2.tgz#c4e63af5e8823ce9cc3f0b34f7b998c2171f0c44" - integrity sha512-dyYO+f6ihZEtNPDcWNR1fkoTDf3zAK3lAABDze3mz6POyIercH0lEUawUFXlG8xaQZmm1yEBON/4TsYv/laDYg== +"@types/node@*", "@types/node@^12.0.2", "@types/node@^12.7.2": + version "12.7.11" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.7.11.tgz#be879b52031cfb5d295b047f5462d8ef1a716446" + integrity sha512-Otxmr2rrZLKRYIybtdG/sgeO+tHY20GxeDjcGmUnmmlCWyEnv2a2x1ZXBo3BTec4OiTXMQCiazB8NMBf0iRlFw== "@types/normalize-package-data@^2.4.0": version "2.4.0" @@ -1459,29 +1442,34 @@ integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== "@types/prettier@^1.18.2": - version "1.18.2" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-1.18.2.tgz#069e7d132024d436fd1f5771f6932426a695f230" - integrity sha512-2JBasa5Qaj81Qsp/dxX2Njy+MdKC767WytHUDsRM7TYEfQvKPxsnGpnCBlBS1i2Aiv1YwCpmKSbQ6O6v8TpiKg== + version "1.18.3" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-1.18.3.tgz#64ff53329ce16139f17c3db9d3e0487199972cd8" + integrity sha512-48rnerQdcZ26odp+HOvDGX8IcUkYOCuMc2BodWYTe956MqkHlOGAG4oFQ83cjZ0a4GAgj7mb4GUClxYd2Hlodg== "@types/semver@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-6.0.1.tgz#a984b405c702fa5a7ec6abc56b37f2ba35ef5af6" - integrity sha512-ffCdcrEE5h8DqVxinQjo+2d1q+FV5z7iNtPofw3JsrltSoSVlOGaW0rY8XxtO9XukdTn8TaCGWmk2VFGhI70mg== + version "6.0.2" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-6.0.2.tgz#5e8b09f0e4af53034b1d0fb9977a277847836205" + integrity sha512-G1Ggy7/9Nsa1Jt2yiBR2riEuyK2DFNnqow6R7cromXPMNynackRY1vqFTLz/gwnef1LHokbXThcPhqMRjUbkpQ== "@types/stack-utils@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw== +"@types/tmp@^0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@types/tmp/-/tmp-0.1.0.tgz#19cf73a7bcf641965485119726397a096f0049bd" + integrity sha512-6IwZ9HzWbCq6XoQWhxLpDjuADodH/MKXRUIDFudvgjcVdjFknvmR+DNsoUeer4XPrEnrZs04Jj+kfV9pFsrhmA== + "@types/yargs-parser@*": - version "13.0.0" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-13.0.0.tgz#453743c5bbf9f1bed61d959baab5b06be029b2d0" - integrity sha512-wBlsw+8n21e6eTd4yVv8YD/E3xq0O6nNnJIquutAsFGE7EyMKz7W6RNT6BRu1SmdgmlCZ9tb0X+j+D6HGr8pZw== + version "13.1.0" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-13.1.0.tgz#c563aa192f39350a1d18da36c5a8da382bbd8228" + integrity sha512-gCubfBUZ6KxzoibJ+SCUc/57Ms1jz5NjHe4+dI2krNmU5zCPAphyLJYyTOg06ueIyfj+SaCUqmzun7ImlxDcKg== "@types/yargs@^13.0.0": - version "13.0.2" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-13.0.2.tgz#a64674fc0149574ecd90ba746e932b5a5f7b3653" - integrity sha512-lwwgizwk/bIIU+3ELORkyuOgDjCh7zuWDFqRtPPhhVgq9N1F7CvLNKg1TX4f2duwtKQ0p044Au9r1PLIXHrIzQ== + version "13.0.3" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-13.0.3.tgz#76482af3981d4412d65371a318f992d33464a380" + integrity sha512-K8/LfZq2duW33XW/tFwEAfnZlqIfVsoyRB3kfXdPXYhl0nfM8mmh7GS0jg7WrX2Dgq/0Ha/pR1PaR+BvmWwjiQ== dependencies: "@types/yargs-parser" "*" @@ -1502,162 +1490,6 @@ lodash.unescape "4.0.1" semver "5.5.0" -"@webassemblyjs/ast@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.8.5.tgz#51b1c5fe6576a34953bf4b253df9f0d490d9e359" - integrity sha512-aJMfngIZ65+t71C3y2nBBg5FFG0Okt9m0XEgWZ7Ywgn1oMAT8cNwx00Uv1cQyHtidq0Xn94R4TAywO+LCQ+ZAQ== - dependencies: - "@webassemblyjs/helper-module-context" "1.8.5" - "@webassemblyjs/helper-wasm-bytecode" "1.8.5" - "@webassemblyjs/wast-parser" "1.8.5" - -"@webassemblyjs/floating-point-hex-parser@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.8.5.tgz#1ba926a2923613edce496fd5b02e8ce8a5f49721" - integrity sha512-9p+79WHru1oqBh9ewP9zW95E3XAo+90oth7S5Re3eQnECGq59ly1Ri5tsIipKGpiStHsUYmY3zMLqtk3gTcOtQ== - -"@webassemblyjs/helper-api-error@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.8.5.tgz#c49dad22f645227c5edb610bdb9697f1aab721f7" - integrity sha512-Za/tnzsvnqdaSPOUXHyKJ2XI7PDX64kWtURyGiJJZKVEdFOsdKUCPTNEVFZq3zJ2R0G5wc2PZ5gvdTRFgm81zA== - -"@webassemblyjs/helper-buffer@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.8.5.tgz#fea93e429863dd5e4338555f42292385a653f204" - integrity sha512-Ri2R8nOS0U6G49Q86goFIPNgjyl6+oE1abW1pS84BuhP1Qcr5JqMwRFT3Ah3ADDDYGEgGs1iyb1DGX+kAi/c/Q== - -"@webassemblyjs/helper-code-frame@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.8.5.tgz#9a740ff48e3faa3022b1dff54423df9aa293c25e" - integrity sha512-VQAadSubZIhNpH46IR3yWO4kZZjMxN1opDrzePLdVKAZ+DFjkGD/rf4v1jap744uPVU6yjL/smZbRIIJTOUnKQ== - dependencies: - "@webassemblyjs/wast-printer" "1.8.5" - -"@webassemblyjs/helper-fsm@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-fsm/-/helper-fsm-1.8.5.tgz#ba0b7d3b3f7e4733da6059c9332275d860702452" - integrity sha512-kRuX/saORcg8se/ft6Q2UbRpZwP4y7YrWsLXPbbmtepKr22i8Z4O3V5QE9DbZK908dh5Xya4Un57SDIKwB9eow== - -"@webassemblyjs/helper-module-context@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-module-context/-/helper-module-context-1.8.5.tgz#def4b9927b0101dc8cbbd8d1edb5b7b9c82eb245" - integrity sha512-/O1B236mN7UNEU4t9X7Pj38i4VoU8CcMHyy3l2cV/kIF4U5KoHXDVqcDuOs1ltkac90IM4vZdHc52t1x8Yfs3g== - dependencies: - "@webassemblyjs/ast" "1.8.5" - mamacro "^0.0.3" - -"@webassemblyjs/helper-wasm-bytecode@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.8.5.tgz#537a750eddf5c1e932f3744206551c91c1b93e61" - integrity sha512-Cu4YMYG3Ddl72CbmpjU/wbP6SACcOPVbHN1dI4VJNJVgFwaKf1ppeFJrwydOG3NDHxVGuCfPlLZNyEdIYlQ6QQ== - -"@webassemblyjs/helper-wasm-section@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.8.5.tgz#74ca6a6bcbe19e50a3b6b462847e69503e6bfcbf" - integrity sha512-VV083zwR+VTrIWWtgIUpqfvVdK4ff38loRmrdDBgBT8ADXYsEZ5mPQ4Nde90N3UYatHdYoDIFb7oHzMncI02tA== - dependencies: - "@webassemblyjs/ast" "1.8.5" - "@webassemblyjs/helper-buffer" "1.8.5" - "@webassemblyjs/helper-wasm-bytecode" "1.8.5" - "@webassemblyjs/wasm-gen" "1.8.5" - -"@webassemblyjs/ieee754@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.8.5.tgz#712329dbef240f36bf57bd2f7b8fb9bf4154421e" - integrity sha512-aaCvQYrvKbY/n6wKHb/ylAJr27GglahUO89CcGXMItrOBqRarUMxWLJgxm9PJNuKULwN5n1csT9bYoMeZOGF3g== - dependencies: - "@xtuc/ieee754" "^1.2.0" - -"@webassemblyjs/leb128@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.8.5.tgz#044edeb34ea679f3e04cd4fd9824d5e35767ae10" - integrity sha512-plYUuUwleLIziknvlP8VpTgO4kqNaH57Y3JnNa6DLpu/sGcP6hbVdfdX5aHAV716pQBKrfuU26BJK29qY37J7A== - dependencies: - "@xtuc/long" "4.2.2" - -"@webassemblyjs/utf8@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.8.5.tgz#a8bf3b5d8ffe986c7c1e373ccbdc2a0915f0cedc" - integrity sha512-U7zgftmQriw37tfD934UNInokz6yTmn29inT2cAetAsaU9YeVCveWEwhKL1Mg4yS7q//NGdzy79nlXh3bT8Kjw== - -"@webassemblyjs/wasm-edit@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.8.5.tgz#962da12aa5acc1c131c81c4232991c82ce56e01a" - integrity sha512-A41EMy8MWw5yvqj7MQzkDjU29K7UJq1VrX2vWLzfpRHt3ISftOXqrtojn7nlPsZ9Ijhp5NwuODuycSvfAO/26Q== - dependencies: - "@webassemblyjs/ast" "1.8.5" - "@webassemblyjs/helper-buffer" "1.8.5" - "@webassemblyjs/helper-wasm-bytecode" "1.8.5" - "@webassemblyjs/helper-wasm-section" "1.8.5" - "@webassemblyjs/wasm-gen" "1.8.5" - "@webassemblyjs/wasm-opt" "1.8.5" - "@webassemblyjs/wasm-parser" "1.8.5" - "@webassemblyjs/wast-printer" "1.8.5" - -"@webassemblyjs/wasm-gen@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.8.5.tgz#54840766c2c1002eb64ed1abe720aded714f98bc" - integrity sha512-BCZBT0LURC0CXDzj5FXSc2FPTsxwp3nWcqXQdOZE4U7h7i8FqtFK5Egia6f9raQLpEKT1VL7zr4r3+QX6zArWg== - dependencies: - "@webassemblyjs/ast" "1.8.5" - "@webassemblyjs/helper-wasm-bytecode" "1.8.5" - "@webassemblyjs/ieee754" "1.8.5" - "@webassemblyjs/leb128" "1.8.5" - "@webassemblyjs/utf8" "1.8.5" - -"@webassemblyjs/wasm-opt@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.8.5.tgz#b24d9f6ba50394af1349f510afa8ffcb8a63d264" - integrity sha512-HKo2mO/Uh9A6ojzu7cjslGaHaUU14LdLbGEKqTR7PBKwT6LdPtLLh9fPY33rmr5wcOMrsWDbbdCHq4hQUdd37Q== - dependencies: - "@webassemblyjs/ast" "1.8.5" - "@webassemblyjs/helper-buffer" "1.8.5" - "@webassemblyjs/wasm-gen" "1.8.5" - "@webassemblyjs/wasm-parser" "1.8.5" - -"@webassemblyjs/wasm-parser@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.8.5.tgz#21576f0ec88b91427357b8536383668ef7c66b8d" - integrity sha512-pi0SYE9T6tfcMkthwcgCpL0cM9nRYr6/6fjgDtL6q/ZqKHdMWvxitRi5JcZ7RI4SNJJYnYNaWy5UUrHQy998lw== - dependencies: - "@webassemblyjs/ast" "1.8.5" - "@webassemblyjs/helper-api-error" "1.8.5" - "@webassemblyjs/helper-wasm-bytecode" "1.8.5" - "@webassemblyjs/ieee754" "1.8.5" - "@webassemblyjs/leb128" "1.8.5" - "@webassemblyjs/utf8" "1.8.5" - -"@webassemblyjs/wast-parser@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-parser/-/wast-parser-1.8.5.tgz#e10eecd542d0e7bd394f6827c49f3df6d4eefb8c" - integrity sha512-daXC1FyKWHF1i11obK086QRlsMsY4+tIOKgBqI1lxAnkp9xe9YMcgOxm9kLe+ttjs5aWV2KKE1TWJCN57/Btsg== - dependencies: - "@webassemblyjs/ast" "1.8.5" - "@webassemblyjs/floating-point-hex-parser" "1.8.5" - "@webassemblyjs/helper-api-error" "1.8.5" - "@webassemblyjs/helper-code-frame" "1.8.5" - "@webassemblyjs/helper-fsm" "1.8.5" - "@xtuc/long" "4.2.2" - -"@webassemblyjs/wast-printer@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.8.5.tgz#114bbc481fd10ca0e23b3560fa812748b0bae5bc" - integrity sha512-w0U0pD4EhlnvRyeJzBqaVSJAo9w/ce7/WPogeXLzGkO6hzhr4GnQIZ4W4uUt5b9ooAaXPtnXlj0gzsXEOUNYMg== - dependencies: - "@webassemblyjs/ast" "1.8.5" - "@webassemblyjs/wast-parser" "1.8.5" - "@xtuc/long" "4.2.2" - -"@xtuc/ieee754@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" - integrity sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA== - -"@xtuc/long@4.2.2": - version "4.2.2" - resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" - integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== - "@zkochan/cmd-shim@^3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@zkochan/cmd-shim/-/cmd-shim-3.1.0.tgz#2ab8ed81f5bb5452a85f25758eb9b8681982fd2e" @@ -1676,9 +1508,9 @@ JSONStream@^1.0.4, JSONStream@^1.3.4: through ">=2.2.7 <3" abab@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f" - integrity sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w== + version "2.0.2" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.2.tgz#a2fba1b122c69a85caa02d10f9270c7219709a9d" + integrity sha512-2scffjvioEmNz0OyDSLGWDfKCVwaKc6l9Pm9kOIREU13ClXZvHpg/nRL5xyjSSSLhOnXqft2HpsAzNEEA8cFFg== abbrev@1: version "1.1.1" @@ -1686,9 +1518,9 @@ abbrev@1: integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== acorn-globals@^4.1.0: - version "4.3.2" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.2.tgz#4e2c2313a597fd589720395f6354b41cd5ec8006" - integrity sha512-BbzvZhVtZP+Bs1J1HcwrQe8ycfO0wStkSGxuul3He3GkHOIZ6eTqOkPuw9IP1X3+IkOo4wiJmwkobzXYz4wewQ== + version "4.3.4" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.4.tgz#9fa1926addc11c97308c4e66d7add0d40c3272e7" + integrity sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A== dependencies: acorn "^6.0.1" acorn-walk "^6.0.1" @@ -1708,15 +1540,15 @@ acorn@^5.5.3: resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== -acorn@^6.0.1, acorn@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.2.0.tgz#67f0da2fc339d6cfb5d6fb244fd449f33cd8bbe3" - integrity sha512-8oe72N3WPMjA+2zVG71Ia0nXZ8DpQH+QyyHO+p06jT8eg8FGG3FbcUIi8KziHlAfheJQZeoqbvq1mQSQHXKYLw== +acorn@^6.0.1: + version "6.3.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.3.0.tgz#0087509119ffa4fc0a0041d1e93a417e68cb856e" + integrity sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA== acorn@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.0.0.tgz#26b8d1cd9a9b700350b71c0905546f64d1284e7a" - integrity sha512-PaF/MduxijYYt7unVGRuds1vBC9bFxbNf+VWqhOClfdgy7RlVkQqt610ig1/yxTgsDIfW1cWDel5EBbOy3jdtQ== + version "7.1.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.0.tgz#949d36f2c292535da602283586c2477c57eb2d6c" + integrity sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ== agent-base@4, agent-base@^4.3.0: version "4.3.0" @@ -1740,24 +1572,14 @@ agentkeepalive@^3.4.1: humanize-ms "^1.2.1" aggregate-error@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.0.0.tgz#5b5a3c95e9095f311c9ab16c19fb4f3527cd3f79" - integrity sha512-yKD9kEoJIR+2IFqhMwayIBgheLYbB3PS2OBhWae1L/ODTd/JF/30cW0bc9TqzRL3k4U41Dieu3BF4I29p8xesA== + version "3.0.1" + resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.0.1.tgz#db2fe7246e536f40d9b5442a39e117d7dd6a24e0" + integrity sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA== dependencies: clean-stack "^2.0.0" - indent-string "^3.2.0" - -ajv-errors@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" - integrity sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ== + indent-string "^4.0.0" -ajv-keywords@^3.1.0: - version "3.4.1" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.4.1.tgz#ef916e271c64ac12171fd8384eaae6b2345854da" - integrity sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ== - -ajv@^6.1.0, ajv@^6.10.2: +ajv@^6.10.0, ajv@^6.10.2, ajv@^6.5.5: version "6.10.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw== @@ -1767,20 +1589,10 @@ ajv@^6.1.0, ajv@^6.10.2: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^6.10.0, ajv@^6.5.5: - version "6.10.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" - integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg== - dependencies: - fast-deep-equal "^2.0.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - all-contributors-cli@^6.8.1: - version "6.8.1" - resolved "https://registry.yarnpkg.com/all-contributors-cli/-/all-contributors-cli-6.8.1.tgz#70c8c560ad05d054c09798d4a155887c82c5d553" - integrity sha512-06nnLE9Gl0gGqUIzmELNT/k8IWF31Xgq97GkuMJjEOS+3DFXuJ/0U+AJwa9UxP3Ivlqn484xXx4o3XDqPhytjA== + version "6.9.1" + resolved "https://registry.yarnpkg.com/all-contributors-cli/-/all-contributors-cli-6.9.1.tgz#29f0867c6215a1691b25e83c23bc16f30f83f31a" + integrity sha512-z0I/u78s1Robx2p57X28gg+ZHgtRe7iABmEw1O/UFRDpqAHvlF3P7rmug0d99nsNIehrOSayO6XQey4bOHe4Iw== dependencies: "@babel/runtime" "^7.2.0" async "^3.0.1" @@ -1791,7 +1603,7 @@ all-contributors-cli@^6.8.1: lodash "^4.11.2" pify "^4.0.1" request "^2.72.0" - yargs "^13.1.0" + yargs "^14.0.0" ansi-escapes@^3.0.0, ansi-escapes@^3.2.0: version "3.2.0" @@ -1873,14 +1685,6 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" -aria-query@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-3.0.0.tgz#65b3fcc1ca1155a8c9ae64d6eee297f15d5133cc" - integrity sha1-ZbP8wcoRVajJrmTW7uKX8V1RM8w= - dependencies: - ast-types-flow "0.0.7" - commander "^2.11.0" - arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" @@ -1911,11 +1715,6 @@ array-find-index@^1.0.1: resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" integrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E= -array-find@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-find/-/array-find-1.0.0.tgz#6c8e286d11ed768327f8e62ecee87353ca3e78b8" - integrity sha1-bI4obRHtdoMn+OYuzuhzU8o+eLg= - array-ify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" @@ -1961,15 +1760,6 @@ asap@^2.0.0: resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= -asn1.js@^4.0.0: - version "4.10.1" - resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" - integrity sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw== - dependencies: - bn.js "^4.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - asn1@~0.2.3: version "0.2.4" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" @@ -1982,38 +1772,20 @@ assert-plus@1.0.0, assert-plus@^1.0.0: resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= -assert@^1.1.1: - version "1.5.0" - resolved "https://registry.yarnpkg.com/assert/-/assert-1.5.0.tgz#55c109aaf6e0aefdb3dc4b71240c70bf574b18eb" - integrity sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA== - dependencies: - object-assign "^4.1.1" - util "0.10.3" - assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= -ast-types-flow@0.0.7, ast-types-flow@^0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" - integrity sha1-9wtzXGvKGlycItmCw+Oef+ujva0= - astral-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== -async-each@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" - integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== - async-limiter@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" - integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== + version "1.0.1" + resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" + integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== async@^3.0.1: version "3.1.0" @@ -2045,13 +1817,6 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== -axobject-query@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.0.2.tgz#ea187abe5b9002b377f925d8bf7d1c561adf38f9" - integrity sha512-MCeek8ZH7hKyO1rWUbKNQBbl4l2eY0ntk7OGi+q0RlafrCnfPxC06WZA+uebCfmYp4mNU9jRBP1AhGyf8+W3ww== - dependencies: - ast-types-flow "0.0.7" - babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" @@ -2061,18 +1826,6 @@ babel-code-frame@^6.26.0: esutils "^2.0.2" js-tokens "^3.0.2" -babel-eslint@^10.0.1: - version "10.0.2" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.0.2.tgz#182d5ac204579ff0881684b040560fdcc1558456" - integrity sha512-UdsurWPtgiPgpJ06ryUnuaSXC2s0WoSZnQmEpbAH65XZSdwowgN5MvyP7e88nW07FYXv72erVtpBkxyDVKhH1Q== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.0.0" - "@babel/traverse" "^7.0.0" - "@babel/types" "^7.0.0" - eslint-scope "3.7.1" - eslint-visitor-keys "^1.0.0" - babel-jest@^24.9.0: version "24.9.0" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.9.0.tgz#3fc327cb8467b89d14d7bc70e315104a783ccd54" @@ -2087,10 +1840,11 @@ babel-jest@^24.9.0: slash "^2.0.0" babel-plugin-istanbul@^5.1.0: - version "5.1.4" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.4.tgz#841d16b9a58eeb407a0ddce622ba02fe87a752ba" - integrity sha512-dySz4VJMH+dpndj0wjJ8JPs/7i1TdSPb1nRrn56/92pKOF9VKC1FMFJmMXjzlGGusnCAqujP6PBCiKq0sVA+YQ== + version "5.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.2.0.tgz#df4ade83d897a92df069c4d9a25cf2671293c854" + integrity sha512-5LphC0USA8t4i1zCtjbbNb6jJj/9+X6P37Qfirc/70EQ34xKlMW+a1RHGwxGI+SwWpNwZ27HqvzAobeqaXwiZw== dependencies: + "@babel/helper-plugin-utils" "^7.0.0" find-up "^3.0.0" istanbul-lib-instrument "^3.3.0" test-exclude "^5.2.3" @@ -2132,11 +1886,6 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= -base64-js@^1.0.2: - version "1.3.0" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" - integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw== - base@^0.11.1: version "0.11.2" resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" @@ -2162,25 +1911,10 @@ before-after-hook@^2.0.0: resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.1.0.tgz#b6c03487f44e24200dd30ca5e6a1979c5d2fb635" integrity sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A== -big.js@^5.2.2: - version "5.2.2" - resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" - integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== - -binary-extensions@^1.0.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" - integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== - bluebird@^3.5.1, bluebird@^3.5.3, bluebird@^3.5.5: - version "3.5.5" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.5.tgz#a8d0afd73251effbbd5fe384a77d73003c17a71f" - integrity sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w== - -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: - version "4.11.8" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" - integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== + version "3.7.0" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.0.tgz#56a6a886e03f6ae577cffedeb524f8f2450293cf" + integrity sha512-aBQ1FxIa7kSWCcmKHlcHFlT2jt6J/l4FzC7KcPELkOJOsPOb/bccdhmIrKDfXhwFrmc7vDoDrrepFvGqjyXGJg== brace-expansion@^1.1.7: version "1.1.11" @@ -2190,7 +1924,7 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^2.3.1, braces@^2.3.2: +braces@^2.3.1: version "2.3.2" resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== @@ -2213,11 +1947,6 @@ braces@^3.0.1: dependencies: fill-range "^7.0.1" -brorand@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= - browser-process-hrtime@^0.1.2: version "0.1.3" resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz#616f00faef1df7ec1b5bf9cfe2bdc3170f26c7b4" @@ -2230,65 +1959,6 @@ browser-resolve@^1.11.3: dependencies: resolve "1.1.7" -browserify-aes@^1.0.0, browserify-aes@^1.0.4: - version "1.2.0" - resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" - integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== - dependencies: - buffer-xor "^1.0.3" - cipher-base "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.3" - inherits "^2.0.1" - safe-buffer "^5.0.1" - -browserify-cipher@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" - integrity sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w== - dependencies: - browserify-aes "^1.0.4" - browserify-des "^1.0.0" - evp_bytestokey "^1.0.0" - -browserify-des@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" - integrity sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A== - dependencies: - cipher-base "^1.0.1" - des.js "^1.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" - -browserify-rsa@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" - integrity sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ= - dependencies: - bn.js "^4.1.0" - randombytes "^2.0.1" - -browserify-sign@^4.0.0: - version "4.0.4" - resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298" - integrity sha1-qk62jl17ZYuqa/alfmMMvXqT0pg= - dependencies: - bn.js "^4.1.1" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.2" - elliptic "^6.0.0" - inherits "^2.0.1" - parse-asn1 "^5.0.0" - -browserify-zlib@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" - integrity sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA== - dependencies: - pako "~1.0.5" - bs-logger@0.x: version "0.2.6" resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" @@ -2313,30 +1983,11 @@ buffer-from@1.x, buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== -buffer-xor@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" - integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= - -buffer@^4.3.0: - version "4.9.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298" - integrity sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg= - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - isarray "^1.0.0" - builtin-modules@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= -builtin-status-codes@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" - integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug= - builtins@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" @@ -2352,47 +2003,7 @@ byte-size@^5.0.1: resolved "https://registry.yarnpkg.com/byte-size/-/byte-size-5.0.1.tgz#4b651039a5ecd96767e71a3d7ed380e48bed4191" integrity sha512-/XuKeqWocKsYa/cBY1YbSJSWWqTi4cFgr9S6OyM7PBaPbr9zvNGwWP33vt0uqGhwDdN+y3yhbXVILEUpnwEWGw== -cacache@^11.3.2: - version "11.3.3" - resolved "https://registry.yarnpkg.com/cacache/-/cacache-11.3.3.tgz#8bd29df8c6a718a6ebd2d010da4d7972ae3bbadc" - integrity sha512-p8WcneCytvzPxhDvYp31PD039vi77I12W+/KfR9S8AZbaiARFBCpsPJS+9uhWfeBfeAtW7o/4vt3MUqLkbY6nA== - dependencies: - bluebird "^3.5.5" - chownr "^1.1.1" - figgy-pudding "^3.5.1" - glob "^7.1.4" - graceful-fs "^4.1.15" - lru-cache "^5.1.1" - mississippi "^3.0.0" - mkdirp "^0.5.1" - move-concurrently "^1.0.1" - promise-inflight "^1.0.1" - rimraf "^2.6.3" - ssri "^6.0.1" - unique-filename "^1.1.1" - y18n "^4.0.0" - -cacache@^12.0.0: - version "12.0.0" - resolved "https://registry.yarnpkg.com/cacache/-/cacache-12.0.0.tgz#1ed91cc306312a53ad688b1563ce4c416faec564" - integrity sha512-0baf1FhCp16LhN+xDJsOrSiaPDCTD3JegZptVmLDoEbFcT5aT+BeFGt3wcDU3olCP5tpTCXU5sv0+TsKWT9WGQ== - dependencies: - bluebird "^3.5.5" - chownr "^1.1.1" - figgy-pudding "^3.5.1" - glob "^7.1.4" - graceful-fs "^4.1.15" - lru-cache "^5.1.1" - mississippi "^3.0.0" - mkdirp "^0.5.1" - move-concurrently "^1.0.1" - promise-inflight "^1.0.1" - rimraf "^2.6.3" - ssri "^6.0.1" - unique-filename "^1.1.1" - y18n "^4.0.0" - -cacache@^12.0.3: +cacache@^12.0.0, cacache@^12.0.3: version "12.0.3" resolved "https://registry.yarnpkg.com/cacache/-/cacache-12.0.3.tgz#be99abba4e1bf5df461cd5a2c1071fc432573390" integrity sha512-kqdmfXEGFepesTuROHMs3MpFLWrPkSSpRqOw80RCflZXy/khxaArvFrQ7uJxSUduzAufc6G0g1VUCOZXxWavPw== @@ -2506,15 +2117,6 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -chalk@2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.1.tgz#523fe2678aec7b04e8041909292fe8b17059b796" - integrity sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g== - dependencies: - ansi-styles "^3.2.0" - escape-string-regexp "^1.0.5" - supports-color "^5.2.0" - chalk@2.4.2, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.1, chalk@^2.4.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" @@ -2540,50 +2142,16 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -chokidar@^2.0.2: - version "2.1.6" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.6.tgz#b6cad653a929e244ce8a834244164d241fa954c5" - integrity sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g== - dependencies: - anymatch "^2.0.0" - async-each "^1.0.1" - braces "^2.3.2" - glob-parent "^3.1.0" - inherits "^2.0.3" - is-binary-path "^1.0.0" - is-glob "^4.0.0" - normalize-path "^3.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.2.1" - upath "^1.1.1" - optionalDependencies: - fsevents "^1.2.7" - chownr@^1.1.1, chownr@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.2.tgz#a18f1e0b269c8a6a5d3c86eb298beb14c3dd7bf6" - integrity sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A== - -chrome-trace-event@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz#234090ee97c7d4ad1a2c4beae27505deffc608a4" - integrity sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ== - dependencies: - tslib "^1.9.0" + version "1.1.3" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.3.tgz#42d837d5239688d55f303003a508230fa6727142" + integrity sha512-i70fVHhmV3DtTl6nqvZOnIjbY0Pe4kAUjwHj8z0zAdgBtYrJyYwLKCCuRBQ5ppkyL0AkN7HKRnETdmdp1zqNXw== ci-info@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== -cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" - integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - class-utils@^0.3.5: version "0.3.6" resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" @@ -2687,10 +2255,10 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" -commander@^2.11.0, commander@^2.12.1, commander@^2.20.0, commander@~2.20.0: - version "2.20.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" - integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== +commander@^2.12.1, commander@^2.20.0, commander@~2.20.0: + version "2.20.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.1.tgz#3863ce3ca92d0831dcf2a102f5fb4b5926afd0f9" + integrity sha512-cCuLsMhJeWQ/ZpsFTbE765kvVfoeSddc4nU3up4fV+fDBcfUXnbITJ+JzhkdjzOqhURjZgujxaioam4RM9yGUg== commitizen@^4.0.3: version "4.0.3" @@ -2713,11 +2281,6 @@ commitizen@^4.0.3: strip-bom "4.0.0" strip-json-comments "3.0.1" -commondir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" - integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= - compare-func@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/compare-func/-/compare-func-1.3.2.tgz#99dd0ba457e1f9bc722b12c08ec33eeab31fa648" @@ -2764,23 +2327,11 @@ config-chain@^1.1.11: ini "^1.3.4" proto-list "~1.2.1" -console-browserify@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" - integrity sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA= - dependencies: - date-now "^0.1.4" - 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" integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= -constants-browserify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" - integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= - contains-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" @@ -2803,17 +2354,17 @@ conventional-changelog-angular@^5.0.3: q "^1.5.1" conventional-changelog-core@^3.1.6: - version "3.2.2" - resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-3.2.2.tgz#de41e6b4a71011a18bcee58e744f6f8f0e7c29c0" - integrity sha512-cssjAKajxaOX5LNAJLB+UOcoWjAIBvXtDMedv/58G+YEmAXMNfC16mmPl0JDOuVJVfIqM0nqQiZ8UCm8IXbE0g== + version "3.2.3" + resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-3.2.3.tgz#b31410856f431c847086a7dcb4d2ca184a7d88fb" + integrity sha512-LMMX1JlxPIq/Ez5aYAYS5CpuwbOk6QFp8O4HLAcZxe3vxoCtABkhfjetk8IYdRB9CDQGwJFLR3Dr55Za6XKgUQ== dependencies: - conventional-changelog-writer "^4.0.5" - conventional-commits-parser "^3.0.2" + conventional-changelog-writer "^4.0.6" + conventional-commits-parser "^3.0.3" dateformat "^3.0.0" get-pkg-repo "^1.0.0" git-raw-commits "2.0.0" git-remote-origin-url "^2.0.0" - git-semver-tags "^2.0.2" + git-semver-tags "^2.0.3" lodash "^4.2.1" normalize-package-data "^2.3.5" q "^1.5.1" @@ -2822,19 +2373,19 @@ conventional-changelog-core@^3.1.6: through2 "^3.0.0" conventional-changelog-preset-loader@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.1.1.tgz#65bb600547c56d5627d23135154bcd9a907668c4" - integrity sha512-K4avzGMLm5Xw0Ek/6eE3vdOXkqnpf9ydb68XYmCc16cJ99XMMbc2oaNMuPwAsxVK6CC1yA4/I90EhmWNj0Q6HA== + version "2.2.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.2.0.tgz#571e2b3d7b53d65587bea9eedf6e37faa5db4fcc" + integrity sha512-zXB+5vF7D5Y3Cb/rJfSyCCvFphCVmF8mFqOdncX3BmjZwAtGAPfYrBcT225udilCKvBbHgyzgxqz2GWDB5xShQ== -conventional-changelog-writer@^4.0.5: - version "4.0.6" - resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-4.0.6.tgz#24db578ac8e7c89a409ef9bba12cf3c095990148" - integrity sha512-ou/sbrplJMM6KQpR5rKFYNVQYesFjN7WpNGdudQSWNi6X+RgyFUcSv871YBYkrUYV9EX8ijMohYVzn9RUb+4ag== +conventional-changelog-writer@^4.0.6: + version "4.0.7" + resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-4.0.7.tgz#e4b7d9cbea902394ad671f67108a71fa90c7095f" + integrity sha512-p/wzs9eYaxhFbrmX/mCJNwJuvvHR+j4Fd0SQa2xyAhYed6KBiZ780LvoqUUvsayP4R1DtC27czalGUhKV2oabw== dependencies: compare-func "^1.3.1" conventional-commits-filter "^2.0.2" dateformat "^3.0.0" - handlebars "^4.1.0" + handlebars "^4.1.2" json-stringify-safe "^5.0.1" lodash "^4.2.1" meow "^4.0.0" @@ -2868,10 +2419,10 @@ conventional-commits-parser@^2.1.0: through2 "^2.0.0" trim-off-newlines "^1.0.0" -conventional-commits-parser@^3.0.2, conventional-commits-parser@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.0.3.tgz#c3f972fd4e056aa8b9b4f5f3d0e540da18bf396d" - integrity sha512-KaA/2EeUkO4bKjinNfGUyqPTX/6w9JGshuQRik4r/wJz7rUw3+D3fDG6sZSEqJvKILzKXFQuFkpPLclcsAuZcg== +conventional-commits-parser@^3.0.3: + version "3.0.5" + resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.0.5.tgz#df471d6cb3f6fecfd1356ac72e0b577dbdae0a9c" + integrity sha512-qVz9+5JwdJzsbt7JbJ6P7NOXBGt8CyLFJYSjKAuPSgO+5UGfcsbk9EMR+lI8Unlvx6qwIc2YDJlrGIfay2ehNA== dependencies: JSONStream "^1.0.4" is-text-path "^2.0.0" @@ -2939,46 +2490,6 @@ cosmiconfig@^5.1.0, cosmiconfig@^5.2.0, cosmiconfig@^5.2.1: js-yaml "^3.13.1" parse-json "^4.0.0" -create-ecdh@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff" - integrity sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw== - dependencies: - bn.js "^4.1.0" - elliptic "^6.0.0" - -create-hash@^1.1.0, create-hash@^1.1.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" - integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== - dependencies: - cipher-base "^1.0.1" - inherits "^2.0.1" - md5.js "^1.3.4" - ripemd160 "^2.0.1" - sha.js "^2.4.0" - -create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: - version "1.1.7" - resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" - integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== - dependencies: - cipher-base "^1.0.3" - create-hash "^1.1.0" - inherits "^2.0.1" - ripemd160 "^2.0.0" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - -cross-spawn@^5.0.1: - version "5.1.0" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" - integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= - dependencies: - lru-cache "^4.0.1" - shebang-command "^1.2.0" - which "^1.2.9" - cross-spawn@^6.0.0, cross-spawn@^6.0.5: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" @@ -2990,23 +2501,6 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5: shebang-command "^1.2.0" which "^1.2.9" -crypto-browserify@^3.11.0: - version "3.12.0" - resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" - integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== - dependencies: - browserify-cipher "^1.0.0" - browserify-sign "^4.0.0" - create-ecdh "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.0" - diffie-hellman "^5.0.0" - inherits "^2.0.1" - pbkdf2 "^3.0.3" - public-encrypt "^4.0.0" - randombytes "^2.0.0" - randomfill "^1.0.3" - cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": version "0.3.8" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" @@ -3026,10 +2520,10 @@ currently-unhandled@^0.4.1: dependencies: array-find-index "^1.0.1" -cyclist@~0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640" - integrity sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA= +cyclist@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" + integrity sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk= cz-conventional-changelog@3.0.1: version "3.0.1" @@ -3060,11 +2554,6 @@ cz-conventional-changelog@^3.0.2: optionalDependencies: "@commitlint/load" ">6.1.1" -damerau-levenshtein@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.5.tgz#780cf7144eb2e8dbd1c3bb83ae31100ccc31a414" - integrity sha512-CBCRqFnpu715iPmw1KrdOrzRqbdFwQTwAWyyyYS42+iAgHCuXZ+/TdMgQkUENPomxEz9z1BEzuQU2Xw0kUuAgA== - dargs@^4.0.1: version "4.1.0" resolved "https://registry.yarnpkg.com/dargs/-/dargs-4.1.0.tgz#03a9dbb4b5c2f139bf14ae53f0b8a2a6a86f4e17" @@ -3093,11 +2582,6 @@ date-fns@^1.27.2: resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== -date-now@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" - integrity sha1-6vQ5/U1ISK105cx9vvIAZyueNFs= - dateformat@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" @@ -3169,11 +2653,6 @@ deep-is@~0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= -deepmerge@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.0.0.tgz#3e3110ca29205f120d7cb064960a39c3d2087c09" - integrity sha512-YZ1rOP5+kHor4hMAH+HRQnBQHg+wvS1un1hAOuIcxcBy0hzcUf6Jg2a1w65kpoOUnurOfZbERwjI1TfZxNjcww== - defaults@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" @@ -3239,14 +2718,6 @@ deprecation@^2.0.0: resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== -des.js@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" - integrity sha1-wHTS4qpqipoH29YfmhXCzYPsjsw= - dependencies: - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - detect-file@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" @@ -3290,25 +2761,11 @@ diff-sequences@^24.9.0: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.9.0.tgz#5715d6244e2aa65f48bba0bc972db0b0b11e95b5" integrity sha512-Dj6Wk3tWyTE+Fo1rW8v0Xhwk80um6yFYKbuAxc9c3EZxIHFDYwbi34Uk42u1CdnIiVorvt4RmlSDjIPyzGC2ew== -diff@^3.2.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== - diff@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.1.tgz#0c667cb467ebbb5cea7f14f135cc2dba7780a8ff" integrity sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q== -diffie-hellman@^5.0.0: - version "5.0.3" - resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" - integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== - dependencies: - bn.js "^4.1.0" - miller-rabin "^4.0.0" - randombytes "^2.0.0" - dir-glob@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.2.2.tgz#fa09f0694153c8918b18ba0deafae94769fc50c4" @@ -3331,13 +2788,6 @@ doctrine@1.5.0: esutils "^2.0.2" isarray "^1.0.0" -doctrine@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" - integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== - dependencies: - esutils "^2.0.2" - doctrine@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" @@ -3345,11 +2795,6 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -domain-browser@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" - integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== - domexception@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" @@ -3399,29 +2844,11 @@ elegant-spinner@^1.0.1: resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" integrity sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4= -elliptic@^6.0.0: - version "6.5.0" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.0.tgz#2b8ed4c891b7de3200e14412a5b8248c7af505ca" - integrity sha512-eFOJTMyCYb7xtE/caJ6JJu+bhi67WCYNbkGSknu20pmM8Ke/bqOfdnZWxyoGN26JgfxTbXrsCkEw4KheCT/KGg== - dependencies: - bn.js "^4.4.0" - brorand "^1.0.1" - hash.js "^1.0.0" - hmac-drbg "^1.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.0" - -emoji-regex@^7.0.1, emoji-regex@^7.0.2: +emoji-regex@^7.0.1: version "7.0.3" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== -emojis-list@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" - integrity sha1-TapNnbAPmBmIDHn6RXrlsJof04k= - encoding@^0.1.11: version "0.1.12" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" @@ -3430,30 +2857,12 @@ encoding@^0.1.11: iconv-lite "~0.4.13" end-of-stream@^1.0.0, end-of-stream@^1.1.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" - integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== dependencies: once "^1.4.0" -enhanced-resolve@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz#41c7e0bfdfe74ac1ffe1e57ad6a5c6c9f3742a7f" - integrity sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng== - dependencies: - graceful-fs "^4.1.2" - memory-fs "^0.4.0" - tapable "^1.0.0" - -enhanced-resolve@~0.9.0: - version "0.9.1" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-0.9.1.tgz#4d6e689b3725f86090927ccc86cd9f1635b89e2e" - integrity sha1-TW5omzcl+GCQknzMhs2fFjW4ni4= - dependencies: - graceful-fs "^4.1.2" - memory-fs "^0.2.0" - tapable "^0.1.8" - env-paths@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-1.0.0.tgz#4168133b42bb05c38a35b1ae4397c8298ab369e0" @@ -3464,13 +2873,6 @@ err-code@^1.0.0: resolved "https://registry.yarnpkg.com/err-code/-/err-code-1.1.2.tgz#06e0116d3028f6aef4806849eb0ea6a748ae6960" integrity sha1-BuARbTAo9q70gGhJ6w6mp0iuaWA= -errno@^0.1.3, errno@~0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" - integrity sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg== - dependencies: - prr "~1.0.1" - error-ex@^1.2.0, error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -3478,17 +2880,21 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.5.1, es-abstract@^1.7.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" - integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg== +es-abstract@^1.12.0, es-abstract@^1.5.1, es-abstract@^1.7.0: + version "1.15.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.15.0.tgz#8884928ec7e40a79e3c9bc812d37d10c8b24cc57" + integrity sha512-bhkEqWJ2t2lMeaJDuk7okMkJWI/yqgH/EoGwpcvv0XW9RWQsRspI4wt6xuyuvMvvQE3gg/D9HXppgk21w78GyQ== dependencies: es-to-primitive "^1.2.0" function-bind "^1.1.1" has "^1.0.3" + has-symbols "^1.0.0" is-callable "^1.1.4" is-regex "^1.0.4" - object-keys "^1.0.12" + object-inspect "^1.6.0" + object-keys "^1.1.1" + string.prototype.trimleft "^2.1.0" + string.prototype.trimright "^2.1.0" es-to-primitive@^1.2.0: version "1.2.0" @@ -3517,9 +2923,9 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= escodegen@^1.9.1: - version "1.11.1" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.1.tgz#c485ff8d6b4cdb89e27f4a856e91f118401ca510" - integrity sha512-JwiqFD9KdGVVpeuRa68yU3zZnBEOcPs0nKW7wZzXky8Z7tffdYUHbe11bPCV5jYlK6DVdKLWLm0f5I/QlL0Kmw== + version "1.12.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.12.0.tgz#f763daf840af172bb3a2b6dd7219c0e17f7ff541" + integrity sha512-TuA+EhsanGcme5T3R0L80u4t8CpbXQjegRmf7+FPTJrtCTErXFeelblRgHQa1FofEzqYYJmJ/OqjTwREp9qgmg== dependencies: esprima "^3.1.3" estraverse "^4.2.0" @@ -3528,31 +2934,6 @@ escodegen@^1.9.1: optionalDependencies: source-map "~0.6.1" -eslint-config-kentcdodds@^14.3.2: - version "14.3.4" - resolved "https://registry.yarnpkg.com/eslint-config-kentcdodds/-/eslint-config-kentcdodds-14.3.4.tgz#49cde58dba48d76aec486b3eae65f2142bfa4ca2" - integrity sha512-GTqZZg647k3Duiefkwqj7onCTTyTeKiKP5D9/T3SYofd+eeNTKPntDSqDNL3qMHFwINHluMcFkwd+gOd1QCMHA== - dependencies: - babel-eslint "^10.0.1" - eslint-config-prettier "^6.0.0" - eslint-import-resolver-webpack "^0.11.1" - eslint-plugin-babel "^5.3.0" - eslint-plugin-import "^2.17.1" - eslint-plugin-jest "^22.4.1" - eslint-plugin-jsx-a11y "^6.2.1" - eslint-plugin-react "^7.13.0" - eslint-plugin-react-hooks "^1.6.0" - read-pkg-up "^6.0.0" - semver "^6.1.1" - webpack "^4.33.0" - -eslint-config-prettier@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.0.0.tgz#f429a53bde9fc7660e6353910fd996d6284d3c25" - integrity sha512-vDrcCFE3+2ixNT5H83g28bO/uYAwibJxerXPj+E7op4qzBCsAV36QfvdAyVOoNxKAH2Os/e01T/2x++V0LPukA== - dependencies: - get-stdin "^6.0.0" - eslint-import-resolver-node@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" @@ -3561,37 +2942,14 @@ eslint-import-resolver-node@^0.3.2: debug "^2.6.9" resolve "^1.5.0" -eslint-import-resolver-webpack@^0.11.1: - version "0.11.1" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-webpack/-/eslint-import-resolver-webpack-0.11.1.tgz#fcf1fd57a775f51e18f442915f85dd6ba45d2f26" - integrity sha512-eK3zR7xVQR/MaoBWwGuD+CULYVuqe5QFlDukman71aI6IboCGzggDUohHNfu1ZeBnbHcUHJc0ywWoXUBNB6qdg== - dependencies: - array-find "^1.0.0" - debug "^2.6.8" - enhanced-resolve "~0.9.0" - find-root "^1.1.0" - has "^1.0.1" - interpret "^1.0.0" - lodash "^4.17.4" - node-libs-browser "^1.0.0 || ^2.0.0" - resolve "^1.10.0" - semver "^5.3.0" - eslint-module-utils@^2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.4.0.tgz#8b93499e9b00eab80ccb6614e69f03678e84e09a" - integrity sha512-14tltLm38Eu3zS+mt0KvILC3q8jyIAH518MlG+HO0p+yK885Lb1UHTY/UgR91eOyGdmxAPb+OLoW4znqIT6Ndw== + version "2.4.1" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.4.1.tgz#7b4675875bf96b0dbf1b21977456e5bb1f5e018c" + integrity sha512-H6DOj+ejw7Tesdgbfs4jeS4YMFrT8uI8xwd1gtQqXssaR0EQ26L+2O/w6wkYFy2MymON0fTwHmXBvvfLNZVZEw== dependencies: debug "^2.6.8" pkg-dir "^2.0.0" -eslint-plugin-babel@^5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-5.3.0.tgz#2e7f251ccc249326da760c1a4c948a91c32d0023" - integrity sha512-HPuNzSPE75O+SnxHIafbW5QB45r2w78fxqwK3HmjqIUoPfPzVrq6rD+CINU3yzoDSzEhUkX07VUphbF73Lth/w== - dependencies: - eslint-rule-composer "^0.3.0" - eslint-plugin-eslint-comments@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/eslint-plugin-eslint-comments/-/eslint-plugin-eslint-comments-3.1.2.tgz#4ef6c488dbe06aa1627fea107b3e5d059fc8a395" @@ -3605,23 +2963,6 @@ eslint-plugin-eslint-plugin@^2.1.0: resolved "https://registry.yarnpkg.com/eslint-plugin-eslint-plugin/-/eslint-plugin-eslint-plugin-2.1.0.tgz#a7a00f15a886957d855feacaafee264f039e62d5" integrity sha512-kT3A/ZJftt28gbl/Cv04qezb/NQ1dwYIbi8lyf806XMxkus7DvOVCLIfTXMrorp322Pnoez7+zabXH29tADIDg== -eslint-plugin-import@^2.17.1: - version "2.18.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.18.0.tgz#7a5ba8d32622fb35eb9c8db195c2090bd18a3678" - integrity sha512-PZpAEC4gj/6DEMMoU2Df01C5c50r7zdGIN52Yfi7CvvWaYssG7Jt5R9nFG5gmqodxNOz9vQS87xk6Izdtpdrig== - dependencies: - array-includes "^3.0.3" - contains-path "^0.1.0" - debug "^2.6.9" - doctrine "1.5.0" - eslint-import-resolver-node "^0.3.2" - eslint-module-utils "^2.4.0" - has "^1.0.3" - lodash "^4.17.11" - minimatch "^3.0.4" - read-pkg-up "^2.0.0" - resolve "^1.11.0" - eslint-plugin-import@^2.18.2: version "2.18.2" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.18.2.tgz#02f1180b90b077b33d447a17a2326ceb400aceb6" @@ -3640,65 +2981,12 @@ eslint-plugin-import@^2.18.2: resolve "^1.11.0" eslint-plugin-jest@^22.15.2: - version "22.15.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-22.15.2.tgz#e3c10d9391f787744e31566f69ebb70c3a98e398" - integrity sha512-p4NME9TgXIt+KgpxcXyNBvO30ZKxwFAO1dJZBc2OGfDnXVEtPwEyNs95GSr6RIE3xLHdjd8ngDdE2icRRXrbxg== + version "22.17.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-22.17.0.tgz#dc170ec8369cd1bff9c5dd8589344e3f73c88cf6" + integrity sha512-WT4DP4RoGBhIQjv+5D0FM20fAdAUstfYAf/mkufLNTojsfgzc5/IYW22cIg/Q4QBavAZsROQlqppiWDpFZDS8Q== dependencies: "@typescript-eslint/experimental-utils" "^1.13.0" -eslint-plugin-jest@^22.4.1: - version "22.10.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-22.10.0.tgz#a22be77f4dc692808b88ead0059620bda299a97d" - integrity sha512-iBEWJn60Z5bctcjacymUnOQ3xN3gdvGOy3tDHpalAa99r4+jwH0CvICsIIHBNXNlJxuklkbx+wxr49tXk6M0tg== - -eslint-plugin-jsx-a11y@^6.2.1: - version "6.2.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.2.3.tgz#b872a09d5de51af70a97db1eea7dc933043708aa" - integrity sha512-CawzfGt9w83tyuVekn0GDPU9ytYtxyxyFZ3aSWROmnRRFQFT2BiPJd7jvRdzNDi6oLWaS2asMeYSNMjWTV4eNg== - dependencies: - "@babel/runtime" "^7.4.5" - aria-query "^3.0.0" - array-includes "^3.0.3" - ast-types-flow "^0.0.7" - axobject-query "^2.0.2" - damerau-levenshtein "^1.0.4" - emoji-regex "^7.0.2" - has "^1.0.3" - jsx-ast-utils "^2.2.1" - -eslint-plugin-react-hooks@^1.6.0: - version "1.6.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.6.1.tgz#3c66a5515ea3e0a221ffc5d4e75c971c217b1a4c" - integrity sha512-wHhmGJyVuijnYIJXZJHDUF2WM+rJYTjulUTqF9k61d3BTk8etydz+M4dXUVH7M76ZRS85rqBTCx0Es/lLsrjnA== - -eslint-plugin-react@^7.13.0: - version "7.14.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.14.2.tgz#94c193cc77a899ac0ecbb2766fbef88685b7ecc1" - integrity sha512-jZdnKe3ip7FQOdjxks9XPN0pjUKZYq48OggNMd16Sk+8VXx6JOvXmlElxROCgp7tiUsTsze3jd78s/9AFJP2mA== - dependencies: - array-includes "^3.0.3" - doctrine "^2.1.0" - has "^1.0.3" - jsx-ast-utils "^2.1.0" - object.entries "^1.1.0" - object.fromentries "^2.0.0" - object.values "^1.1.0" - prop-types "^15.7.2" - resolve "^1.10.1" - -eslint-rule-composer@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9" - integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg== - -eslint-scope@3.7.1: - version "3.7.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" - integrity sha1-PWPD7f2gLgbgGkUq2IyqzHzctug= - dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" - eslint-scope@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" @@ -3722,20 +3010,15 @@ eslint-utils@^1.4.2: dependencies: eslint-visitor-keys "^1.0.0" -eslint-visitor-keys@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" - integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== - -eslint-visitor-keys@^1.1.0: +eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== eslint@^6.2.2: - version "6.2.2" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.2.2.tgz#03298280e7750d81fcd31431f3d333e43d93f24f" - integrity sha512-mf0elOkxHbdyGX1IJEUsNBzCDdyoUgljF3rRlgfyYh0pwGnreLc0jjD6ZuleOibjmnUWZLY2eXwSooeOgGJ2jw== + version "6.5.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.5.1.tgz#828e4c469697d43bb586144be152198b91e96ed6" + integrity sha512-32h99BoLYStT1iq1v2P9uwpyznQ4M2jRiFB6acitKz52Gqn+vPaMDUTB1bYi1WN4Nquj2w+t+bimYUG83DC55A== dependencies: "@babel/code-frame" "^7.0.0" ajv "^6.10.0" @@ -3809,45 +3092,32 @@ esrecurse@^4.1.0: estraverse "^4.1.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" - integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== eventemitter3@^3.1.0: version "3.1.2" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7" integrity sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q== -events@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/events/-/events-3.0.0.tgz#9a0a0dfaf62893d92b875b8f2698ca4114973e88" - integrity sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA== - -evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" - integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== - dependencies: - md5.js "^1.3.4" - safe-buffer "^5.1.1" - exec-sh@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.2.tgz#6738de2eb7c8e671d0366aea0b0db8c6f7d7391b" integrity sha512-9sLAvzhI5nc8TpuQUh4ahMdCrWT00wPWz7j47/emR5+2qEfoZP5zzUXvx+vdx+H6ohhnsYC31iX04QLYJK8zTg== -execa@0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.9.0.tgz#adb7ce62cf985071f60580deb4a88b9e34712d01" - integrity sha512-BbUMBiX4hqiHZUA5+JujIjNb6TyAlp2D5KLheMjMluwOuzcnylDL4AxZYLLn1n2AGB49eSWwyKvvEQoRpnAtmA== +execa@0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.11.0.tgz#0b3c71daf9b9159c252a863cd981af1b4410d97a" + integrity sha512-k5AR22vCt1DcfeiRixW46U5tMLtBg44ssdJM9PiXw3D8Bn5qyxFCSnKY/eR22y+ctFDGPqafpaXg2G4Emyua4A== dependencies: - cross-spawn "^5.0.1" - get-stream "^3.0.0" + cross-spawn "^6.0.0" + get-stream "^4.0.0" is-stream "^1.1.0" npm-run-path "^2.0.0" p-finally "^1.0.0" @@ -3868,9 +3138,9 @@ execa@^1.0.0: strip-eof "^1.0.0" execa@^2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/execa/-/execa-2.0.4.tgz#2f5cc589c81db316628627004ea4e37b93391d8e" - integrity sha512-VcQfhuGD51vQUQtKIq2fjGDLDbL6N1DTQVpYzxZ7LPIXw3HqTuIz6uxRmpV1qf8i31LHf2kjiaGI+GdHwRgbnQ== + version "2.0.5" + resolved "https://registry.yarnpkg.com/execa/-/execa-2.0.5.tgz#5be3e2ea7e61bd038da5a0e11dc6ab2097357f2f" + integrity sha512-SwmwZZyJjflcqLSgllk4EQlMLst2p9muyzwNugKGFlpAz6rZ7M+s2nBR97GAq4Vzjwx2y9rcMcmqzojwN+xwNA== dependencies: cross-spawn "^6.0.5" get-stream "^5.0.0" @@ -4069,15 +3339,6 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" -find-cache-dir@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7" - integrity sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ== - dependencies: - commondir "^1.0.1" - make-dir "^2.0.0" - pkg-dir "^3.0.0" - find-node-modules@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/find-node-modules/-/find-node-modules-2.0.0.tgz#5db1fb9e668a3d451db3d618cd167cdd59e41b69" @@ -4086,7 +3347,7 @@ find-node-modules@2.0.0: findup-sync "^3.0.0" merge "^1.2.1" -find-root@1.1.0, find-root@^1.1.0: +find-root@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4" integrity sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng== @@ -4197,11 +3458,11 @@ fs-extra@8.1.0, fs-extra@^8.1.0: universalify "^0.1.0" fs-minipass@^1.2.5: - version "1.2.6" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.6.tgz#2c5cc30ded81282bfe8a0d7c7c1853ddeb102c07" - integrity sha512-crhvyXcMejjv3Z5d2Fa9sf5xLYVCF5O1c71QxbVnbLsmYMBEvDAftewesN/HhY03YRoA7zOMxjNGrF5svGaaeQ== + version "1.2.7" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" + integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== dependencies: - minipass "^2.2.1" + minipass "^2.6.0" fs-write-stream-atomic@^1.0.8: version "1.0.10" @@ -4266,9 +3527,9 @@ get-caller-file@^2.0.1: integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== get-own-enumerable-property-symbols@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.0.tgz#b877b49a5c16aefac3655f2ed2ea5b684df8d203" - integrity sha512-CIJYJC4GGF06TakLg8z4GQKvDsx9EMspVxOYih7LerEL/WosUnFIww45CGfxfeKHqlg3twgUrYRT1O3WQqjGCg== + version "3.0.1" + resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.1.tgz#6f7764f88ea11e0b514bd9bd860a132259992ca4" + integrity sha512-09/VS4iek66Dh2bctjRkowueRJbY1JDGR1L/zRxO1Qk8Uxs6PnqaNSqalpizPT+CDjre3hnEsuzvhgomz9qYrA== get-pkg-repo@^1.0.0: version "1.4.0" @@ -4296,16 +3557,6 @@ get-stdin@^4.0.1: resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" integrity sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4= -get-stdin@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" - integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== - -get-stream@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" - integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= - get-stream@^4.0.0, get-stream@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" @@ -4362,14 +3613,6 @@ git-remote-origin-url@^2.0.0: gitconfiglocal "^1.0.0" pify "^2.3.0" -git-semver-tags@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-2.0.2.tgz#f506ec07caade191ac0c8d5a21bdb8131b4934e3" - integrity sha512-34lMF7Yo1xEmsK2EkbArdoU79umpvm0MfzaDkSNYSJqtM5QLAVTPWgpiXSVI5o/O9EvZPSrP4Zvnec/CqhSd5w== - dependencies: - meow "^4.0.0" - semver "^5.5.0" - git-semver-tags@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-2.0.3.tgz#48988a718acf593800f99622a952a77c405bfa34" @@ -4409,9 +3652,9 @@ glob-parent@^3.1.0: path-dirname "^1.0.0" glob-parent@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.0.0.tgz#1dc99f0f39b006d3e92c2c284068382f0c20e954" - integrity sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg== + version "5.1.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.0.tgz#5f4c1d1e748d30cd73ad2944b3577a81b081e8c2" + integrity sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw== dependencies: is-glob "^4.0.1" @@ -4492,12 +3735,7 @@ globby@^9.2.0: pify "^4.0.1" slash "^2.0.0" -graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6: - version "4.2.0" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.0.tgz#8d8fdc73977cb04104721cb53666c1ca64cd328b" - integrity sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg== - -graceful-fs@^4.2.0, graceful-fs@^4.2.2: +graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.2.tgz#6f0952605d0140c1cfdb138ed005775b92d67b02" integrity sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q== @@ -4507,10 +3745,10 @@ growly@^1.3.0: resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= -handlebars@^4.1.0, handlebars@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67" - integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw== +handlebars@^4.1.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.4.2.tgz#8810a9821a9d6d52cb2f57d326d6ce7c3dfe741d" + integrity sha512-cIv17+GhL8pHHnRJzGu2wwcthL5sb8uDKBHvZ2Dtu5s1YNt0ljbzKbamnc+gr69y7bzwQiBdr5+hOpRd5pnOdg== dependencies: neo-async "^2.6.0" optimist "^0.6.1" @@ -4591,31 +3829,6 @@ has@^1.0.1, has@^1.0.3: dependencies: function-bind "^1.1.1" -hash-base@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" - integrity sha1-X8hoaEfs1zSZQDMZprCj8/auSRg= - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -hash.js@^1.0.0, hash.js@^1.0.3: - version "1.1.7" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" - integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.1" - -hmac-drbg@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" - integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= - dependencies: - hash.js "^1.0.3" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.1" - homedir-polyfill@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8" @@ -4623,10 +3836,10 @@ homedir-polyfill@^1.0.1: dependencies: parse-passwd "^1.0.0" -hosted-git-info@^2.1.4, hosted-git-info@^2.6.0: - version "2.7.1" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" - integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== +hosted-git-info@^2.1.4, hosted-git-info@^2.7.1: + version "2.8.4" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.4.tgz#44119abaf4bc64692a16ace34700fed9c03e2546" + integrity sha512-pzXIvANXEFrc5oFFXRMkbLPQ2rXRoDERwDLyrcUxGhaZhgP54BBSl9Oheh7Vv0T090cszWBxPjkQQ5Sq1PbBRQ== html-encoding-sniffer@^1.0.2: version "1.0.2" @@ -4657,11 +3870,6 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" -https-browserify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" - integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= - https-proxy-agent@^2.2.1: version "2.2.2" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz#271ea8e90f836ac9f119daccd39c19ff7dfb0793" @@ -4678,9 +3886,9 @@ humanize-ms@^1.2.1: ms "^2.0.0" husky@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/husky/-/husky-3.0.4.tgz#10a48ac11ab50859b0939750fa0b4e07ad0bf669" - integrity sha512-7Rnt8aJfy+MlV28snmYK7O7vWwtOfeVxV6KhLpUFXlmx5ukQ1nQmNUB7QsAwSgdySB5X+bm7q7JIRgazqBUzKA== + version "3.0.8" + resolved "https://registry.yarnpkg.com/husky/-/husky-3.0.8.tgz#8de3fed26ce9b43034ef51013c4ad368b6b74ea8" + integrity sha512-HFOsgcyrX3qe/rBuqyTt+P4Gxn5P0seJmr215LAZ/vnwK3jWB3r0ck7swbzGRUbufCf9w/lgHPVbF/YXQALgfQ== dependencies: chalk "^2.4.2" cosmiconfig "^5.2.1" @@ -4701,20 +3909,15 @@ iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: dependencies: safer-buffer ">= 2.1.2 < 3" -ieee754@^1.1.4: - version "1.1.13" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" - integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== - iferr@^0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" integrity sha1-xg7taebY/bazEEofy8ocGS3FtQE= ignore-walk@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" - integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== + version "3.0.2" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.2.tgz#99d83a246c196ea5c93ef9315ad7b0819c35069b" + integrity sha512-EXyErtpHbn75ZTsOADsfx6J/FPo6/5cjev46PXrcTpd8z3BoRkXgYu9/JVqrI7tusjmwCZutGeRJeU0Wo1e4Cw== dependencies: minimatch "^3.0.4" @@ -4723,12 +3926,7 @@ ignore@^4.0.3, ignore@^4.0.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== -ignore@^5.0.5: - version "5.1.2" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.2.tgz#e28e584d43ad7e92f96995019cc43b9e1ac49558" - integrity sha512-vdqWBp7MyzdmHkkRWV5nY+PfGRbYbahfuvsBCh277tq+w9zyNi7h5CYJCK0kmzti9kU+O/cB7sE8HvKv6aXAKQ== - -ignore@^5.1.1: +ignore@^5.0.5, ignore@^5.1.1: version "5.1.4" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.4.tgz#84b7b3dbe64552b6ef0eca99f6743dbec6d97adf" integrity sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A== @@ -4769,11 +3967,16 @@ indent-string@^2.1.0: dependencies: repeating "^2.0.0" -indent-string@^3.0.0, indent-string@^3.2.0: +indent-string@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" integrity sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= +indent-string@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" + integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== + infer-owner@^1.0.3, infer-owner@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467" @@ -4787,21 +3990,11 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -inherits@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" - integrity sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE= - -inherits@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - ini@^1.3.2, ini@^1.3.4, ini@~1.3.0: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" @@ -4821,7 +4014,7 @@ init-package-json@^1.10.3: validate-npm-package-license "^3.0.1" validate-npm-package-name "^3.0.0" -inquirer@6.5.0, inquirer@^6.2.0, inquirer@^6.2.1: +inquirer@6.5.0: version "6.5.0" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.0.tgz#2303317efc9a4ea7ec2e2df6f86569b734accf42" integrity sha512-scfHejeG/lVZSpvCXpsB4j/wQNPM5JC8kiElOI0OUTwmc1RTpXr4H32/HOlQHcZiYl2z2VElwuCVDRG8vFmbnA== @@ -4840,7 +4033,7 @@ inquirer@6.5.0, inquirer@^6.2.0, inquirer@^6.2.1: strip-ansi "^5.1.0" through "^2.3.6" -inquirer@^6.4.1: +inquirer@^6.2.0, inquirer@^6.2.1, inquirer@^6.4.1: version "6.5.2" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" integrity sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ== @@ -4900,13 +4093,6 @@ is-arrayish@^0.2.1: resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= - dependencies: - binary-extensions "^1.0.0" - is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" @@ -5051,9 +4237,9 @@ is-path-cwd@^2.2.0: integrity sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ== is-path-inside@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.1.tgz#7417049ed551d053ab82bba3fdd6baa6b3a81e89" - integrity sha512-CKstxrctq1kUesU6WhtZDbYKzzYBuRH0UYInAVrkc/EYdB9ltbfE0gOoayG9nhohG6447sOOVGhHqsdmBvkbNg== + version "3.0.2" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.2.tgz#f5220fc82a3e233757291dddc9c5877f2a1f3017" + integrity sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg== is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: version "1.1.0" @@ -5296,9 +4482,9 @@ jest-diff@^24.9.0: pretty-format "^24.9.0" jest-docblock@^24.3.0: - version "24.3.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.3.0.tgz#b9c32dac70f72e4464520d2ba4aec02ab14db5dd" - integrity sha512-nlANmF9Yq1dufhFlKG9rasfQlrY7wINJbo3q01tu56Jv5eBU5jirylhF2O5ZBnLxzOVBGRDz/9NAwNyBtG4Nyg== + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.9.0.tgz#7970201802ba560e1c4092cc25cbedf5af5a8ce2" + integrity sha512-F1DjdpDMJMA1cN6He0FNYNZlo3yYmOtRUnktrT9Q37njYzC5WEaDdmbynIgy0L/IvXvvgsG8OsqhLPXTpfmZAA== dependencies: detect-newline "^2.1.0" @@ -5426,12 +4612,7 @@ jest-pnp-resolver@^1.2.1: resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz#ecdae604c077a7fbc70defb6d517c3c1c898923a" integrity sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ== -jest-regex-util@^24.3.0: - version "24.3.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.3.0.tgz#d5a65f60be1ae3e310d5214a0307581995227b36" - integrity sha512-tXQR1NEOyGlfylyEjg1ImtScwMq8Oh3iJbGTjN7p0J23EuVX1MA8rwU69K4sLbCmwzgCUbVkm0FkSF9TdzOhtg== - -jest-regex-util@^24.9.0: +jest-regex-util@^24.3.0, jest-regex-util@^24.9.0: version "24.9.0" resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.9.0.tgz#c13fb3380bde22bf6575432c493ea8fe37965636" integrity sha512-05Cmb6CuxaA+Ys6fjr3PhvV3bGQmO+2p2La4hFbU+W5uOc479f7FdLXUWXw4pYMAhhSZIuKHwSXSu6CsSBAXQA== @@ -5577,15 +4758,7 @@ jest-watcher@^24.9.0: jest-util "^24.9.0" string-length "^2.0.0" -jest-worker@^24.6.0: - version "24.6.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.6.0.tgz#7f81ceae34b7cde0c9827a6980c35b7cdc0161b3" - integrity sha512-jDwgW5W9qGNvpI1tNnvajh0a5IE/PuGLFmHk6aR/BZFz8tSgGw17GsDPXAJ6p91IvYDjOw8GpFbvvZGAK+DPQQ== - dependencies: - merge-stream "^1.0.1" - supports-color "^6.1.0" - -jest-worker@^24.9.0: +jest-worker@^24.6.0, jest-worker@^24.9.0: version "24.9.0" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.9.0.tgz#5dbfdb5b2d322e98567898238a9697bcce67b3e5" integrity sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw== @@ -5662,16 +4835,15 @@ jsesc@^2.5.1: integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== json-fixer@^1.3.1-0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/json-fixer/-/json-fixer-1.3.1.tgz#22189c66699801475114aacf54de0ec61e53e95b" - integrity sha512-cXDbm60QRRn/3h+uPmVdgt2rBP4VPTQo4OZO+ptw4iZIpT9REfgj/I7/0YVplpEFWph/WGNjto7TPgou2uyfOw== + version "1.3.3" + resolved "https://registry.yarnpkg.com/json-fixer/-/json-fixer-1.3.3.tgz#8a11c0536330e44f2aaba8b836d16657ad590dba" + integrity sha512-+UpmAba1KuudCrsbw/oZyibEyAbhFkaDoG9RJcSQVMLdSd6LI1dlaKbYbFzx4O6u4WA7TiBYAXHdQs2bMFCbEw== dependencies: - "@babel/runtime" "^7.4.5" + "@babel/runtime" "^7.5.5" chalk "^2.4.2" - eslint-config-kentcdodds "^14.3.2" pegjs "^0.10.0" -json-parse-better-errors@^1.0.0, json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: +json-parse-better-errors@^1.0.0, json-parse-better-errors@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== @@ -5697,16 +4869,9 @@ json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= json5@2.x, json5@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850" - integrity sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ== - dependencies: - minimist "^1.2.0" - -json5@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" - integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + version "2.1.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.1.tgz#81b6cb04e9ba496f1c7005d07b4368a2638f90b6" + integrity sha512-l+3HXD0GEI3huGq1njuqtzYK8OYJyXMkOLtQ53pjWh89tvWS2h6l+1zMkYWqlb57+SiQodKZyvMEFb2X+KrFhQ== dependencies: minimist "^1.2.0" @@ -5732,14 +4897,6 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" -jsx-ast-utils@^2.1.0, jsx-ast-utils@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.2.1.tgz#4d4973ebf8b9d2837ee91a8208cc66f3a2776cfb" - integrity sha512-v3FxCcAf20DayI+uxnCuw795+oOIkVu6EnJ1+kSzhqqTZHNkTZ7B66ZgLp4oLJ/gbA64cI0B7WRoHZMSRdyVRQ== - dependencies: - array-includes "^3.0.3" - object.assign "^4.1.0" - kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" @@ -5764,7 +4921,7 @@ kind-of@^6.0.0, kind-of@^6.0.2: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== -kleur@^3.0.2: +kleur@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== @@ -5823,9 +4980,9 @@ lines-and-columns@^1.1.6: integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= lint-staged@^9.2.5: - version "9.2.5" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-9.2.5.tgz#5a3e1e0a539a403bd7f88542bc3d34ce52efdbb3" - integrity sha512-d99gTBFMJ29159+9iRvaMEQstmNcPAbQbhHSYw6D/1FncvFdIj8lWHztaq3Uq+tbZPABHXQ/fyN7Rp1QwF8HIw== + version "9.4.1" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-9.4.1.tgz#60c0f85745bd398e6460aa7f5adb3cad3a2b862c" + integrity sha512-zFRbo1bAJEVf1m33paTTjDVfy2v3lICCqHfmQSgNoI+lWpi7HPG5y/R2Y7Whdce+FKxlZYs/U1sDSx8+nmQdDA== dependencies: chalk "^2.4.2" commander "^2.20.0" @@ -5928,20 +5085,6 @@ load-json-file@^5.3.0: strip-bom "^3.0.0" type-fest "^0.3.0" -loader-runner@^2.3.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" - integrity sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw== - -loader-utils@^1.1.0, loader-utils@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" - integrity sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA== - dependencies: - big.js "^5.2.2" - emojis-list "^2.0.0" - json5 "^1.0.1" - locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -5995,7 +5138,7 @@ lodash.map@^4.5.1: resolved "https://registry.yarnpkg.com/lodash.map/-/lodash.map-4.6.0.tgz#771ec7839e3473d9c4cde28b19394c3562f4f6d3" integrity sha1-dx7Hg540c9nEzeKLGTlMNWL09tM= -lodash.memoize@^4.1.2: +lodash.memoize@4.x, lodash.memoize@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= @@ -6035,12 +5178,12 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@4.17.14, lodash@^4.11.2, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.4, lodash@^4.2.1: +lodash@4.17.14: version "4.17.14" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba" integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw== -lodash@4.17.15: +lodash@4.17.15, lodash@^4.11.2, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.2.1: version "4.17.15" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== @@ -6073,7 +5216,7 @@ longest@^2.0.1: resolved "https://registry.yarnpkg.com/longest/-/longest-2.0.1.tgz#781e183296aa94f6d4d916dc335d0d17aefa23f8" integrity sha1-eB4YMpaqlPbU2RbcM10NF676I/g= -loose-envify@^1.0.0, loose-envify@^1.4.0: +loose-envify@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== @@ -6088,14 +5231,6 @@ loud-rejection@^1.0.0: currently-unhandled "^0.4.1" signal-exit "^3.0.0" -lru-cache@^4.0.1: - version "4.1.5" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" - integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" - lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -6115,7 +5250,7 @@ make-dir@^1.0.0: dependencies: pify "^3.0.0" -make-dir@^2.0.0, make-dir@^2.1.0: +make-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== @@ -6152,11 +5287,6 @@ makeerror@1.0.x: dependencies: tmpl "1.0.x" -mamacro@^0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/mamacro/-/mamacro-0.0.3.tgz#ad2c9576197c9f1abf308d0787865bd975a3f3e4" - integrity sha512-qMEwh+UujcQ+kbz3T6V+wAmO2U8veoq2w+3wY8MquqwVA3jChfwY+Tk52GZKDfACEPjuZ7r2oJLejwpt8jtwTA== - map-age-cleaner@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" @@ -6191,15 +5321,6 @@ marked@^0.7.0: resolved "https://registry.yarnpkg.com/marked/-/marked-0.7.0.tgz#b64201f051d271b1edc10a04d1ae9b74bb8e5c0e" integrity sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg== -md5.js@^1.3.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" - integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" - mem@^4.0.0: version "4.3.0" resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" @@ -6209,19 +5330,6 @@ mem@^4.0.0: mimic-fn "^2.0.0" p-is-promise "^2.0.0" -memory-fs@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.2.0.tgz#f2bb25368bc121e391c2520de92969caee0a0290" - integrity sha1-8rslNovBIeORwlIN6Slpyu4KApA= - -memory-fs@^0.4.0, memory-fs@~0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" - integrity sha1-OpoguEYlI+RHz7x+i7gO1me/xVI= - dependencies: - errno "^0.1.3" - readable-stream "^2.0.1" - meow@5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/meow/-/meow-5.0.0.tgz#dfc73d63a9afc714a5e371760eb5c88b91078aa4" @@ -6268,29 +5376,22 @@ meow@^4.0.0: redent "^2.0.0" trim-newlines "^2.0.0" -merge-stream@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" - integrity sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE= - dependencies: - readable-stream "^2.0.1" - merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== merge2@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.3.tgz#7ee99dbd69bb6481689253f018488a1b902b0ed5" - integrity sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA== + version "1.3.0" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.3.0.tgz#5b366ee83b2f1582c48f87e47cf1a9352103ca81" + integrity sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw== merge@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.1.tgz#38bebf80c3220a8a487b6fcfb3941bb11720c145" integrity sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ== -micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: +micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== @@ -6317,14 +5418,6 @@ micromatch@^4.0.2: braces "^3.0.1" picomatch "^2.0.5" -miller-rabin@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" - integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== - dependencies: - bn.js "^4.0.0" - brorand "^1.0.1" - mime-db@1.40.0: version "1.40.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32" @@ -6347,16 +5440,6 @@ mimic-fn@^2.0.0, mimic-fn@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== -minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" - integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== - -minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" - integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= - minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" @@ -6387,20 +5470,20 @@ minimist@~0.0.1: resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= -minipass@^2.2.1, minipass@^2.3.5: - version "2.3.5" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" - integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA== +minipass@^2.3.5, minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" + integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== dependencies: safe-buffer "^5.1.2" yallist "^3.0.0" minizlib@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" - integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA== + version "1.3.3" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" + integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== dependencies: - minipass "^2.2.1" + minipass "^2.9.0" mississippi@^3.0.0: version "3.0.0" @@ -6433,7 +5516,7 @@ mkdirp-promise@^5.0.1: dependencies: mkdirp "*" -mkdirp@*, mkdirp@0.x, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: +mkdirp@*, mkdirp@0.x, mkdirp@^0.5.0, mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= @@ -6532,7 +5615,7 @@ needle@^2.2.1: iconv-lite "^0.4.4" sax "^1.2.4" -neo-async@^2.5.0, neo-async@^2.6.0: +neo-async@^2.6.0: version "2.6.1" resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw== @@ -6565,9 +5648,9 @@ node-fetch@^2.3.0, node-fetch@^2.5.0: integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== node-gyp@^5.0.2: - version "5.0.3" - resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-5.0.3.tgz#80d64c23790244991b6d44532f0a351bedd3dd45" - integrity sha512-z/JdtkFGUm0QaQUusvloyYuGDub3nUbOo5de1Fz57cM++osBTvQatBUSTlF1k/w8vFHPxxXW6zxGvkxXSpaBkQ== + version "5.0.5" + resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-5.0.5.tgz#f6cf1da246eb8c42b097d7cd4d6c3ce23a4163af" + integrity sha512-WABl9s4/mqQdZneZHVWVG4TVr6QQJZUC6PAx47ITSk9lreZ1n+7Z9mMAIbA3vnO4J9W20P7LhCxtzfWsAD/KDw== dependencies: env-paths "^1.0.0" glob "^7.0.3" @@ -6578,7 +5661,7 @@ node-gyp@^5.0.2: request "^2.87.0" rimraf "2" semver "~5.3.0" - tar "^4.4.8" + tar "^4.4.12" which "1" node-int64@^0.4.0: @@ -6586,35 +5669,6 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= -"node-libs-browser@^1.0.0 || ^2.0.0", node-libs-browser@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.2.1.tgz#b64f513d18338625f90346d27b0d235e631f6425" - integrity sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q== - dependencies: - assert "^1.1.1" - browserify-zlib "^0.2.0" - buffer "^4.3.0" - console-browserify "^1.1.0" - constants-browserify "^1.0.0" - crypto-browserify "^3.11.0" - domain-browser "^1.1.1" - events "^3.0.0" - https-browserify "^1.0.0" - os-browserify "^0.3.0" - path-browserify "0.0.1" - process "^0.11.10" - punycode "^1.2.4" - querystring-es3 "^0.2.0" - readable-stream "^2.3.3" - stream-browserify "^2.0.1" - stream-http "^2.7.2" - string_decoder "^1.0.0" - timers-browserify "^2.0.4" - tty-browserify "0.0.0" - url "^0.11.0" - util "^0.11.0" - vm-browserify "^1.0.1" - node-modules-regexp@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" @@ -6695,9 +5749,9 @@ npm-bundled@^1.0.1: integrity sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g== npm-lifecycle@^3.1.2: - version "3.1.3" - resolved "https://registry.yarnpkg.com/npm-lifecycle/-/npm-lifecycle-3.1.3.tgz#09e9b0b6686e85fd53bab82364386222d97a3730" - integrity sha512-M0QmmqbEHBXxDrmc6X3+eKjW9+F7Edg1ENau92WkYw1sox6wojHzEZJIRm1ItljEiaigZlKL8mXni/4ylAy1Dg== + version "3.1.4" + resolved "https://registry.yarnpkg.com/npm-lifecycle/-/npm-lifecycle-3.1.4.tgz#de6975c7d8df65f5150db110b57cce498b0b604c" + integrity sha512-tgs1PaucZwkxECGKhC/stbEgFyc3TGh2TJcg2CDr6jbvQRdteHNhmMeljRzpe4wgFAXQADoy1cSqqi7mtiAa5A== dependencies: byline "^5.0.0" graceful-fs "^4.1.15" @@ -6709,13 +5763,13 @@ npm-lifecycle@^3.1.2: which "^1.3.1" "npm-package-arg@^4.0.0 || ^5.0.0 || ^6.0.0", npm-package-arg@^6.0.0, npm-package-arg@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-6.1.0.tgz#15ae1e2758a5027efb4c250554b85a737db7fcc1" - integrity sha512-zYbhP2k9DbJhA0Z3HKUePUgdB1x7MfIfKssC+WLPFMKTBZKpZh5m13PgexJjCq6KW7j17r0jHWcCpxEqnnncSA== + version "6.1.1" + resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-6.1.1.tgz#02168cb0a49a2b75bf988a28698de7b529df5cb7" + integrity sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg== dependencies: - hosted-git-info "^2.6.0" + hosted-git-info "^2.7.1" osenv "^0.1.5" - semver "^5.5.0" + semver "^5.6.0" validate-npm-package-name "^3.0.0" npm-packlist@^1.1.6, npm-packlist@^1.4.4: @@ -6727,9 +5781,9 @@ npm-packlist@^1.1.6, npm-packlist@^1.4.4: npm-bundled "^1.0.1" npm-pick-manifest@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/npm-pick-manifest/-/npm-pick-manifest-3.0.1.tgz#19c350ffbe42e0c3c054dcd50dd5760556a98bd8" - integrity sha512-QsJY1LuN6vuGg2BDnteeWGYODOYWZZwbW/YyCKHK4tt9uE+k2d70eg+Kr1CSLbX157Nu8UtY/Afdv884RnJSrQ== + version "3.0.2" + resolved "https://registry.yarnpkg.com/npm-pick-manifest/-/npm-pick-manifest-3.0.2.tgz#f4d9e5fd4be2153e5f4e5f9b7be8dc419a99abb7" + integrity sha512-wNprTNg+X5nf+tDi+hbjdHhM4bX+mKqv6XmPh7B5eG+QY9VARfQPfCEH013H5GqfNj6ee8Ij2fg8yk0mzps1Vw== dependencies: figgy-pudding "^3.5.1" npm-package-arg "^6.0.0" @@ -6774,7 +5828,7 @@ oauth-sign@~0.9.0: resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== -object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: +object-assign@^4.0.1, object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= @@ -6788,7 +5842,12 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-keys@^1.0.11, object-keys@^1.0.12: +object-inspect@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b" + integrity sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ== + +object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== @@ -6800,36 +5859,6 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" -object.assign@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" - integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== - dependencies: - define-properties "^1.1.2" - function-bind "^1.1.1" - has-symbols "^1.0.0" - object-keys "^1.0.11" - -object.entries@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.0.tgz#2024fc6d6ba246aee38bdb0ffd5cfbcf371b7519" - integrity sha512-l+H6EQ8qzGRxbkHOd5I/aHRhHDKoQXQ8g0BYt4uSweQU1/J6dZUOyWh9a2Vky35YCKjzmgxOzta2hH6kf9HuXA== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.12.0" - function-bind "^1.1.1" - has "^1.0.3" - -object.fromentries@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.0.tgz#49a543d92151f8277b3ac9600f1e930b189d30ab" - integrity sha512-9iLiI6H083uiqUuvzyY6qrlmc/Gz8hLQFOcb/Ri/0xXFkSNS3ctV+CbE6yM2+AnkYfOB3dGjdzC0wrMLIhQICA== - dependencies: - define-properties "^1.1.2" - es-abstract "^1.11.0" - function-bind "^1.1.1" - has "^1.0.1" - object.getownpropertydescriptors@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" @@ -6906,11 +5935,6 @@ optionator@^0.8.1, optionator@^0.8.2: type-check "~0.3.2" wordwrap "~1.0.0" -os-browserify@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" - integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= - os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" @@ -6925,7 +5949,7 @@ os-locale@^3.0.0: lcid "^2.0.0" mem "^4.0.0" -os-name@^3.0.0: +os-name@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/os-name/-/os-name-3.1.0.tgz#dec19d966296e1cd62d701a5a66ee1ddeae70801" integrity sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg== @@ -6981,9 +6005,9 @@ p-limit@^1.1.0: p-try "^1.0.0" p-limit@^2.0.0, p-limit@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2" - integrity sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ== + version "2.2.1" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.1.tgz#aa07a788cc3151c939b5131f63570f0dd2009537" + integrity sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg== dependencies: p-try "^2.0.0" @@ -7061,17 +6085,12 @@ p-waterfall@^1.0.0: dependencies: p-reduce "^1.0.0" -pako@~1.0.5: - version "1.0.10" - resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.10.tgz#4328badb5086a426aa90f541977d4955da5c9732" - integrity sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw== - parallel-transform@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/parallel-transform/-/parallel-transform-1.1.0.tgz#d410f065b05da23081fcd10f28854c29bda33b06" - integrity sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY= + version "1.2.0" + resolved "https://registry.yarnpkg.com/parallel-transform/-/parallel-transform-1.2.0.tgz#9049ca37d6cb2182c3b1d2c720be94d14a5814fc" + integrity sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg== dependencies: - cyclist "~0.2.2" + cyclist "^1.0.1" inherits "^2.0.3" readable-stream "^2.1.5" @@ -7082,18 +6101,6 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" -parse-asn1@^5.0.0: - version "5.1.4" - resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.4.tgz#37f6628f823fbdeb2273b4d540434a22f3ef1fcc" - integrity sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw== - dependencies: - asn1.js "^4.0.0" - browserify-aes "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.0" - pbkdf2 "^3.0.3" - safe-buffer "^5.1.1" - parse-github-repo-url@^1.3.0: version "1.4.1" resolved "https://registry.yarnpkg.com/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz#9e7d8bb252a6cb6ba42595060b7bf6df3dbc1f50" @@ -7157,11 +6164,6 @@ pascalcase@^0.1.1: resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= -path-browserify@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.1.tgz#e6c4ddd7ed3aa27c68a20cc4e50e1a4ee83bbc4a" - integrity sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ== - path-dirname@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" @@ -7232,17 +6234,6 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -pbkdf2@^3.0.3: - version "3.0.17" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6" - integrity sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA== - dependencies: - create-hash "^1.1.2" - create-hmac "^1.1.4" - ripemd160 "^2.0.1" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - pegjs@^0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/pegjs/-/pegjs-0.10.0.tgz#cf8bafae6eddff4b5a7efb185269eaaf4610ddbd" @@ -7313,14 +6304,7 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -please-upgrade-node@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.1.1.tgz#ed320051dfcc5024fae696712c8288993595e8ac" - integrity sha512-KY1uHnQ2NlQHqIJQpnh/i54rKkuxCEBx+voJIS/Mvb+L2iYd2NMotwduhKTMjfC1uKoX3VXOxLjIYG66dfJTVQ== - dependencies: - semver-compare "^1.0.0" - -please-upgrade-node@^3.2.0: +please-upgrade-node@^3.1.1, please-upgrade-node@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942" integrity sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg== @@ -7362,11 +6346,6 @@ process-nextick-args@~2.0.0: resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== -process@^0.11.10: - version "0.11.10" - resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" - integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= - progress@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" @@ -7386,12 +6365,12 @@ promise-retry@^1.1.1: retry "^0.10.0" prompts@^2.0.1: - version "2.1.0" - resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.1.0.tgz#bf90bc71f6065d255ea2bdc0fe6520485c1b45db" - integrity sha512-+x5TozgqYdOwWsQFZizE/Tra3fKvAoy037kOyU6cgz84n8f6zxngLOV4O32kTwt9FcLCxAqw0P/c8rOr9y+Gfg== + version "2.2.1" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.2.1.tgz#f901dd2a2dfee080359c0e20059b24188d75ad35" + integrity sha512-VObPvJiWPhpZI6C5m60XOzTfnYg/xc/an+r9VYymj9WJW3B/DIH+REzjpAACPf8brwPeP+7vz3bIim3S+AaMjw== dependencies: - kleur "^3.0.2" - sisteransi "^1.0.0" + kleur "^3.0.3" + sisteransi "^1.0.3" promzard@^0.3.0: version "0.3.0" @@ -7400,15 +6379,6 @@ promzard@^0.3.0: dependencies: read "1" -prop-types@^15.7.2: - version "15.7.2" - resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" - integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== - dependencies: - loose-envify "^1.4.0" - object-assign "^4.1.1" - react-is "^16.8.1" - proto-list@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" @@ -7426,32 +6396,10 @@ protoduck@^5.0.1: dependencies: genfun "^5.0.0" -prr@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" - integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= - -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= - psl@^1.1.24, psl@^1.1.28: - version "1.2.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.2.0.tgz#df12b5b1b3a30f51c329eacbdef98f3a6e136dc6" - integrity sha512-GEn74ZffufCmkDDLNcl3uuyF/aSD6exEyh1v/ZSdAomB82t6G9hzJVRx0jBmLDW+VfZqks3aScmMw9DszwUalA== - -public-encrypt@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" - integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== - dependencies: - bn.js "^4.1.0" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - parse-asn1 "^5.0.0" - randombytes "^2.0.1" - safe-buffer "^5.1.2" + version "1.4.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.4.0.tgz#5dd26156cdb69fa1fdb8ab1991667d3f80ced7c2" + integrity sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw== pump@^2.0.0: version "2.0.1" @@ -7478,12 +6426,7 @@ pumpify@^1.3.3: inherits "^2.0.3" pump "^2.0.0" -punycode@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= - -punycode@^1.2.4, punycode@^1.4.1: +punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= @@ -7503,36 +6446,11 @@ qs@~6.5.2: resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== -querystring-es3@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" - integrity sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM= - -querystring@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= - quick-lru@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" integrity sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g= -randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: - version "2.1.0" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" - integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== - dependencies: - safe-buffer "^5.1.0" - -randomfill@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" - integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== - dependencies: - randombytes "^2.0.5" - safe-buffer "^5.1.0" - rc@^1.2.7: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" @@ -7543,22 +6461,22 @@ rc@^1.2.7: minimist "^1.2.0" strip-json-comments "~2.0.1" -react-is@^16.8.1, react-is@^16.8.4: - version "16.8.6" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" - integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA== +react-is@^16.8.4: + version "16.10.2" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.10.2.tgz#984120fd4d16800e9a738208ab1fba422d23b5ab" + integrity sha512-INBT1QEgtcCCgvccr5/86CfD71fw9EPmDxgiJX4I2Ddr6ZsV6iFXsuby+qWJPtmNuMY0zByTsG4468P7nHuNWA== read-cmd-shim@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-1.0.1.tgz#2d5d157786a37c055d22077c32c53f8329e91c7b" - integrity sha1-LV0Vd4ajfAVdIgd8MsU/gynpHHs= + version "1.0.4" + resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-1.0.4.tgz#b4a53d43376211b45243f0072b6e603a8e37640d" + integrity sha512-Pqpl3qJ/QdOIjRYA0q5DND/gLvGOfpIz/fYVDGYpOXfW/lFrIttmLsBnd6IkyK10+JHU9zhsaudfvrQTBB9YFQ== dependencies: graceful-fs "^4.1.2" "read-package-json@1 || 2", read-package-json@^2.0.0, read-package-json@^2.0.13: - version "2.0.13" - resolved "https://registry.yarnpkg.com/read-package-json/-/read-package-json-2.0.13.tgz#2e82ebd9f613baa6d2ebe3aa72cefe3f68e41f4a" - integrity sha512-/1dZ7TRZvGrYqE0UAfN6qQb5GYBsNcqS1C0tNK601CFOJmtHI7NIGXwetEPU/OtoFHZL3hDxm4rolFFVE9Bnmg== + version "2.1.0" + resolved "https://registry.yarnpkg.com/read-package-json/-/read-package-json-2.1.0.tgz#e3d42e6c35ea5ae820d9a03ab0c7291217fc51d5" + integrity sha512-KLhu8M1ZZNkMcrq1+0UJbR8Dii8KZUqB0Sha4mOx/bknfKI/fyrQVrG/YIt2UOtG667sD8+ee4EXMM91W9dC+A== dependencies: glob "^7.1.1" json-parse-better-errors "^1.0.1" @@ -7608,15 +6526,6 @@ read-pkg-up@^4.0.0: find-up "^3.0.0" read-pkg "^3.0.0" -read-pkg-up@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-6.0.0.tgz#da75ce72762f2fa1f20c5a40d4dd80c77db969e3" - integrity sha512-odtTvLl+EXo1eTsMnoUHRmg/XmXdTkwXVxy4VFE9Kp6cCq7b3l7QMdBndND3eAFzrbSAXC/WCUOQQ9rLjifKZw== - dependencies: - find-up "^4.0.0" - read-pkg "^5.1.1" - type-fest "^0.5.0" - read-pkg@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" @@ -7661,7 +6570,7 @@ read@1, read@~1.0.1: dependencies: mute-stream "~0.0.4" -"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== @@ -7693,15 +6602,6 @@ readdir-scoped-modules@^1.0.0: graceful-fs "^4.1.2" once "^1.3.0" -readdirp@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" - integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== - dependencies: - graceful-fs "^4.1.11" - micromatch "^3.1.10" - readable-stream "^2.0.2" - realpath-native@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c" @@ -7743,9 +6643,9 @@ regenerator-runtime@^0.11.0: integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== regenerator-runtime@^0.13.2: - version "0.13.2" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz#32e59c9a6fb9b1a4aff09b4930ca2d4477343447" - integrity sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA== + version "0.13.3" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz#7cf6a77d8f5c6f60eb73c5fc1955b2ceb01e6bf5" + integrity sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw== regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" @@ -7886,14 +6786,7 @@ resolve@1.1.7: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= -resolve@1.x, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.11.0, resolve@^1.3.2, resolve@^1.5.0: - version "1.11.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.1.tgz#ea10d8110376982fef578df8fc30b9ac30a07a3e" - integrity sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw== - dependencies: - path-parse "^1.0.6" - -resolve@^1.1.6: +resolve@1.x, resolve@^1.1.6, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.3.2, resolve@^1.5.0: version "1.12.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6" integrity sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w== @@ -7928,7 +6821,14 @@ right-pad@^1.0.1: resolved "https://registry.yarnpkg.com/right-pad/-/right-pad-1.0.1.tgz#8ca08c2cbb5b55e74dafa96bf7fd1a27d568c8d0" integrity sha1-jKCMLLtbVedNr6lr9/0aJ9VoyNA= -rimraf@2, rimraf@2.6.3, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3: +rimraf@2, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== + dependencies: + glob "^7.1.3" + +rimraf@2.6.3: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== @@ -7942,14 +6842,6 @@ rimraf@^3.0.0: dependencies: glob "^7.1.3" -ripemd160@^2.0.0, ripemd160@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" - integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - rsvp@^4.8.4: version "4.8.5" resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" @@ -7980,13 +6872,13 @@ run-queue@^1.0.0, run-queue@^1.0.3: aproba "^1.1.1" rxjs@^6.3.3, rxjs@^6.4.0: - version "6.5.2" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.2.tgz#2e35ce815cd46d84d02a209fb4e5921e051dbec7" - integrity sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg== + version "6.5.3" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.3.tgz#510e26317f4db91a7eb1de77d9dd9ba0a4899a3a" + integrity sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA== dependencies: tslib "^1.9.0" -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0: +safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== @@ -8028,41 +6920,27 @@ sax@^1.2.4: resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== -schema-utils@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770" - integrity sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g== - dependencies: - ajv "^6.1.0" - ajv-errors "^1.0.0" - ajv-keywords "^3.1.0" - semver-compare@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= "semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0: - version "5.7.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" - integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== semver@5.5.0: version "5.5.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" integrity sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA== -semver@6.1.1: - version "6.1.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.1.1.tgz#53f53da9b30b2103cd4f15eab3a18ecbcb210c9b" - integrity sha512-rWYq2e5iYW+fFe/oPPtYJxYgjBm8sC4rmoGdUOgBB7VnwKt6HrL793l2voH1UlsyYZpJ4g0wfjnTEO1s1NP2eQ== - -semver@^6.0.0, semver@^6.1.1: +semver@6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.2.0.tgz#4d813d9590aaf8a9192693d6c85b9344de5901db" integrity sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A== -semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: +semver@^6.0.0, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== @@ -8072,11 +6950,6 @@ semver@~5.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" integrity sha1-myzl094C0XxgEq0yaqa00M9U+U8= -serialize-javascript@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.7.0.tgz#d6e0dfb2a3832a8c94468e6eb1db97e55a192a65" - integrity sha512-ke8UG8ulpFOxO8f8gRYabHQe/ZntKlcig2Mp+8+URDP1D8vJZ0KUt7LYo07q25Z/+JVSgpr/cui9PIp5H6/+nA== - set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -8092,19 +6965,6 @@ set-value@^2.0.0, set-value@^2.0.1: is-plain-object "^2.0.3" split-string "^3.0.1" -setimmediate@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" - integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= - -sha.js@^2.4.0, sha.js@^2.4.8: - version "2.4.11" - resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" - integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" @@ -8136,10 +6996,10 @@ signal-exit@^3.0.0, signal-exit@^3.0.2: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= -sisteransi@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.2.tgz#ec57d64b6f25c4f26c0e2c7dd23f2d7f12f7e418" - integrity sha512-ZcYcZcT69nSLAR2oLN2JwNmLkJEKGooFMCdvOkFrToUt/WfcRWqhIg4P4KwY4dmLbuyXIx4o4YmPsvMRJYJd/w== +sisteransi@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.3.tgz#98168d62b79e3a5e758e27ae63c4a053d748f4eb" + integrity sha512-SbEG75TzH8G7eVXFSN5f9EExILKfly7SUvVY5DhhYLvfhKqhDFY0OzevWa/zwak0RLRfWS5AvfMWpd9gJvr5Yg== slash@^1.0.0: version "1.0.0" @@ -8233,11 +7093,6 @@ sort-keys@^2.0.0: dependencies: is-plain-obj "^1.0.0" -source-list-map@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" - integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== - source-map-resolve@^0.5.0: version "0.5.2" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" @@ -8249,10 +7104,10 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.5.6, source-map-support@~0.5.12: - version "0.5.12" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599" - integrity sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ== +source-map-support@^0.5.6: + version "0.5.13" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" + integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -8364,14 +7219,6 @@ stealthy-require@^1.1.1: resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= -stream-browserify@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.2.tgz#87521d38a44aa7ee91ce1cd2a47df0cb49dd660b" - integrity sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg== - dependencies: - inherits "~2.0.1" - readable-stream "^2.0.2" - stream-each@^1.1.0: version "1.2.3" resolved "https://registry.yarnpkg.com/stream-each/-/stream-each-1.2.3.tgz#ebe27a0c389b04fbcc233642952e10731afa9bae" @@ -8380,26 +7227,15 @@ stream-each@^1.1.0: end-of-stream "^1.1.0" stream-shift "^1.0.0" -stream-http@^2.7.2: - version "2.8.3" - resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" - integrity sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw== - dependencies: - builtin-status-codes "^3.0.0" - inherits "^2.0.1" - readable-stream "^2.3.6" - to-arraybuffer "^1.0.0" - xtend "^4.0.0" - stream-shift@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" integrity sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI= string-argv@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.0.tgz#0ea99e7257fea5e97a1bfcdfc19cf12d68e6ec6a" - integrity sha512-NGZHq3nkSXVtGZXTBjFru3MNfoZyIzN25T7BmvdgnSC0LCJczAGLLMQLyjywSIaAoqSemgLzBRHOsnrHbt60+Q== + version "0.3.1" + resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" + integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg== string-length@^2.0.0: version "2.0.0" @@ -8435,12 +7271,28 @@ string-width@^3.0.0, string-width@^3.1.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" -string_decoder@^1.0.0, string_decoder@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" - integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w== +string.prototype.trimleft@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz#6cc47f0d7eb8d62b0f3701611715a3954591d634" + integrity sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw== dependencies: - safe-buffer "~5.1.0" + define-properties "^1.1.3" + function-bind "^1.1.1" + +string.prototype.trimright@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz#669d164be9df9b6f7559fa8e89945b168a5a6c58" + integrity sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg== + dependencies: + define-properties "^1.1.3" + function-bind "^1.1.1" + +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" string_decoder@~1.1.1: version "1.1.1" @@ -8542,7 +7394,7 @@ supports-color@^2.0.0: resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= -supports-color@^5.2.0, supports-color@^5.3.0: +supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== @@ -8567,33 +7419,23 @@ symbol-tree@^3.2.2: integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== table@^5.2.3: - version "5.4.4" - resolved "https://registry.yarnpkg.com/table/-/table-5.4.4.tgz#6e0f88fdae3692793d1077fd172a4667afe986a6" - integrity sha512-IIfEAUx5QlODLblLrGTTLJA7Tk0iLSGBvgY8essPRVNGHAzThujww1YqHLs6h3HfTg55h++RzLHH5Xw/rfv+mg== + version "5.4.6" + resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" + integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== dependencies: ajv "^6.10.2" lodash "^4.17.14" slice-ansi "^2.1.0" string-width "^3.0.0" -tapable@^0.1.8: - version "0.1.10" - resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.1.10.tgz#29c35707c2b70e50d07482b5d202e8ed446dafd4" - integrity sha1-KcNXB8K3DlDQdIK10gLo7URtr9Q= - -tapable@^1.0.0, tapable@^1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" - integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== - -tar@^4, tar@^4.4.10, tar@^4.4.8: - version "4.4.10" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.10.tgz#946b2810b9a5e0b26140cf78bea6b0b0d689eba1" - integrity sha512-g2SVs5QIxvo6OLp0GudTqEf05maawKUxXru104iaayWA09551tFCTI8f1Asb4lPfkBr91k07iL4c11XO3/b0tA== +tar@^4, tar@^4.4.10, tar@^4.4.12, tar@^4.4.8: + version "4.4.13" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" + integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA== dependencies: chownr "^1.1.1" fs-minipass "^1.2.5" - minipass "^2.3.5" + minipass "^2.8.6" minizlib "^1.2.1" mkdirp "^0.5.0" safe-buffer "^5.1.2" @@ -8616,31 +7458,6 @@ temp-write@^3.4.0: temp-dir "^1.0.0" uuid "^3.0.1" -terser-webpack-plugin@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.3.0.tgz#69aa22426299f4b5b3775cbed8cb2c5d419aa1d4" - integrity sha512-W2YWmxPjjkUcOWa4pBEv4OP4er1aeQJlSo2UhtCFQCuRXEHjOFscO8VyWHj9JLlA0RzQb8Y2/Ta78XZvT54uGg== - dependencies: - cacache "^11.3.2" - find-cache-dir "^2.0.0" - is-wsl "^1.1.0" - loader-utils "^1.2.3" - schema-utils "^1.0.0" - serialize-javascript "^1.7.0" - source-map "^0.6.1" - terser "^4.0.0" - webpack-sources "^1.3.0" - worker-farm "^1.7.0" - -terser@^4.0.0: - version "4.1.2" - resolved "https://registry.yarnpkg.com/terser/-/terser-4.1.2.tgz#b2656c8a506f7ce805a3f300a2ff48db022fa391" - integrity sha512-jvNoEQSPXJdssFwqPSgWjsOrb+ELoE+ILpHPKXC83tIxOlh2U75F1KuB2luLD/3a6/7K3Vw5pDn+hvu0C4AzSw== - dependencies: - commander "^2.20.0" - source-map "~0.6.1" - source-map-support "~0.5.12" - test-exclude@^5.2.3: version "5.2.3" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0" @@ -8705,13 +7522,6 @@ through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6: resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= -timers-browserify@^2.0.4: - version "2.0.10" - resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.10.tgz#1d28e3d2aadf1d5a5996c4e9f95601cd053480ae" - integrity sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg== - dependencies: - setimmediate "^1.0.4" - tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" @@ -8719,16 +7529,18 @@ tmp@^0.0.33: dependencies: os-tmpdir "~1.0.2" +tmp@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.1.0.tgz#ee434a4e22543082e294ba6201dcc6eafefa2877" + integrity sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw== + dependencies: + rimraf "^2.6.3" + tmpl@1.0.x: version "1.0.4" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE= -to-arraybuffer@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" - integrity sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M= - to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" @@ -8804,20 +7616,16 @@ trim-off-newlines@^1.0.0: resolved "https://registry.yarnpkg.com/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz#9f9ba9d9efa8764c387698bcbfeb2c848f11adb3" integrity sha1-n5up2e+odkw4dpi8v+sshI8RrbM= -trim-right@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" - integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= - ts-jest@^24.0.0: - version "24.0.2" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-24.0.2.tgz#8dde6cece97c31c03e80e474c749753ffd27194d" - integrity sha512-h6ZCZiA1EQgjczxq+uGLXQlNgeg02WWJBbeT8j6nyIBRQdglqbvzDoHahTEIiS6Eor6x8mK6PfZ7brQ9Q6tzHw== + version "24.1.0" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-24.1.0.tgz#2eaa813271a2987b7e6c3fefbda196301c131734" + integrity sha512-HEGfrIEAZKfu1pkaxB9au17b1d9b56YZSqz5eCVE8mX68+5reOvlM93xGOzzCREIov9mdH7JBG+s0UyNAqr0tQ== dependencies: bs-logger "0.x" buffer-from "1.x" fast-json-stable-stringify "2.x" json5 "2.x" + lodash.memoize "4.x" make-error "1.x" mkdirp "0.x" resolve "1.x" @@ -8825,9 +7633,9 @@ ts-jest@^24.0.0: yargs-parser "10.x" ts-node@^8.3.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.3.0.tgz#e4059618411371924a1fb5f3b125915f324efb57" - integrity sha512-dyNS/RqyVTDcmNM4NIBAeDMpsAdaQ+ojdf0GOLqE6nwJOgzEkdRNzJywhDfwnuvB10oa6NLVG1rUJQCpRN7qoQ== + version "8.4.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.4.1.tgz#270b0dba16e8723c9fa4f9b4775d3810fd994b4f" + integrity sha512-5LpRN+mTiCs7lI5EtbXmF/HfMeCjzt7DH9CZwtkr6SywStrNQC723wG+aOWFiLNn7zT3kD/RnFqi3ZUfr4l5Qw== dependencies: arg "^4.1.0" diff "^4.0.1" @@ -8841,15 +7649,15 @@ tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0: integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== tslint@^5.19.0: - version "5.19.0" - resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.19.0.tgz#a2cbd4a7699386da823f6b499b8394d6c47bb968" - integrity sha512-1LwwtBxfRJZnUvoS9c0uj8XQtAnyhWr9KlNvDIdB+oXyT+VpsOAaEhEgKi1HrZ8rq0ki/AAnbGSv4KM6/AfVZw== + version "5.20.0" + resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.20.0.tgz#fac93bfa79568a5a24e7be9cdde5e02b02d00ec1" + integrity sha512-2vqIvkMHbnx8acMogAERQ/IuINOq6DFqgF8/VDvhEkBqQh/x6SP0Y+OHnKth9/ZcHQSroOZwUQSN18v8KKF0/g== dependencies: "@babel/code-frame" "^7.0.0" builtin-modules "^1.1.1" chalk "^2.3.0" commander "^2.12.1" - diff "^3.2.0" + diff "^4.0.1" glob "^7.1.1" js-yaml "^3.13.1" minimatch "^3.0.4" @@ -8873,11 +7681,6 @@ tsutils@^3.17.1: dependencies: tslib "^1.8.1" -tty-browserify@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" - integrity sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY= - tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -8902,11 +7705,6 @@ type-fest@^0.3.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.3.1.tgz#63d00d204e059474fe5e1b7c011112bbd1dc29e1" integrity sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ== -type-fest@^0.5.0: - version "0.5.2" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.5.2.tgz#d6ef42a0356c6cd45f49485c3b6281fc148e48a2" - integrity sha512-DWkS49EQKVX//Tbupb9TFa19c7+MK1XmzkrZUR8TAktmE/DizXoaoJV6TZ/tSIPXipqNiRI6CyAe7x69Jb6RSw== - type-fest@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" @@ -8917,10 +7715,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@*, "typescript@>=3.2.1 <3.7.0": - version "3.6.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.2.tgz#105b0f1934119dde543ac8eb71af3a91009efe54" - integrity sha512-lmQ4L+J6mnu3xweP8+rOrUwzmN+MRAj7TgtJtDaXE5PMyX2kCrklhg3rvOsOIfNeAWMQWO2F1GPc1kMD2vLAfw== +typescript@*, "typescript@>=3.2.1 <3.8.0 || >3.7.0-dev.0", typescript@^3.7.0-dev.20191021: + version "3.7.0-dev.20191021" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.0-dev.20191021.tgz#e0238e0b3eed9fc265767a1b7f5346fea8ab5edb" + integrity sha512-SSx/+QkyW7PMcaGQXzVmVkrRmmaLFsdOYXhP9sY9eYMiHrfmtZE9EL2hjtbihfnpyWfCmPup69VgbB4dTTEQgg== uglify-js@^3.1.4: version "3.6.0" @@ -8964,12 +7762,12 @@ unique-slug@^2.0.0: dependencies: imurmurhash "^0.1.4" -universal-user-agent@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-3.0.0.tgz#4cc88d68097bffd7ac42e3b7c903e7481424b4b9" - integrity sha512-T3siHThqoj5X0benA5H0qcDnrKGXzU8TKoX15x/tQHw1hQBvIEBHjxQ2klizYsqBOO/Q+WuxoQUihadeeqDnoA== +universal-user-agent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-4.0.0.tgz#27da2ec87e32769619f68a14996465ea1cb9df16" + integrity sha512-eM8knLpev67iBDizr/YtqkJsF3GK8gzDc6st/WKzrTuPtcsOKW/0IdL4cnMBsU69pOx0otavLWBDGTwg+dB0aA== dependencies: - os-name "^3.0.0" + os-name "^3.1.0" universalify@^0.1.0: version "0.1.2" @@ -8984,11 +7782,6 @@ unset-value@^1.0.0: has-value "^0.3.1" isobject "^3.0.0" -upath@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.2.tgz#3db658600edaeeccbe6db5e684d67ee8c2acd068" - integrity sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q== - uri-js@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" @@ -9001,19 +7794,6 @@ urix@^0.1.0: resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= -url-template@^2.0.8: - version "2.0.8" - resolved "https://registry.yarnpkg.com/url-template/-/url-template-2.0.8.tgz#fc565a3cccbff7730c775f5641f9555791439f21" - integrity sha1-/FZaPMy/93MMd19WQflVV5FDnyE= - -url@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" - integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= - dependencies: - punycode "1.3.2" - querystring "0.2.0" - use@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" @@ -9039,24 +7819,10 @@ util.promisify@^1.0.0: define-properties "^1.1.2" object.getownpropertydescriptors "^2.0.3" -util@0.10.3: - version "0.10.3" - resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" - integrity sha1-evsa/lCAUkZInj23/g7TeTNqwPk= - dependencies: - inherits "2.0.1" - -util@^0.11.0: - version "0.11.1" - resolved "https://registry.yarnpkg.com/util/-/util-0.11.1.tgz#3236733720ec64bb27f6e26f421aaa2e1b588d61" - integrity sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ== - dependencies: - inherits "2.0.3" - uuid@^3.0.1, uuid@^3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" - integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== + version "3.3.3" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866" + integrity sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ== v8-compile-cache@^2.0.3: version "2.1.0" @@ -9087,11 +7853,6 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -vm-browserify@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.0.tgz#bd76d6a23323e2ca8ffa12028dc04559c75f9019" - integrity sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw== - w3c-hr-time@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045" @@ -9106,15 +7867,6 @@ walker@^1.0.7, walker@~1.0.5: dependencies: makeerror "1.0.x" -watchpack@^1.5.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.6.0.tgz#4bc12c2ebe8aa277a71f1d3f14d685c7b446cd00" - integrity sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA== - dependencies: - chokidar "^2.0.2" - graceful-fs "^4.1.2" - neo-async "^2.5.0" - wcwidth@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" @@ -9127,43 +7879,6 @@ webidl-conversions@^4.0.2: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== -webpack-sources@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.3.0.tgz#2a28dcb9f1f45fe960d8f1493252b5ee6530fa85" - integrity sha512-OiVgSrbGu7NEnEvQJJgdSFPl2qWKkWq5lHMhgiToIiN9w34EBnjYzSYs+VbL5KoYiLNtFFa7BZIKxRED3I32pA== - dependencies: - source-list-map "^2.0.0" - source-map "~0.6.1" - -webpack@^4.33.0: - version "4.36.1" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.36.1.tgz#f546fda7a403a76faeaaa7196c50d12370ed18a9" - integrity sha512-Ej01/N9W8DVyhEpeQnbUdGvOECw0L46FxS12cCOs8gSK7bhUlrbHRnWkjiXckGlHjUrmL89kDpTRIkUk6Y+fKg== - dependencies: - "@webassemblyjs/ast" "1.8.5" - "@webassemblyjs/helper-module-context" "1.8.5" - "@webassemblyjs/wasm-edit" "1.8.5" - "@webassemblyjs/wasm-parser" "1.8.5" - acorn "^6.2.0" - ajv "^6.1.0" - ajv-keywords "^3.1.0" - chrome-trace-event "^1.0.0" - enhanced-resolve "^4.1.0" - eslint-scope "^4.0.0" - json-parse-better-errors "^1.0.2" - loader-runner "^2.3.0" - loader-utils "^1.1.0" - memory-fs "~0.4.1" - micromatch "^3.1.8" - mkdirp "~0.5.0" - neo-async "^2.5.0" - node-libs-browser "^2.0.0" - schema-utils "^1.0.0" - tapable "^1.1.0" - terser-webpack-plugin "^1.1.0" - watchpack "^1.5.0" - webpack-sources "^1.3.0" - whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: version "1.0.5" resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" @@ -9240,13 +7955,6 @@ wordwrap@~1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= -worker-farm@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8" - integrity sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw== - dependencies: - errno "~0.1.7" - wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" @@ -9346,7 +8054,7 @@ xml-name-validator@^3.0.0: resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== -xtend@^4.0.0, xtend@~4.0.1: +xtend@~4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== @@ -9356,15 +8064,10 @@ xtend@^4.0.0, xtend@~4.0.1: resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= - yallist@^3.0.0, yallist@^3.0.2, yallist@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" - integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== + version "3.1.1" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" + integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== yargs-parser@10.x, yargs-parser@^10.0.0: version "10.1.0" @@ -9407,7 +8110,7 @@ yargs@^12.0.1: y18n "^3.2.1 || ^4.0.0" yargs-parser "^11.1.1" -yargs@^13.1.0, yargs@^13.3.0: +yargs@^13.3.0: version "13.3.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.0.tgz#4c657a55e07e5f2cf947f8a366567c04a0dedc83" integrity sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA== @@ -9423,7 +8126,24 @@ yargs@^13.1.0, yargs@^13.3.0: y18n "^4.0.0" yargs-parser "^13.1.1" +yargs@^14.0.0: + version "14.0.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-14.0.0.tgz#ba4cacc802b3c0b3e36a9e791723763d57a85066" + integrity sha512-ssa5JuRjMeZEUjg7bEL99AwpitxU/zWGAGpdj0di41pOEmJti8NR6kyUIJBkR78DTYNPZOU08luUo0GTHuB+ow== + dependencies: + cliui "^5.0.0" + decamelize "^1.2.0" + find-up "^3.0.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^3.0.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^13.1.1" + yn@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.0.tgz#fcbe2db63610361afcc5eb9e0ac91e976d046114" - integrity sha512-kKfnnYkbTfrAdd0xICNFw7Atm8nKpLcLv9AZGEt+kczL/WQVai4e2V6ZN8U/O+iI6WrNuJjNNOyu4zfhl9D3Hg== + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==